RE: Cannot terminate backend

2023-04-03 Thread Arnaud Lesauvage
> From: Paul Ramsey > Afraid so. You can wait longer, I guess. You may have found two bugs… the > lack of an interrupt in the dbscan loop, which I’m working on now. And maybe > an infinite looping case? In which case if you want a fix on that, you’ll > have to share your data and query.  I le

Re: PostgreSQL

2023-04-03 Thread Laurenz Albe
On Sun, 2023-04-02 at 23:21 +0200, Joseph Kennedy wrote: > I have one more question on this topic regarding Row Level Security. > > I would like to hide some rows for users who should have full rights to > database > eg. create Index, drop table, create tabel etc. but e.g.  create index can be >

Re: Question on creating keys on partitioned tables

2023-04-03 Thread Laurenz Albe
On Fri, 2023-03-31 at 10:35 -0700, Siddharth Jain wrote: > Is following correct? > > when a PK is created on (X,Y) on the parent table what happens internally is > that the > command is run individually on each of the child tables. nothing more. > nothing less. If you are talking about inherita

DEFINER / INVOKER conundrum

2023-04-03 Thread Dominique Devienne
My goal is to have clients connect to PostgreSQL, and call a function that return a JWT token. The JWT is supposed to capture the user (login role), and the current_role (which has meaning in our app), and sign it using a secret corresponding to a mid-tier service the client will connect to later.

Re: Very slow queries followed by checkpointer process killed with signal 9

2023-04-03 Thread Joe Conway
On 4/2/23 21:40, Tom Lane wrote: Jason McLaurin writes: Is there anywhere you'd suggest we start looking for hints? I'd be interested in increasing relevant logging verbosity so that we can see when key background processes are running, both in Postgres core and Timescale. It might be helpful

Re: DEFINER / INVOKER conundrum

2023-04-03 Thread Christoph Moench-Tegeder
## Dominique Devienne (ddevie...@gmail.com): > On the one hand, I want a INVOKER security function, > to be able to capture the login and current ROLEs. There's session_user ("the session user's name") which remains unchanged on a SECURITY DEFINER function, and current_user ("the user name of the

Re: Very slow queries followed by checkpointer process killed with signal 9

2023-04-03 Thread Christoph Moench-Tegeder
## Tom Lane (t...@sss.pgh.pa.us): > Jason McLaurin writes: > > I'm troubleshooting an issue where about once a week, a database appears to > > lock up and then the PostgreSQL process crashes and recovers. When this > > happens, a few queries will be logged, but there is no pattern to which > > qu

Re: Patroni vs pgpool II

2023-04-03 Thread Ron
On 4/3/23 01:33, Inzamam Shafiq wrote: Hi Guys, Hope you are doing well. Can someone please suggest what is one (Patroni vs PGPool II) is best for achieving HA/Auto failover, Load balancing for DB servers. Along with this, can you please share the company/client names using these tools for l

Re: DEFINER / INVOKER conundrum

2023-04-03 Thread Erik Wienhold
> On 03/04/2023 13:18 CEST Dominique Devienne wrote: > > My goal is to have clients connect to PostgreSQL, > and call a function that return a JWT token. > > The JWT is supposed to capture the user (login role), > and the current_role (which has meaning in our app), > and sign it using a secret co

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Erik Wienhold
> On 02/04/2023 17:40 CEST Adrian Klaver wrote: > > That is a long way from: > > jsonb @@ jsonpath → boolean > > Returns the result of a JSON path predicate check for the specified JSON > value. Only the first item of the result is taken into account. If the > result is not Boolean, then NULL is r

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Tom Lane
Erik Wienhold writes: > What do you mean? I responded to the OP's question. It's not a suggestion > to update the docs. Obviously it's quite a mouthful and needs to be boiled > down for the docs. Any suggestions? At least for the example at hand, I think a good part of the confusion stems fro

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Adrian Klaver
On 4/3/23 08:11, Erik Wienhold wrote: On 02/04/2023 17:40 CEST Adrian Klaver wrote: That is a long way from: jsonb @@ jsonpath → boolean Returns the result of a JSON path predicate check for the specified JSON value. Only the first item of the result is taken into account. If the result is no

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Erik Wienhold
> On 03/04/2023 17:36 CEST Adrian Klaver wrote: > > On 4/3/23 08:11, Erik Wienhold wrote: > >> On 02/04/2023 17:40 CEST Adrian Klaver wrote: > >> > >> That is a long way from: > >> > >> jsonb @@ jsonpath → boolean > >> > >> Returns the result of a JSON path predicate check for the specified JSON

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Adrian Klaver
On 4/3/23 09:21, Erik Wienhold wrote: On 03/04/2023 17:36 CEST Adrian Klaver wrote: On 4/3/23 08:11, Erik Wienhold wrote: On 02/04/2023 17:40 CEST Adrian Klaver wrote: That is a long way from: jsonb @@ jsonpath → boolean Returns the result of a JSON path predicate check for the specified J

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Erik Wienhold
> On 03/04/2023 18:37 CEST Adrian Klaver wrote: > > On 4/3/23 09:21, Erik Wienhold wrote: > >> On 03/04/2023 17:36 CEST Adrian Klaver wrote: > >> > >> On 4/3/23 08:11, Erik Wienhold wrote: > On 02/04/2023 17:40 CEST Adrian Klaver wrote: > > That is a long way from: > > j

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Adrian Klaver
On 4/3/23 12:00, Erik Wienhold wrote: On 03/04/2023 18:37 CEST Adrian Klaver wrote: On 4/3/23 09:21, Erik Wienhold wrote: On 03/04/2023 17:36 CEST Adrian Klaver wrote: On 4/3/23 08:11, Erik Wienhold wrote: On 02/04/2023 17:40 CEST Adrian Klaver wrote: That is a long way from: jsonb @@ js

Re: Oracle to PostgreSQL Migration

2023-04-03 Thread Jonny Saxon
This is a little left field… but we’ve migrated a lot of onprem oracle databases to Postgres (on aws rds) using aws database migration service - which has worked very well and supports cdc. I do wonder if you did the above and then add a 2nd cdc out from Postgres rds to your onprem Postgres. So on

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread jian he
On Tue, Apr 4, 2023 at 12:22 AM Erik Wienhold wrote: > > On 03/04/2023 17:36 CEST Adrian Klaver > wrote: > > > > On 4/3/23 08:11, Erik Wienhold wrote: > > >> On 02/04/2023 17:40 CEST Adrian Klaver > wrote: > > >> > > >> That is a long way from: > > >> > > >> jsonb @@ jsonpath → boolean > > >> >

Re: DEFINER / INVOKER conundrum

2023-04-03 Thread walther
Erik Wienhold: A single DEFINER function works if you capture current_user with a parameter and default value. Let's call it claimed_role. Use pg_has_role[0] to check that session_user has the privilege for claimed_role (in case the function is called with an explicit value), otherwise raise an