Re: Order of rows in statement triggers NEW/OLD tables

2022-05-31 Thread Thomas Munro
On Fri, May 6, 2022 at 6:20 PM hubert depesz lubaczewski wrote: > when defining statement triggers on update I can use: > > REFERENCING OLD TABLE AS xxx NEW TABLE as YYY > > these "pseudo" tables contain rows that were before and after. > > Is the order guaranteed? > > Can I assume that "first" ro

unoptimized nested loops

2022-05-31 Thread Tim Kelly
Hello Everyone, I am stumped as to what I am doing wrong. I have two tables metadata: parent table, 1.28m records data: child table, 1.24m records metadata contains descriptions of the records in data. data has two fields of concern, the id field, which is a foreign key to an identical field

Re: Database trigger (one server to another)

2022-05-31 Thread Adrian Klaver
On 5/31/22 11:59 AM, Muhammad Bilal Jamil wrote: Hi fellow database engineers, I am currently on a project where i have read only access to a production system (replicated) from where i want to copy data into another schema. Ideally what i want to do is that if for an event happens in the rep

Database trigger (one server to another)

2022-05-31 Thread Muhammad Bilal Jamil
Hi fellow database engineers, I am currently on a project where i have read only access to a production system (replicated) from where i want to copy data into another schema. Ideally what i want to do is that if for an event happens in the replicated schema (server#1) like something updates, then

Re: existing row not found by SELECT ... WHERE CTID = ?

2022-05-31 Thread Matthias Apitz
Analizing our logs in more detail, we got to know that there are cases where, after updating a row with something like: EXEC SQL UPDATE d01buch SET d01gsi =:d01gsi, d01ex =:d01ex, ... d01vldate =:d01vldate WHERE CURRENT O

Logically replicated table has no visible rows

2022-05-31 Thread Jeff Ross
Hello, We have a logically replicated table on RDS that is 39 G in size on both the publisher (10.21) and the subscriber (12.8). The replication slots on the publisher are all marked as active and the lsns are current so no lag. Other tables on the subscriber side are also identical in size

Re: Build Postgres On AIX

2022-05-31 Thread Tom Lane
Mark Hill writes: > I'm building Postgres 14.2 on AIX. Apparently the arc4random function is > not available in the AIX system libraries. The build > fails when it tries to build postgresql-14.2/contrib/uuid-ossp/uuid-ossp.c > because of the use of arc4random in that source > file. AFAICS ar

Build Postgres On AIX

2022-05-31 Thread Mark Hill
Hi All, First time poster so I hope this is the appropriate group in which to ask this question. Please redirect me as needed. I'm building Postgres 14.2 on AIX. Apparently the arc4random function is not available in the AIX system libraries. The build fails when it tries to build postgres

Re: The use of partial, expressional indices in pg < 14

2022-05-31 Thread Tom Lane
Danny Shemesh writes: > 2. Would it be theoretically possible to use the collected statistics if > the index where clause is also specified in the query itself ? > or in other words, if the index only contains records where x is not null, > and the query also filters on x is not null, would the pa

pgAdmin 4 v 6.9

2022-05-31 Thread Eric Katchan
Hello, I have recently update pgAdmin to v6.9. I used to be able to resize the individual columns in dashboard view. I am no longer able to adjust size. Am I missing something? Is there a new setting that I have not found. Please advise. -- Eric Katchan

The use of partial, expressional indices in pg < 14

2022-05-31 Thread Danny Shemesh
Hey everyone, There's something I've been wondering about - to my understanding, the planner won't use statistics collected on partial indices, as they may or may not reflect the correct distribution of data. When using expressional indices which are also partial, a-la an index on a nested path o

Re: Is it possible to index "deep" into a JSONB column?

2022-05-31 Thread Shaheed Haque
I forgot to say... I see the documentation on jsonpath indexing says: "GIN index extracts statements of following form out of jsonpath: accessors_chain = const. Accessors chain may consist of .key, [*], and [index] accessors. jsonb_ops additionally supports .* and .** accessors" But I'm unable t

Re: Is it possible to index "deep" into a JSONB column?

2022-05-31 Thread Shaheed Haque
OK, I was able to translate your excellent note into this: CREATE INDEX foo ON paiyroll_payrun USING gin ((snapshot -> '$.employee.*.works_id')); and query using "@>" to see it in use: SELECT ... AND (snapshot -> '$.employee.*.works_id' @> '1091')... EXPLAIN ANALYSE... -> Bit