Re: pg_xlog on slaves has grown to 200GB

2019-08-20 Thread Ian Barwick
On 8/20/19 11:17 PM, Vikas Sharma wrote:> Hello, > We are using postgresql 9.5 with repmgr 3.3.2 in streaming replication setup > with 1 master and 2 slaves. I have noticed that the pg_xlog on slaves has > grown to 200GB and is still growing. > > Please advise why pg_xlog is growing and not

Re: Rename a column if not already renamed.?

2019-08-20 Thread Luca Ferrari
On Tue, Aug 20, 2019 at 9:07 PM Day, David wrote: > EXECUTE format ('ALTER TABLE %s RENAME %s TO %s', schema_table_, > old_name_, new_name); Hard to say without the error, but any chance there is a quoting problem? EXECUTE format ('ALTER TABLE %s RENAME %I TO %I', schema_table_, old_name_,

Re: Two Postgres master process are showing - one is on and off

2019-08-20 Thread Steve Crawford
FWIW, the second process (110181) is a child of the main process (33438). I can't recall if any maintenance process that gets automatically activated (autovacuum, checkpoint, stats, etc.) shows with the same name as the main process. Cheers, Steve On Tue, Aug 20, 2019 at 1:32 PM chiru r wrote:

Sv: Two Postgres master process are showing - one is on and off

2019-08-20 Thread Andreas Joseph Krogh
På tirsdag 20. august 2019 kl. 22:32:25, skrev chiru r mailto:chir...@gmail.com>>: Hi All, I have observed one of our PostgreSQL DB instance showing two postgres process on Linux server as highlighted. The second postgres process is on and off. We did not find any references in logs. [...]

Re: Two Postgres master process are showing - one is on and off

2019-08-20 Thread Steve Crawford
(sorry for the top-post - blame GMail) -Steve >

Re: Two Postgres master process are showing - one is on and off

2019-08-20 Thread chiru r
Thank you Adrian. Is the on/off on a regular interval? > My guess is a script(cron possibly) is trying to start the server. > > Yes, It is regular interval. No Con-jobs scheduled on server or even remotely. > > > We did not find any references in logs. > > The information: > > sudo

Re: Databases and servers

2019-08-20 Thread Jeff Janes
On Tue, Aug 20, 2019 at 6:33 AM Karl Martin Skoldebrand < ks0c77...@techmahindra.com> wrote: > Hi, > > I just discovered that a client has done this: > > They have two web applications A1 and A2. They have seperate > hostnames/URLs. Both have a production and a test database A1p and A1t/ A2p >

Re: Databases and servers

2019-08-20 Thread Peter J. Holzer
On 2019-08-20 10:33:17 +, Karl Martin Skoldebrand wrote: > I just discovered that a client has done this: > > They have two web applications A1 and A2. They have seperate hostnames/URLs. > Both have a production and a test database A1p and A1t/ A2p and A2t. > > What they've done is have both

Re: Rename a column if not already renamed.?

2019-08-20 Thread Tom Lane
"Day, David" writes: > The error is something like column already exists and Not sure about the workflow this function is used within, but maybe you need to consider what to do when both the old and new column names exist. Because that sure sounds like what is happening.

Re: Two Postgres master process are showing - one is on and off

2019-08-20 Thread Adrian Klaver
On 8/20/19 1:32 PM, chiru r wrote: Hi All, I have observed one of our PostgreSQL DB instance showing two postgres process on Linux server as highlighted. The second postgres process is on and off. Is the on/off on a regular interval? My guess is a script(cron possibly) is trying to start

Two Postgres master process are showing - one is on and off

2019-08-20 Thread chiru r
Hi All, I have observed one of our PostgreSQL DB instance showing two postgres process on Linux server as highlighted. The second postgres process is on and off. We did not find any references in logs. Please provide your advice and help on this issue. DB version : PostgreSQL *9.5.10*

Re: Rename a column if not already renamed.?

2019-08-20 Thread Adrian Klaver
On 8/20/19 12:50 PM, Day, David wrote: Thanks for the feedback. The error is something like column already exists and Quoting issue is Unlikely, and as I mentioned it works as expected if Im repeating the patch in 11 The above and below us are the parts I am not understanding. Can you

RE: Rename a column if not already renamed.?

2019-08-20 Thread Day, David
Thanks for the feedback. The error is something like column already exists and Quoting issue is Unlikely, and as I mentioned it works as expected if Im repeating the patch in 11.3 And I assume would if I was in 9.6. I suspect it has something to do with the content, or lack of, in the

Re: Rename a column if not already renamed.?

2019-08-20 Thread Adrian Klaver
On 8/20/19 12:07 PM, Day, David wrote: I have a function used by my patch files which attempts to determine if the old column name exists, if so it proceeds with the rename. CREATE OR REPLACE FUNCTION sys.rename_column(schema_table_ regclass, old_name_ text, new_name text) RETURNS boolean

Rename a column if not already renamed.?

2019-08-20 Thread Day, David
I have a function used by my patch files which attempts to determine if the old column name exists, if so it proceeds with the rename. CREATE OR REPLACE FUNCTION sys.rename_column(schema_table_ regclass, old_name_ text, new_name text) RETURNS boolean LANGUAGE plpgsql AS $function$ BEGIN

Re: SELECT all the rows where id is children of other node.

2019-08-20 Thread pabloa98
Thank you for your responses Rob. Appreciated. The problem with recursive queries is that they are executed several times and it has and impact in performance. I need a subset of those rows and I want them in one pass. I discovered that ltree extension could be useful. I will play with it today.

Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist

2019-08-20 Thread Adrian Klaver
On 8/20/19 8:02 AM, Adrian Klaver wrote: On 8/20/19 7:37 AM, Erwin Moller wrote: That is a bummer. Since I have no idea how to safely install an older version of pg_dump alongside my current 10.10 install, I will wait for the patch. A quick test showed that: 1) Go here:

Re: Retroactively adding send and recv functions to a type?

2019-08-20 Thread Tom Lane
Stephen Frost writes: > * Vik Fearing (vik.fear...@2ndquadrant.com) wrote: >> We generally discourage updating the catalogs directly.  This was why I >> wrote the CREATE/ALTER DATABASE patch in 2014 that you helped me with >> (fbb1d7d73f8). >> I'm willing to work on a patch for ALTER TYPE if it

Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist

2019-08-20 Thread Adrian Klaver
On 8/20/19 7:37 AM, Erwin Moller wrote: Op 8/20/2019 om 3:32 PM schreef Adrian Klaver: On 8/20/19 6:18 AM, Erwin Moller wrote: Op 8/20/2019 om 2:07 PM schreef Ian Barwick: On 8/20/19 7:12 PM, Erwin Moller wrote: Hi, While trying to move an old 8.1 Postgres install to a new server with

Re: Pgsql resource agent of pacemaker

2019-08-20 Thread Shital A
On Mon, 19 Aug 2019, 23:36 Shital A, wrote: > > > On Mon, 19 Aug 2019, 18:47 Shital A, wrote: > >> Hello, >> >> Need advise on below situation: >> >> Postgres 9.6 >> Pacemaker 1.1.19 >> Corosync 2.4.3 >> >> We are testing HA setup on a two node cluster using pacemaker, corosync >> stack. The

Re: pg_xlog on slaves has grown to 200GB

2019-08-20 Thread Stephen Frost
Greetings, * Vikas Sharma (shavi...@gmail.com) wrote: > We are using postgresql 9.5 with repmgr 3.3.2 in streaming replication > setup with 1 master and 2 slaves. I have noticed that the pg_xlog on slaves > has grown to 200GB and is still growing. > > Please advise why pg_xlog is growing and not

RE: Can't install postgresql from official postgresql repo on RedHat 8?

2019-08-20 Thread Ubence Quevedo
Hi Devrim, Thank you so much for pointing this out! I thought I had done enough searching on how to work around this, but apparently not. This worked perfectly. Ubence Quevedo IT Applications Analyst Information Technology Services, Business Services Merced County Office of Education 632 West

Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist

2019-08-20 Thread Erwin Moller
Op 8/20/2019 om 3:32 PM schreef Adrian Klaver: On 8/20/19 6:18 AM, Erwin Moller wrote: Op 8/20/2019 om 2:07 PM schreef Ian Barwick: On 8/20/19 7:12 PM, Erwin Moller wrote: Hi, While trying to move an old 8.1 Postgres install to a new server with postgres 10.10, I get an error, listed

Re: Retroactively adding send and recv functions to a type?

2019-08-20 Thread Stephen Frost
Greetings, * Vik Fearing (vik.fear...@2ndquadrant.com) wrote: > On 19/08/2019 19:32, Tom Lane wrote: > > "Johann 'Myrkraverk' Oskarsson" writes: > >> I meant ALTER TYPE. Adding the send and recv functions doesn't seem > >> to supported by ALTER TYPE. > >> Is there a workaround for this? > > You

Re: postmaster utilization

2019-08-20 Thread Stephen Frost
Greetings, * Kyotaro Horiguchi (horikyota@gmail.com) wrote: > At Mon, 19 Aug 2019 10:07:30 -0400, Stephen Frost wrote > in <20190819140730.gh16...@tamriel.snowman.net> > > * Ron (ronljohnso...@gmail.com) wrote: > > > On 8/19/19 5:40 AM, Shiwangini Shishulkar wrote: > > > >We have scheduled

pg_xlog on slaves has grown to 200GB

2019-08-20 Thread Vikas Sharma
Hello, We are using postgresql 9.5 with repmgr 3.3.2 in streaming replication setup with 1 master and 2 slaves. I have noticed that the pg_xlog on slaves has grown to 200GB and is still growing. Please advise why pg_xlog is growing and not pruning itself, is there any parameter I need to setup

Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist

2019-08-20 Thread Tom Lane
Adrian Klaver writes: > On 8/20/19 6:18 AM, Erwin Moller wrote: >> Will installing Postgres 11 also work? (Not the Ubuntu18.04 default for >> Postgres, but doable). >> Or does those pg_dump versions also expect pg_opfamily to exist? > From the bug that introduced the issue: >

Re: Can SELECT … NOWAIT “deadlock”?

2019-08-20 Thread Tom Lane
=?UTF-8?Q?Toni_C=C3=A1rdenas?= writes: > Imagine the same `SELECT ... NOWAIT` statement, which returns rows R1 and > R2, is run from concurrent connections S1 and S2. > 1. S1 obtains and locks R1. > 2. S2 obtains and locks R2. > 3. S1 tries to obtain R2, but it's locked by S2. > 4. S2 tries

Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist

2019-08-20 Thread Adrian Klaver
On 8/20/19 6:18 AM, Erwin Moller wrote: Op 8/20/2019 om 2:07 PM schreef Ian Barwick: On 8/20/19 7:12 PM, Erwin Moller wrote: Hi, While trying to move an old 8.1 Postgres install to a new server with postgres 10.10, I get an error, listed hereunder: I am trying to get a mydump_x_x_x.sql

Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist

2019-08-20 Thread Erwin Moller
Op 8/20/2019 om 2:07 PM schreef Ian Barwick: On 8/20/19 7:12 PM, Erwin Moller wrote: Hi, While trying to move an old 8.1 Postgres install to a new server with postgres 10.10, I get an error, listed hereunder: I am trying to get a mydump_x_x_x.sql file to use to reinstall on the target

Re: SELECT all the rows where id is children of other node.

2019-08-20 Thread Rob Sargent
> On Aug 19, 2019, at 7:42 PM, pabloa98 wrote: > > Hello, > > I have a huge table (100 million rows) of relations between nodes by id in a > Postgresql 11 server. Like this: > > CREATE TABLE relations ( > pid INTEGER NOT NULL, > cid INTEGER NOT NULL, > ) > > This table has

Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist

2019-08-20 Thread Ian Barwick
On 8/20/19 7:12 PM, Erwin Moller wrote: Hi, While trying to move an old 8.1 Postgres install to a new server with postgres 10.10, I get an error, listed hereunder: I am trying to get a mydump_x_x_x.sql file to use to reinstall on the target machine. From my new machine I connect to my old

Can SELECT … NOWAIT “deadlock”?

2019-08-20 Thread Toni Cárdenas
The docs say (emphasis mine): > FOR UPDATE, FOR NO KEY UPDATE, FOR SHARE and FOR KEY SHARE are locking clauses; they affect how SELECT locks rows **as they are obtained from the table**. > With NOWAIT, the statement reports an error, rather than waiting, if a selected row cannot be locked

Can SELECT … NOWAIT “deadlock”?

2019-08-20 Thread Toni Cárdenas
The docs say (emphasis mine): > FOR UPDATE, FOR NO KEY UPDATE, FOR SHARE and FOR KEY SHARE are locking clauses; they affect how SELECT locks rows **as they are obtained from the table**. > With NOWAIT, the statement reports an error, rather than waiting, if a selected row cannot be locked

pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist

2019-08-20 Thread Erwin Moller
Hi, While trying to move an old 8.1 Postgres install to a new server with postgres 10.10, I get an error, listed hereunder: I am trying to get a mydump_x_x_x.sql file to use to reinstall on the target machine. From my new machine I connect to my old machine like this: erwin@ubuntu:~$ 

Databases and servers

2019-08-20 Thread Karl Martin Skoldebrand
Hi, I just discovered that a client has done this: They have two web applications A1 and A2. They have seperate hostnames/URLs. Both have a production and a test database A1p and A1t/ A2p and A2t. What they've done is have both A1p and A2p on the same actual databaser server and A1t and

Re: Can't install postgresql from official postgresql repo on RedHat 8?

2019-08-20 Thread Devrim Gunduz
Hi, https://people.planetpostgresql.org/devrim/index.php?/archives/100-Installing-PostgreSQL-on-RHEL-8.html Regards, Devrim On 20 August 2019 00:42:06 GMT+03:00, Ubence Quevedo wrote: >Hi Everyone, > >My apologies first in case this has been posted, but I couldn't find a >thread related to my

Re: SELECT all the rows where id is children of other node.

2019-08-20 Thread Rob Sargent
> On Aug 19, 2019, at 7:42 PM, pabloa98 wrote: > > Hello, > > I have a huge table (100 million rows) of relations between nodes by id in a > Postgresql 11 server. Like this: > > CREATE TABLE relations ( > pid INTEGER NOT NULL, > cid INTEGER NOT NULL, > ) > > This table has