Questions tagged [postgresql-9.4]

PostgreSQL version 9.4

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Migrate PostgreSQL between different releases (9.4 to 14)

I have a Debian 8 with Postgresql 9.4 server. I would like to upgrade it to the last version (Debian 11 with Postgresql 14). What would be the best practice? I was thinking of creating a new server ...
user avatar
0 votes
1 answer
33 views

DELETEd Lots of Rows from pg_largeobject, pg_freespacemap Curiosity

postgres noobie, PG 9.4 (please don't say I need to update PG, thx) Database has huge pg_largeobject (PGLOB) table (~450GB, 169.5M rows, lots of DML leading to ~95GB/~22% free space - all per ...
user avatar
2 votes
0 answers
19 views

Cannot Create Extension vacuumlo postgresql 9.4

I tried to CREATE EXTENSION vacuumlo, but it fails with the following message: "/usr/pgsql-9.4/share/extension/vacuumlo.control": no such file or directory. I can see other .sql and ....
user avatar
0 votes
1 answer
467 views

Invalid input syntax for timestamp error with Postgres Copy command

I am trying to load data in Postgres through COPY command in a SQL file COPY <table name> (<column1>, <column2>, <column3> etc etc) FROM stdin; 1 test1 test2 ...
user avatar
1 vote
1 answer
119 views

Count of Saturdays and Sundays in a given month in PostgreSQL

How can I get a count of the Saturdays and the Sundays in a given month in PostgreSQL? I am getting total days count, or total Saturday and Sunday days in a month. For month days code: SELECT ...
user avatar
0 votes
0 answers
109 views

pg_basebackup tablespace-mapping not working (windows)

I am attempting to do a local pg_basebackup but receive the following error: PS C:\Program Files\PostgreSQL\9.4\bin> .\pg_basebackup.exe -Fp -D D:/local-backup -Xs -P -v -U postgres -T C:/test-...
user avatar
  • 11
1 vote
2 answers
558 views

Postgresql update slow on a relative small/medium table

I'm trying to run an update on a table with 10 million rows (I just need to update a few), but the query is taking more time than I would like. This is the table deinifition: CREATE TABLE ...
user avatar
  • 11
0 votes
0 answers
25 views

Postgreslq, ¿How do I create a trigger that UPDATES, null values, under conditions?

I am doing a trigger, in which: You must first compare the "nro_persona" value of table "conductor" with table "event". If it exists, ask if the "nombre_completo&...
user avatar
0 votes
1 answer
453 views

pgAdmin - "cannot open logfile!" (WINDOWS 10; Postgres 9.4)

Our Windows 10 clients have both PostgreSQL 9.4 and pgAdmin3 (v1.22) installed. I keep receiving the FATAL: "Cannot open the logfile!" error by invoking pgAdmin3 in either of the following ...
user avatar
1 vote
1 answer
356 views

PostgreSQL - 1 billion rows table cannot get vacuumed despite no errors

I have a statistics table that should be processed in a scheduled task to remove rows and count them into a separate, smaller table. Unfortunately the cron task failed for some period of time and the ...
user avatar
-1 votes
1 answer
480 views

Single query to replace a value in multiple tables with same column

I am using Postgres SQL. I am having multiple tables say table1, table2, table3, table4, ... with a common column say name in each of the tables. I want to replace a the value 'Jhon' with 'Jimmy' in ...
user avatar
  • 3
1 vote
2 answers
92 views

Unexpected behaviour for GROUP BY query

CREATE TABLE public.temp ( id integer, a integer, b integer, x integer ); select x, a, b from temp group by id, a, b; ends up with expected error: ERROR: column "temp.x&...
user avatar
  • 133
1 vote
3 answers
2k views

Why is the database size larger than sum of table sizes

I wanted to know why database size is a way greater than thesum of table size in a database? How does it change?
user avatar
  • 33
2 votes
1 answer
145 views

Caveats of OUTER JOIN on nested JSON value

I'm writing a query which is supposed to find the elements from a list which DO NOT exist in the DB. My first attempt at this was to use a nested query where the first query fetches the ids, then I ...
user avatar
  • 151
0 votes
0 answers
356 views

How to take backup of PostgreSQL 9.4 database to remote server using pg_basebackup?

We want to take the logical and base backup on different server machine in the network. Currently both backups are running on same server machine causing space issues. We have the scripts in place ...
user avatar
0 votes
0 answers
111 views

WAL Archival not working in PostgreSQL V9.4.9 DB server

Our DB servers are on VM, during planned server restart for system patch deployment our Master DB server crashed. We have taken the clone of Primary Slave VM and restore the Master DB using last ...
user avatar
1 vote
0 answers
48 views

Postgres Major version upgrade 9.4 -> 9.6. PITR compatibility across versions?

Just dug into postgres documentation and couldn't get a clear answer on this. With Debian Jessie hitting EOL for Debian LTS in June, we are upgrading our database servers along with our other servers ...
user avatar
3 votes
0 answers
1k views

How do I fix multixact wraparound after it has already occurred?

I have a database which has a single table for which MultiXact wraparound has already occurred. Neither manual vacuums nor automatic vacuums are able to fix this condition. Manual vacuums fail almost ...
user avatar
  • 219
1 vote
1 answer
466 views

Does the Postgres 9.4.9 update fix MultiXactId "does no longer exist" in addition to "has not been created yet" errors?

Postgres 9.4.9 has a fix in it's release notes which reads (emphasis mine): Prevent possible failure when vacuuming multixact IDs in an installation that has been pg_upgrade'd from pre-9.3 (Andrew ...
user avatar
  • 219
2 votes
1 answer
417 views

Does postgres single-user mode use postgresql.conf settings?

Does running postgres in single-user mode (--single argument) cause postgres to start and use the settings present in the postgresql.conf file in the data directory defined by the -D option? I am ...
user avatar
  • 219
0 votes
1 answer
226 views

Postgres 9.4.5 small table grows into huge size - periodic VACUUM FULL needed

We are running a PostgreSQL database on Windows Server. The database version is 9.4.5 (it's been running stable for a long time now so we aren't updating it). Some of our tables have millions of rows,...
user avatar
0 votes
1 answer
406 views

Postgres ignoring GIN index for LIKE query?

I am working in Postgres 9.4. I have a table and index like this: Table "public.title" Column | Type | ...
user avatar
  • 225
0 votes
0 answers
2k views

Unit postgresql.service failed to load: No such file or directory

When i try to connect to my postgres database, i get the error below: could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "10.2.1.96" and accepting ...
user avatar
  • 47
0 votes
1 answer
85 views

slow count queries - what are we doing wrong?

Using Postgresql 9.6.14, running the following query: SELECT COUNT(*) AS "__count" FROM "crm_client" INNER JOIN "crm_role" ON ("crm_client"."role_ptr_id" = "crm_role"."id") INNER ...
user avatar
  • 101
2 votes
1 answer
3k views

Postgres - Vacuum doesn't complete on large/busy table

We have a decently active PG database hosted on AWS. We recently started getting notifications like the following: Transaction ID age reached 750 million. Autovacuum parameter values for [...
user avatar
1 vote
1 answer
917 views

PostgreSQL Correlation Between "max_connections" and "numbackends"

I'm trying to figure out why the field numbackends in pg_stat_database never goes above 16 (and often stays the same even after a restart). I have max_connections set to 100 and ...
user avatar
1 vote
1 answer
306 views

move postgresql 9.4 cluster to new server

I have a redmine postgresql folder backup (no dump) from postgresql 9.4 and want to move it to a new server with debian 10 (buster) with postgres 11. On my debian buster server I tried to get this ...
user avatar
  • 798
0 votes
1 answer
85 views

Comparing nullable column values using "IS NULL" versus "= NULL"

I'm dealing with nullable values in a column of a table, i'm wondering why this: with cte as ( select 'c1'::text as c1,null::text as c2 union select 'c2'::text as c1,null::text as c2 ) ...
user avatar
  • 437
0 votes
3 answers
452 views

How to SELECT "closest" rows from another table?

I have two tables, map1 and map2, there are multiple possible combinations between the columns map1.id1 and map2.id2. I have tried the below query: SELECT map1.id1, map2.id2, MIN(...
user avatar
0 votes
1 answer
46 views

Allow transparently altering View's underlying table

How to create a view that does not prevent altering its underlying table? There's a certain reason why I can't drop and re-create the view every time I need to change a column type or add a new column....
user avatar
  • 223
0 votes
0 answers
304 views

Quering Postgresql digest function inside procedure works on pgadmin but not works by calling via Laravel

recently I have created stored procedure in Postgres Sql which deals about with hashing passwords. When used via PgAdmin tool it works like a charm as stated below. I have also installed extension ...
user avatar
  • 1
0 votes
1 answer
24 views

How to perform count(), count(distinct) in the same output using POSTGRESQL

I am trying to perform both count(distinct(keyword)) and count(keyword) from same tables. Here are the two queries. Query-1 SELECT t1.count(distinct(keyword)) from keyword t1, sent t2,tweets t3,...
user avatar
1 vote
0 answers
137 views

Changing Postmaster File Name in PostgreSQL

I have two instances of PostgreSQL with master-slave replication between them and want to use GlusterFS. Everything works fine until the second instance wants to store the data in the GlusterFS. ...
user avatar
0 votes
1 answer
107 views

FUNCTION BEFORE TRIGGER INEXISTENT OPERATOR date > = double precision

In the 'pubblicazione' table I want to insert some fields of the tuple contained in the 'legge_approvata' table, but to do this the promulgation date must be in the same month and year as the date of ...
user avatar
0 votes
1 answer
380 views

How to make use of WITH in PostgreSQL to reduce query cost

I am trying to get twitter data of narendramodi using below command. SELECT b.t_id,a.profile_image,b.tweet_text,e.media_media_url,b.retweet_count,b.favorite_count as like_count,count(...
user avatar
1 vote
0 answers
4k views

How to run multiple sql statements in Postgres using the tool PGADMIN?

I have 170 Alter Drop Constraint statement, 120 Truncate table, 120 Insert table and 170 Alter Add Constraint. All of these should be run in one in one script as batch script and I'm using PGADMIN IV ...
user avatar
3 votes
1 answer
3k views

Use NEW in FROM clause in Postgres trigger?

I am trying to write a Postgres trigger to unnest an array field before inserting or updating a new row. E.g. SELECT unnest(something) FROM NEW However, this seems to lead to an error: relation '...
user avatar
2 votes
1 answer
1k views

Streaming replication archive folder taking all space- Postgresql- 9.4

We had recently setup postgres streaming replication between master (physical, CentOS release 6.6) and slave(virtual, CentOS 7.6). We did the test and streaming replication is working fine. We ...
user avatar
  • 53
2 votes
1 answer
127 views

Regarding GIN Index in Postgresql

I am facing an issue that Even after creating a GIN INDEX execution plan is taking much time. select email from customer where lower(email) like '%gmail'; CREATE INDEX idx1 ON customer USING gin (...
user avatar
2 votes
3 answers
134 views

Find all items where the 2 latest statuses meet condition

I have a table in a PostgreSQL database like this: ID|Item-FK |timestamp|status ============================= 1 | 123 | ... | EXPIRED 2 | 123 | ... | PENDING ... I want to query all ...
user avatar
  • 123
2 votes
1 answer
1k views

postgres :: FATAL: could not access file "pglogical": No such file or directory

We installed pglogical from source code, we are running PostgreSQL 9.4 make USE_PGXS=1 clean all make USE_PGXS=1 install Installation was successful after updating the parameters, we tried ...
user avatar
3 votes
1 answer
2k views

Streaming replication version between different minor versions

I want to know few details about streaming replication. I want to setup streaming replication between version 9.4.4 and 9.4.20 ? I have the master server in centos6.6 with postgres version 9.4.4 ...
user avatar
  • 53
0 votes
1 answer
1k views

ERROR: relation "codepool_codepoolseq_seq" does not exist SQL state: 42P01

Below is my script but I keep getting an error. -- Table: public.codepool -- DROP TABLE public.codepool; CREATE TABLE public.codepool ( codepoolseq bigint NOT NULL DEFAULT nextval('...
user avatar
1 vote
3 answers
10k views

Downgrading PostgreSQL 10 to 9.4

Are there any particular precautions I should take when downgrading PG 10 to 9.4? I have a database on Heroku (PG 9.4) which I'm going to upgrade to PG 10.6. In case something goes wrong, I want to ...
user avatar
  • 273
2 votes
2 answers
3k views

How to dump multiple databases of the same cluster in single execution?

I have 100 databases in my cluster. I need to backup 30 databases (as single file or multiple file, anything is fine). I could do it for tables using pg_dump with -t. Is there any way to do ...
user avatar
  • 695
0 votes
1 answer
111 views

Streaming replication in postgres question

We have recently setup streaming replication in our Postgres server (t01, t02). t01 is master and t02 is the slave. I want to understand the below two issues: Recently our /var directory of t01 ...
user avatar
  • 53
1 vote
1 answer
58 views

Merge 2 columns and replace with specific output

The setup is a Debian 8 with Postgres 9.4 (64bit if that matters). Given following table I want to "search" for a combination of columns first and column sub and replace their output with another ...
user avatar
1 vote
0 answers
20 views

Calculate percentages by using JOINS result in postgresql

I am trying to calculate percentages by joining 3 tables data to get the percentages of positive_count, negative_count, neutral_count of each user's tweets. I have succeeded in getting positive, ...
user avatar
0 votes
2 answers
44 views

Different results for logically same, but textually different queries

Is there any reason why the following queries would return different results? select count(id) from mytable where status='active' and ((textfield1 ilike '%needle%') or (textfield2 ilike '%...
user avatar
1 vote
1 answer
61 views

Postgresql installation, avoid creating “postgres” user

I have a constraint, that I can use only one user on a SUSE Linux Enterprise Server 11. Now, I need to install PostgreSQL 9.4. Is it possible to somehow avoid the automatic creation of "postgres" ...
user avatar
  • 11

1
2 3 4 5
11