Re: Example 31-2. libpq Example Program 2

2021-03-10 Thread David G. Johnston
On Wednesday, March 10, 2021, Niko Ware wrote: > > > I modified the code to include the "extra" member in the following > statement: > > fprintf(stderr, > "ASYNC NOTIFY of '%s' received from backend PID %d: > %s\n", > notify->relname, notify->be_pid,

Example 31-2. libpq Example Program 2

2021-03-10 Thread Niko Ware
I need notifications to a C application on inserts to a table. The notification funcion is listed below. My program and "Example 31-2. libpq Example Program 2" receive the notification, but the payload message in "PGnotify *notify->extra" is invalid. The example code is located here:

Code of Conduct Russian Translation - Revised March 5, 2021

2021-03-10 Thread Stacey Haysler
The PostgreSQL Community Code of Conduct Committee has received a revised draft of the Russian translation of the Code of Conduct Policy updated August 18, 2020 for review.The English version of the Policy is at:https://www.postgresql.org/about/policies/coc/The updated translation incorporates

Re: How to get CASE statement to recognize null ?

2021-03-10 Thread Alban Hertroys
> On 10 Mar 2021, at 21:00, David Gauthier wrote: > > Hey, Thanks Tom ! > > It's actually a little more complicated than the simple example, so I'm not > sure it can be shoehorned into coalesce... > > CASE >WHEN sr.nightly_cl_display_suffix is null THEN cast (d.p4_changelist

Re: pgAgent for multiple databases in same instance

2021-03-10 Thread Adam Brusselback
So my experience isn't with pgagent directly, because I have been using my re-written version of it for ~5 years (but at least at one point I had a pretty darn good understanding from doing that rewrite)...please take this with a grain of salt if I am incorrect on anything. So the agent is only

Re: How to get CASE statement to recognize null ?

2021-03-10 Thread David Gauthier
Hey, Thanks Tom ! It's actually a little more complicated than the simple example, so I'm not sure it can be shoehorned into coalesce... CASE WHEN sr.nightly_cl_display_suffix is null THEN cast (d.p4_changelist as varchar) ELSE cast (d.p4_changelist as

Re: How to get CASE statement to recognize null ?

2021-03-10 Thread Tom Lane
David Gauthier writes: > dvdb=# select > CASE col1 > WHEN null THEN 'z' > ELSE col1 >END as col1, >col2 > from foo; This test is equivalent to "col1 = null" which will always fail. You could try something like CASE WHEN col1 IS NULL THEN

How to get CASE statement to recognize null ?

2021-03-10 Thread David Gauthier
This is probably an easy one for someone with experience using CASE, but intuitively I can't get it. First... 11.5 on linux. Example... dvdb=# create table foo (col1 varchar, col2 varchar); CREATE TABLE dvdb=# insert into foo (col1,col2) values ('a','x'), (null,'y'); INSERT 0 2

pgAgent for multiple databases in same instance

2021-03-10 Thread Sandeep Saxena
Hi, We are using EDB postgres 12 ,and using pgAgent to schedule db jobs , now we have two databases in the instance but job run only on one of the databases. I created a pgAgent extension on both db's , I can submit a job on both db's too , just it doesnt run on one db until i change dbname in

Re: Logical Replication, CPU load and Locking contention

2021-03-10 Thread Ron
On 3/10/21 11:56 AM, Martín Fernández wrote: On 10 Mar 2021, at 11:25, Ron > wrote: On 3/10/21 2:10 AM, Radoslav Nedyalkov wrote: On Wed, Mar 10, 2021 at 3:56 AM Martín Fernández > wrote: Hello, I’m troubleshooting a

Re: Logical Replication, CPU load and Locking contention

2021-03-10 Thread Martín Fernández
> On 10 Mar 2021, at 11:25, Ron wrote: > > On 3/10/21 2:10 AM, Radoslav Nedyalkov wrote: >> >> On Wed, Mar 10, 2021 at 3:56 AM Martín Fernández > > wrote: >> Hello, >> >> I’m troubleshooting a problem at my company with a pg 12 cluster that we run. >> >> We are

Re: WAL-files is not removing authomaticaly

2021-03-10 Thread Laurenz Albe
On Wed, 2021-03-10 at 14:34 +0200, Forum Writer wrote: > Have Streaming replica with 2 hosts, master and slave with PostgreSQL 10.6. > Replica works fine and data from master copying to slave without any problem, > but on slave have a problem: wal-files in catalog ${PGDATA}/pg_wal is not >

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-10 Thread Tom Lane
"David G. Johnston" writes: > On Tue, Mar 9, 2021 at 5:18 PM Tom Lane wrote: >> v2 attached. > Thank you. That reads much better, aside from maybe a couple of missing > commas. > - Certain function attributes such as strictness don't apply to > + Certain function attributes, such

Re: Need help with clarification on stored procedure support in PostGreSQL database

2021-03-10 Thread David G. Johnston
On Tue, Mar 9, 2021 at 5:18 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Tue, Mar 9, 2021 at 4:50 PM Tom Lane wrote: > >> Would it be better > >> to turn the para into a bulleted list, which we could introduce with > >> "The key differences are:" ? > > > Indeed, reworking the rest

WAL-files is not removing authomaticaly

2021-03-10 Thread Forum Writer
Hello, Have Streaming replica with 2 hosts, master and slave with PostgreSQL 10.6. Replica works fine and data from master copying to slave without any problem, but on slave have a problem: wal-files in catalog ${PGDATA}/pg_wal is not removing authomaticaly and may be collects over some years.

How to check for existence of nested JSONB property key?

2021-03-10 Thread Alban Hertroys
Hello all, We have a table with material properties stored as JSONB objects, as the available properties differ wildly between different kinds of materials. It's semi-structured data. I am in a situation where I want to filter our materials based on the existence of a certain property,

Re: Logical Replication, CPU load and Locking contention

2021-03-10 Thread Ron
On 3/10/21 2:10 AM, Radoslav Nedyalkov wrote: On Wed, Mar 10, 2021 at 3:56 AM Martín Fernández > wrote: Hello, I’m troubleshooting a problem at my company with a pg 12 cluster that we run. We are using Amazon DMS to replicate data from our

Re: how to limit statement memory allocation

2021-03-10 Thread Radoslav Nedyalkov
On Tue, Mar 9, 2021 at 8:13 PM Tom Lane wrote: > Radoslav Nedyalkov writes: > > On Tue, Mar 9, 2021 at 6:53 PM Tom Lane wrote: > >> The only thing I'm aware of that could consume unbounded memory > >> on the server side is hash aggregation. (v13 has improved that > >> situation, but I'm

Re: SV: Log files polluted with permission denied error messages after every 10 seconds

2021-03-10 Thread Andrus
Hi! After re-starting postgres service problem persists. Log file contains permission denied errors exactly after every 10 seconds: ... 2021-03-10 15:15:45 EET checkpointer LOG:  could not rename file "pg_wal/0001000A0030": Permission denied 2021-03-10 15:15:55 EET

Re: unexpected character used as group separator by to_char

2021-03-10 Thread Alvaro Herrera
On 2021-Mar-10, Gavan Schneider wrote: > On 10 Mar 2021, at 16:24, Alvaro Herrera wrote: > > > That space (0xe280af) is U+202F, which appears to be used for French and > > Mongolian languages (exclusively?). It is quite possible that in the > > future some other language will end up using some

Re: unexpected character used as group separator by to_char

2021-03-10 Thread Vincent Veyron
On Wed, 10 Mar 2021 02:24:57 -0300 Alvaro Herrera wrote: > > That space (0xe280af) is U+202F, which appears to be used for French and > Mongolian languages (exclusively?) On Tue, 09 Mar 2021 18:57:05 -0500 Tom Lane wrote: > In any case, you could force the issue with a pattern like

Re: unexpected character used as group separator by to_char

2021-03-10 Thread Gavan Schneider
On 10 Mar 2021, at 16:24, Alvaro Herrera wrote: That space (0xe280af) is U+202F, which appears to be used for French and Mongolian languages (exclusively?). It is quite possible that in the future some other language will end up using some different whitespace character, possibly breaking any

Re: SV: Log files polluted with permission denied error messages after every 10 seconds

2021-03-10 Thread Andrus
Today log file contains 2021-03-10 11:01:58 EET checkpointer LOG:  could not rename file "pg_wal/0001000A003B": Permission denied messages. Resource Manager shows that 0001000A003B is is locked by process 30376 According to pg_stat_activity this is regular

Re: unexpected character used as group separator by to_char

2021-03-10 Thread Laurenz Albe
On Tue, 2021-03-09 at 21:28 +0100, Vincent Veyron wrote: > I'm having a problem with to_char() inserting unexpected characters as group > separator. > > For the record below, I wish to display 'credit' properly formated in an html > form, using to_char(credit, 'FM999G990D00') > > SELECT *,

Re: Logical Replication, CPU load and Locking contention

2021-03-10 Thread Radoslav Nedyalkov
On Wed, Mar 10, 2021 at 3:56 AM Martín Fernández wrote: > Hello, > > I’m troubleshooting a problem at my company with a pg 12 cluster that we > run. > > We are using Amazon DMS to replicate data from our database into S3 > buckets. DMS replicates data by using logical replication slots. > >