Re: Deparsing rewritten query

2021-06-26 Thread Pavel Stehule
ne 27. 6. 2021 v 6:11 odesílatel Julien Rouhaud napsal: > Hi, > > I sometimes have to deal with queries referencing multiple and/or complex > views. In such cases, it's quite troublesome to figure out what is the > query > really executed. Debug_print_rewritten isn't really useful for non trivi

Deparsing rewritten query

2021-06-26 Thread Julien Rouhaud
Hi, I sometimes have to deal with queries referencing multiple and/or complex views. In such cases, it's quite troublesome to figure out what is the query really executed. Debug_print_rewritten isn't really useful for non trivial queries, and manually doing the view expansion isn't great either.

Re: [HACKERS] Preserving param location

2021-06-26 Thread Julien Rouhaud
On Sun, Jun 27, 2021 at 11:31:53AM +0800, Julien Rouhaud wrote: > On Sat, Mar 11, 2017 at 11:09:32PM +0100, Julien Rouhaud wrote: > > > > When a query contains parameters, the original param node contains the token > > location. However, this information is lost when the Const node is > > genera

Re: [HACKERS] Preserving param location

2021-06-26 Thread Julien Rouhaud
On Sat, Mar 11, 2017 at 11:09:32PM +0100, Julien Rouhaud wrote: > > When a query contains parameters, the original param node contains the token > location. However, this information is lost when the Const node is generated, > this one will only contain position -1 (unknown). > > FWIW, we do have

Re: Composite types as parameters

2021-06-26 Thread Elijah Stone
On Sat, 26 Jun 2021, Tom Lane wrote: You probably would have better results from specifying the composite type explicitly in the query: PQexecParams("insert into sometable values($1::composite, ...);", I gather from the complaint that you're currently doing something that causes the Param to

Re: [PATCH] Make jsonapi usable from libpq

2021-06-26 Thread Michael Paquier
On Sat, Jun 26, 2021 at 01:43:50PM -0400, Tom Lane wrote: > BTW, so far as the original topic of this thread is concerned, > it sounds like Jacob's ultimate goal is to put some functionality > into libpq that requires JSON parsing. I'm going to say up front > that that sounds like a terrible idea.

Re: Pipeline mode and PQpipelineSync()

2021-06-26 Thread Michael Paquier
On Sat, Jun 26, 2021 at 05:40:15PM -0400, Alvaro Herrera wrote: > It hadn't occurred to me that I should ask the release management team > about adding a new function to libpq this late in the cycle. I have not followed the thread in details, but if you think that this improves the feature in the

Re: unnesting multirange data types

2021-06-26 Thread Alexander Korotkov
On Mon, Jun 21, 2021 at 1:24 AM Alexander Korotkov wrote: > On Sun, Jun 20, 2021 at 11:09 AM Noah Misch wrote: > > On Sat, Jun 19, 2021 at 10:05:09PM -0400, Tom Lane wrote: > > > Alexander Korotkov writes: > > > > I also don't feel comfortable hurrying with unnest part to beta2. > > > > Accordin

Re: Different compression methods for FPI

2021-06-26 Thread Justin Pryzby
On Tue, Jun 22, 2021 at 12:53:46PM +0900, Michael Paquier wrote: > > So the patches that you say are unrelated still seem to me to be a > > prerequisite . > > I may be missing something, of course, but I still don't see why > that's necessary? We don't get any test failures on HEAD by switching >

Re: [PATCH] Make jsonapi usable from libpq

2021-06-26 Thread Tom Lane
I wrote: > Not real sure what to do about PGTHREAD_ERROR. I wonder if we shouldn't simply nuke that macro and change the call sites into "Assert(false)". The only call sites are in default_threadlock() (used in fe_auth.c) and pq_lockingcallback() (for OpenSSL). I suggest that 1. "fprintf(stderr

Re: Pipeline mode and PQpipelineSync()

2021-06-26 Thread Alvaro Herrera
It hadn't occurred to me that I should ask the release management team about adding a new function to libpq this late in the cycle. Please do note that the message type used in the new routine is currenly unused and uncovered -- see line 4660 here: https://coverage.postgresql.org/src/backend/tcop

Preventing abort() and exit() calls in libpq

2021-06-26 Thread Tom Lane
[ starting a new thread so as not to confuse the cfbot ] I wrote: > Michael Paquier writes: >> Good point. That's worse than just pfree() which is just a plain call >> to free() in the frontend. We could have more policies here, but my >> take is that we'd better move fe_memutils.o to OBJS_FRON

Re: [PATCH] Make jsonapi usable from libpq

2021-06-26 Thread Tom Lane
I wrote: > I spent some time looking for other undesirable symbol dependencies > in libpq, and soon found a couple. PGTHREAD_ERROR potentially calls > abort(), which seems even worse than exit-on-OOM, although I don't > think we've ever heard a report of that being hit. Also, > fe-print.c's handl

Re: Rename of triggers for partitioned tables

2021-06-26 Thread Zhihong Yu
On Sat, Jun 26, 2021 at 10:08 AM Arne Roland wrote: > *From:* Alvaro Herrera > *Sent:* Saturday, June 26, 2021 18:36 > *Subject:* Re: Rename of triggers for partitioned tables > > > I'll have a look during the commitfest which starts late next week. > > Thank you! > > > (However, I'm fairly sure

Re: [PATCH] Make jsonapi usable from libpq

2021-06-26 Thread Tom Lane
Michael Paquier writes: > On Fri, Jun 25, 2021 at 08:58:46PM +, Jacob Champion wrote: >> That surprised me. So there's currently no compiler-enforced >> prohibition, just a policy? It looks like the bar was lowered a little >> bit in commit c0cb87fbb6, as libpq currently has a symbol dependenc

Re: Rename of triggers for partitioned tables

2021-06-26 Thread Arne Roland
From: Alvaro Herrera Sent: Saturday, June 26, 2021 18:36 Subject: Re: Rename of triggers for partitioned tables > I'll have a look during the commitfest which starts late next week. Thank you! > (However, I'm fairly sure that it won't be in released versions ... > it'll only be fixed in the ver

Re: Rename of triggers for partitioned tables

2021-06-26 Thread Alvaro Herrera
On 2021-Jun-26, Arne Roland wrote: > Hello Álvaro Herrera, > > I am sorry to bother, but I am still annoyed by this. So I wonder if you had > a look. I'll have a look during the commitfest which starts late next week. (However, I'm fairly sure that it won't be in released versions ... it'll on

Re: Rename of triggers for partitioned tables

2021-06-26 Thread Arne Roland
Hello Álvaro Herrera, I am sorry to bother, but I am still annoyed by this. So I wonder if you had a look. Regards Arne From: Arne Roland Sent: Friday, April 2, 2021 7:55:16 PM To: Alvaro Herrera Cc: David Steele; Pg Hackers Subject: Re: Rename of triggers fo

Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path

2021-06-26 Thread Arne Roland
Hi Tomas, I don't think there is much work left to do here. Did you have a look at the test case? Did it make sense to you? And I am sorry. I had another look at this and it seems I was confused (again). From: Arne Roland Sent: Monday, April 26, 2021 13:00 To: Tomas Vondra; pgsql-hackers Subjec

Re: Composite types as parameters

2021-06-26 Thread Tom Lane
Elijah Stone writes: > I want to execute a query like this: > PQexecParams("insert into sometable values($1, ...);", paramValues[0] = > serialize some record, ...) > However this fails in coerce_record_to_complex(), because it receives a > node of type Param, but it can only handle RowExpr and

Re: Using each rel as both outer and inner for JOIN_ANTI

2021-06-26 Thread Richard Guo
On Thu, Jun 24, 2021 at 10:14 PM Tom Lane wrote: > Heikki Linnakangas writes: > > On 24/06/2021 12:50, Richard Guo wrote: > >> I believe if we use the smaller table 'foo' as inner side for this > >> query, we would have a cheaper plan. > > > How would that work? > > I think you could make it wor

Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors

2021-06-26 Thread Fabien COELHO
Hello Yugo-san, # About v12.2 ## Compilation Patch seems to apply cleanly with "git apply", but does not compile on my host: "undefined reference to `conditional_stack_reset'". However it works better when using the "patch". I'm wondering why git apply fails silently… When compiling ther

Re: subscription/t/010_truncate.pl failure on desmoxytes in REL_13_STABLE

2021-06-26 Thread Amit Kapila
On Fri, Jun 25, 2021 at 8:16 PM Tom Lane wrote: > > Amit Kapila writes: > > On Thu, Jun 24, 2021 at 11:25 PM Tom Lane wrote: > >> Checking the git history, this was fixed in f560209c6, which also > >> included some other mostly-cosmetic cleanup. I'm inclined to > >> propose back-patching that w

Re: Doc chapter for Hash Indexes

2021-06-26 Thread Amit Kapila
On Fri, Jun 25, 2021 at 3:11 PM Simon Riggs wrote: > > On Fri, Jun 25, 2021 at 4:17 AM Amit Kapila wrote: > > > > On Fri, Jun 25, 2021 at 1:29 AM Bruce Momjian wrote: > > > > > > aOn Wed, Jun 23, 2021 at 12:56:51PM +0100, Simon Riggs wrote: > > > > On Wed, Jun 23, 2021 at 5:12 AM Amit Kapila >

Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors

2021-06-26 Thread Fabien COELHO
Hello Yugo-san, I'm wondering whether we could use "vars" instead of "variables" as a struct field name and function parameter name, so that is is shorter and more distinct from the type name "Variables". What do you think? The struct "Variables" has a field named "vars" which is an array of

Failover messages in Timeline History

2021-06-26 Thread Michael Banck
Hi, if a failover (or probably a switchover, at least in the way Patroni does it) occurs, the timeline history (e.g. via "patronictl history"[1]) seems to read "no recovery target specified". That's correct, of course, from a PITR perspective, but for the (possibly more common?) promotion- of-a-st

Re: [PATCH] Make jsonapi usable from libpq

2021-06-26 Thread Daniel Gustafsson
> On 26 Jun 2021, at 02:36, Michael Paquier wrote: > The service file parsing is the only piece in libpq using StringInfoData. > @Tom, @Daniel, you got involved in c0cb87f. It looks like this piece about > the > limitations with service file parsing needs a rework. This code is new in 14, > wh

Re: seawasp failing, maybe in glibc allocator

2021-06-26 Thread Fabien COELHO
Seawasp should turn green on its next run. It did! -- Fabien.

Composite types as parameters

2021-06-26 Thread Elijah Stone
Hello all, I am trying to add support for composite types to my ORM, which uses libpq and the binary format. Given a schema like this one: create type composite as (...); create table sometable (field composite, ...); I want to execute a query like this: PQexecParams("insert into sometable