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

2023-03-31 Thread jian he
Hi, https://www.postgresql.org/docs/current/functions-json.html > 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 returned. > > '{

Re: My tests show that a WITH HOLD cursor has subtly different semantics from a WITHOUT HOLD cursor

2023-03-31 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> *Summary* >> >> My tests show that, when a WITHOUT HOLD cursor has to cache results (see >> Note 1), then the WHERE clause (if present) is stripped off the cursor's >> defining SELECT statement and the entire unrestricted

Re: My tests show that a WITH HOLD cursor has subtly different semantics from a WITHOUT HOLD cursor

2023-03-31 Thread David G. Johnston
On Fri, Mar 31, 2023 at 12:35 PM Bryn Llewellyn wrote: > **Summary** > > My tests show that, when a WITHOUT HOLD cursor has to cache results (see > Note 1), then the WHERE clause (if present) is stripped off the cursor's > defining SELECT statement and the entire unrestricted result set is cached

My tests show that a WITH HOLD cursor has subtly different semantics from a WITHOUT HOLD cursor

2023-03-31 Thread Bryn Llewellyn
*Summary* My tests show that, when a WITHOUT HOLD cursor has to cache results (see Note 1), then the WHERE clause (if present) is stripped off the cursor's defining SELECT statement and the entire unrestricted result set is cached. But when a WITH HOLD cursor is used, then it’s the *restricted*

Re: Question on creating keys on partitioned tables

2023-03-31 Thread Siddharth Jain
On Fri, Mar 31, 2023 at 9:07 AM Tom Lane wrote: > Siddharth Jain writes: > > I think the two are equivalent. If not, could you please explain why? > > Well, they're formally equivalent if you require there to be only one > X value per partition (ie, PARTITION BY LIST with only one listed value >

Re: Question on creating keys on partitioned tables

2023-03-31 Thread Tom Lane
Siddharth Jain writes: > I think the two are equivalent. If not, could you please explain why? Well, they're formally equivalent if you require there to be only one X value per partition (ie, PARTITION BY LIST with only one listed value per partition); if there's more, they're not the same thing.

Re: Cannot terminate backend

2023-03-31 Thread 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. P. > On Mar 31, 2023, at 7:41 AM,

Re: Question on creating keys on partitioned tables

2023-03-31 Thread Siddharth Jain
Thanks Laurenz. I think the two are equivalent. If not, could you please explain why? On Fri, Mar 31, 2023 at 6:46 AM Laurenz Albe wrote: > On Thu, 2023-03-30 at 17:05 -0700, Siddharth Jain wrote: > > I have this question. Say I create a partitioned table on column X. > > > > Option 1: > > > >

RE: Cannot terminate backend

2023-03-31 Thread Arnaud Lesauvage
> On Fri, 2023-03-31 at 13:46 +, Arnaud Lesauvage wrote: > > I have a long running query that I seem unable to either cancel or > terminate. > > What could be the reason for this, and what is the bet way to terminate > this kind of query ? > > > > The query is a CTE using postgis ST_ClusterDBSC

Re: Cannot terminate backend

2023-03-31 Thread Laurenz Albe
On Fri, 2023-03-31 at 13:46 +, Arnaud Lesauvage wrote: > I have a long running query that I seem unable to either cancel or terminate. > What could be the reason for this, and what is the bet way to terminate this > kind of query ? >   > The query is a CTE using postgis ST_ClusterDBSCAN functi

Re: Question on creating keys on partitioned tables

2023-03-31 Thread Laurenz Albe
On Thu, 2023-03-30 at 17:05 -0700, Siddharth Jain wrote: > I have this question. Say I create a partitioned table on column X. > > Option 1: > > I add a primary key on (X,Y). Y is another column. Even though Y is a > globally unique PK (global meaning it is unique across partitions, not just >

Cannot terminate backend

2023-03-31 Thread Arnaud Lesauvage
Hi all, I have a long running query that I seem unable to either cancel or terminate. What could be the reason for this, and what is the bet way to terminate this kind of query ? The query is a CTE using postgis ST_ClusterDBSCAN function. The CTE returns approximately 150k rows. The SQL is as f

Re: libpq: COPY FROM STDIN BINARY of arrays

2023-03-31 Thread Dominique Devienne
On Thu, Mar 30, 2023 at 6:00 PM Tom Lane wrote: > Dominique Devienne writes: > > Does the wire-format of arrays differ between binary-binds and > binary-copy? > > No. > An update on this, I think I figure it out, by comparing with COPY TO STDOUT WITH (FORMAT BINARY). I was missing the byte-coun