Re: Meaning of below statement

2020-11-20 Thread David G. Johnston
On Friday, November 20, 2020, Srinivasa T N wrote: > Hi, >I have the following in my log files: > > 2020-11-20 11:20:46.216 IST [38207] LOG: execute S_1/C_2: SELECT > "gid",encode(ST_AsBinary(ST_Simplify(ST_Force2D("shape"), > 14.929338247701526, true)),'base64') as "shape" FROM > "ami_smart_

Re: Meaning of below statement

2020-11-20 Thread Tim Clarke
On 20/11/2020 08:29, David G. Johnston wrote: On Friday, November 20, 2020, Srinivasa T N mailto:seen...@gmail.com>> wrote: Hi, I have the following in my log files: 2020-11-20 11:20:46.216 IST [38207] LOG: execute S_1/C_2: SELECT "gid",encode(ST_AsBinary(ST_Simplify(ST_Force2D("shape"), 14.

Determine if postgresql cluster running is primary or not

2020-11-20 Thread Raul Kaubi
Hi CentOS 7 Postgres 9 to 12 For monitoring purpose, I would like that certain scripts are only run in primary server. So I am looking ways to universally discover if postgresql cluster that is running is primary or not. What would be the best way to achieve this? Regards Raul

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread Thomas Kellerer
Raul Kaubi schrieb am 20.11.2020 um 09:53: > CentOS 7 > Postgres 9 to 12 > > For monitoring purpose, I would like that certain scripts are only run in > primary server. > So I am looking ways to universally discover if postgresql cluster that is > running is primary or not. As the standby will b

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread Paul Förster
Hi Thomas, > On 20. Nov, 2020, at 10:03, Thomas Kellerer wrote: > > Raul Kaubi schrieb am 20.11.2020 um 09:53: >> CentOS 7 >> Postgres 9 to 12 >> >> For monitoring purpose, I would like that certain scripts are only run in >> primary server. >> So I am looking ways to universally discover if p

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread David G. Johnston
On Friday, November 20, 2020, Paul Förster wrote: > > > > On 20. Nov, 2020, at 10:03, Thomas Kellerer wrote: > > > > > select pg_is_in_recovery(); > > I usually don't recommend using pg_is_in_recovery() only because a > database cluster can be in recovery for other reasons. This is why I always

AW: Linux package upgrade without dependency conflicts

2020-11-20 Thread Zwettler Markus (OIZ)
Any hints on this one? Thanks, Markus Von: Zwettler Markus (OIZ) Gesendet: Donnerstag, 19. November 2020 14:50 An: pgsql-general@lists.postgresql.org Betreff: Linux package upgrade without dependency conflicts We run Postgres 9.6 + 12 Community Edition on RHEL7 which we install directly out

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread Raul Kaubi
Hi Thanks. Seems like 9.5 does not work. ERROR: relation "pg_stat_wal_receiver" does not exist > LINE 20: from pg_stat_wal_receiver Any ide how to achieve this in 9.5 ? Raul Kontakt Paul Förster () kirjutas kuupäeval R, 20. november 2020 kell 11:29: > Hi Thomas, > > > On 20. Nov, 20

Re: received immediate shutdown request caused cluster failover

2020-11-20 Thread Yi Sun
Hello, Thank you for your reply Patroni replied this: "It seems your system is under so much stress that there was no resources for Patroni to execute HA loop for 35 seconds. This interval exceeds ttl=30s, therefore the leader key expired, Patroni noticed it and demoted Postgres. You need to fi

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread Paul Förster
Hi David, > On 20. Nov, 2020, at 10:34, David G. Johnston > wrote: > > > On Friday, November 20, 2020, Paul Förster wrote: > > > On 20. Nov, 2020, at 10:03, Thomas Kellerer wrote: > > > > > select pg_is_in_recovery(); > > I usually don't recommend using pg_is_in_recovery() only because

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread Paul Förster
Hi Raul, > On 20. Nov, 2020, at 10:41, Raul Kaubi wrote: > > Hi > > Thanks. > Seems like 9.5 does not work. > > ERROR: relation "pg_stat_wal_receiver" does not exist > LINE 20: from pg_stat_wal_receiver > > Any ide how to achieve this in 9.5 ? > > Raul this query is tested to work

Recovering old installation.

2020-11-20 Thread Roger Wolff
Hi, I have a little problem here... I had a hardware failure. Replaced the power supply and then the system wouldn't boot. I eventually bought a new computer, new SSD for a root/boot disk. Did a fresh install then moved over the storage drives and went on my merry way Now... it seems afte

Re: Recovering old installation.

2020-11-20 Thread Roger Wolff
Update! (progress!) It seems that: mount --bind /dev/shm /oldroot/dev/shm did the trick. I now have a running server and I can connect with the commandline tool. Now figure out the dump/restore process. Leading up to this was starting postgres in my new system and looking at the comman

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread Raul Kaubi
Hmm, ok. But how is this possible..? when b.sender>0 and c.receiver>0 then > 'Primary+Replica' Raul Kontakt Paul Förster () kirjutas kuupäeval R, 20. november 2020 kell 12:04: > Hi Raul, > > > On 20. Nov, 2020, at 10:41, Raul Kaubi wrote: > > > > Hi > > > > Thanks. > > Seems lik

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread Paul Förster
Hi Raul, > On 20. Nov, 2020, at 11:45, Raul Kaubi wrote: > > Hmm, ok. > > But how is this possible..? > > when b.sender>0 and c.receiver>0 then > 'Primary+Replica' > > Raul this happens for example if you have a primary a and replica b running as a normal cluster (we use Patron

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread Raul Kaubi
Ok, Thanks! Raul Kontakt Paul Förster () kirjutas kuupäeval R, 20. november 2020 kell 12:54: > Hi Raul, > > > On 20. Nov, 2020, at 11:45, Raul Kaubi wrote: > > > > Hmm, ok. > > > > But how is this possible..? > > > > when b.sender>0 and c.receiver>0 then > > 'Primary+Replica' > > >

Re: Set COLLATE on a session level

2020-11-20 Thread Laurenz Albe
On Fri, 2020-11-20 at 07:13 +, Dirk Mika wrote: > we come from the Oracle world and we have an application that, depending on a > setting, > sends the command ALTER SESSION SET NLS_SORT=... when connecting to the > database. > > Is there a similar way to set a COLLATE for a session in Postg

Re: Set COLLATE on a session level

2020-11-20 Thread Dirk Mika
Thank you for the quick reply. But how is this usually solved? Let's assume there is an app that accesses the same database from different countries. And in this app data should be displayed ordered. And the sort order is not identical in all countries. Does the app have to send different SQL c

Re: Set COLLATE on a session level

2020-11-20 Thread Pavel Stehule
Hi pá 20. 11. 2020 v 15:28 odesílatel Dirk Mika napsal: > Thank you for the quick reply. But how is this usually solved? > > Let's assume there is an app that accesses the same database from > different countries. And in this app data should be displayed ordered. And > the sort order is not iden

Re: Set COLLATE on a session level

2020-11-20 Thread Karsten Hilbert
On Fri, Nov 20, 2020 at 03:32:48PM +0100, Pavel Stehule wrote: > pá 20. 11. 2020 v 15:28 odesílatel Dirk Mika > napsal: > > > Let's assume there is an app that accesses the same database from > > different countries. And in this app data should be displayed ordered. And > > the sort order is not

Re: AW: Linux package upgrade without dependency conflicts

2020-11-20 Thread Adrian Klaver
On 11/20/20 1:38 AM, Zwettler Markus (OIZ) wrote: Any hints on this one? Are you sure the Postgres packages are coming from the PGDG repos and not the RH repos? What are the dependency conflicts? Thanks, Markus *Von:*Zwettler Markus (OIZ) *Gesendet:* Donnerstag, 19. November 2020 14:50

Re: Linux package upgrade without dependency conflicts

2020-11-20 Thread Magnus Hagander
On Thu, Nov 19, 2020 at 2:50 PM Zwettler Markus (OIZ) wrote: > > We run Postgres 9.6 + 12 Community Edition on RHEL7 which we install directly > out of the PGDG channels using RPMs. We also run Patroni installed with RPMs > provided by Github. > > > > Currently we have major dependency conflicts

Re: Meaning of below statement

2020-11-20 Thread Tom Lane
"David G. Johnston" writes: > On Friday, November 20, 2020, Srinivasa T N wrote: >> 2020-11-20 11:20:46.218 IST [38207] LOG: execute S_3: ROLLBACK > If there was an error you would see an error message. Plus, PostgreSQL > doesn’t just internally issue a rollback on its own. That said I’m not >

AW: AW: Linux package upgrade without dependency conflicts

2020-11-20 Thread Zwettler Markus (OIZ)
Yes. Pretty sure. PGDG repos. The last problems I remember had been related to Patroni + python-psycopg and PostGIS + pgrouting_96. Regards, Markus > -Ursprüngliche Nachricht- > Von: Adrian Klaver > Gesendet: Freitag, 20. November 2020 16:26 > An: Zwettler Markus (OIZ) ; pgsql- > gen

AW: Linux package upgrade without dependency conflicts

2020-11-20 Thread Zwettler Markus (OIZ)
> -Ursprüngliche Nachricht- > Von: Magnus Hagander > Gesendet: Freitag, 20. November 2020 16:29 > An: Zwettler Markus (OIZ) > Cc: pgsql-general@lists.postgresql.org > Betreff: Re: Linux package upgrade without dependency conflicts > > On Thu, Nov 19, 2020 at 2:50 PM Zwettler Markus (OIZ)

Re: Determine if postgresql cluster running is primary or not

2020-11-20 Thread David G. Johnston
On Friday, November 20, 2020, Paul Förster wrote: > Hi David, > > > On 20. Nov, 2020, at 10:34, David G. Johnston < > david.g.johns...@gmail.com> wrote: > > > > > > On Friday, November 20, 2020, Paul Förster > wrote: > > > > > On 20. Nov, 2020, at 10:03, Thomas Kellerer wrote: > > > > > > > >

pg_dump - how to force to show timestamps in client log

2020-11-20 Thread Durumdara
Hello! We need to log the pg_dump's state. What objects are in copy, and what are the starting and ending times. But when I try to redirect the output, the result doesn't have timestamps. PG 11, on Windows. As I see the -v option isn't enough to see the starting times. For example: 2020-11-19

Re: pg_dump - how to force to show timestamps in client log

2020-11-20 Thread Joshua Drake
Howdy, pg_dump is just issuing SQL commands, you could turn on timestamps in your postgresql log. JD On Fri, Nov 20, 2020 at 10:02 AM Durumdara wrote: > Hello! > > We need to log the pg_dump's state. > What objects are in copy, and what are the starting and ending times. > > But when I try to

Re: pg_dump - how to force to show timestamps in client log

2020-11-20 Thread Adrian Klaver
On 11/20/20 10:01 AM, Durumdara wrote: Hello! We need to log the pg_dump's state. What objects are in copy, and what are the starting and ending times. But when I try to redirect the output, the result doesn't have timestamps. PG 11, on Windows. As I see the -v option isn't enough to see the

Re: pg_dump - how to force to show timestamps in client log

2020-11-20 Thread Ron
On 11/20/20 2:56 PM, Adrian Klaver wrote: On 11/20/20 10:01 AM, Durumdara wrote: Hello! We need to log the pg_dump's state. What objects are in copy, and what are the starting and ending times. But when I try to redirect the output, the result doesn't have timestamps. PG 11, on Windows. As I

Re: pg_dump - how to force to show timestamps in client log

2020-11-20 Thread Adrian Klaver
On 11/20/20 1:00 PM, Ron wrote: On 11/20/20 2:56 PM, Adrian Klaver wrote: On 11/20/20 10:01 AM, Durumdara wrote: Hello! We need to log the pg_dump's state. What objects are in copy, and what are the starting and ending times. But when I try to redirect the output, the result doesn't have tim

Re: pg_dump - how to force to show timestamps in client log

2020-11-20 Thread Ron
On 11/20/20 3:39 PM, Adrian Klaver wrote: On 11/20/20 1:00 PM, Ron wrote: On 11/20/20 2:56 PM, Adrian Klaver wrote: On 11/20/20 10:01 AM, Durumdara wrote: Hello! We need to log the pg_dump's state. What objects are in copy, and what are the starting and ending times. But when I try to redire

Re: pg_dump - how to force to show timestamps in client log

2020-11-20 Thread Mark Johnson
This all sounds like a previous discussion on pg hackers about a progress meter for pg_dump. Search the archives for that discussion. Also, search the web for something like "pg_dump progress meter" and you'll get a few suggestions like pipe to pv, although that does not appear to work with all o

Restoring Database on Version 11 does not restore database comment

2020-11-20 Thread George Weaver
Good afternoon, If I backup a PostgreSQL 10.14 database using pg_dump from Version 11.10, and restore to Version 11, the comment for the database is lost. I haven't encountered this before when upgrading between major versions. Test case: C:\Program Files\PostgreSQL\10\bin>psql psql (10.14)

Re: Restoring Database on Version 11 does not restore database comment

2020-11-20 Thread David G. Johnston
On Fri, Nov 20, 2020 at 3:58 PM George Weaver wrote: > What am I missing? > > Release notes. https://www.postgresql.org/docs/11/release-11.html "pg_dump and pg_restore, without --create, no longer dump/restore database-level comments and security labels; those are now treated as properties of t

Re: Restoring Database on Version 11 does not restore database comment

2020-11-20 Thread Bruce Momjian
On Fri, Nov 20, 2020 at 04:01:26PM -0700, David G. Johnston wrote: > On Fri, Nov 20, 2020 at 3:58 PM George Weaver wrote: > > What am I missing? > > > > Release notes. > > https://www.postgresql.org/docs/11/release-11.html > > "pg_dump and pg_restore, without --create, no longer dump/res

Re: Restoring Database on Version 11 does not restore database comment

2020-11-20 Thread George Weaver
Thanks David! Missed that... On 20/11/2020 5:01 p.m., David G. Johnston wrote: On Fri, Nov 20, 2020 at 3:58 PM George Weaver > wrote: What am I missing? Release notes. https://www.postgresql.org/docs/11/release-11.html