Re: posgres 12 bug (partitioned table)

2020-07-10 Thread Amit Langote
Reading my own words, I think I must fix an ambiguity: On Fri, Jul 10, 2020 at 3:23 PM Amit Langote wrote: > So even if an AM's table_tuple_insert() itself doesn't populate the > transaction info into the slot handed to it, maybe as an optimization, > it does not sound entirely unreasonable to ex

Re: posgres 12 bug (partitioned table)

2020-07-09 Thread Amit Langote
Hi Soumyadeep, On Fri, Jul 10, 2020 at 2:56 AM Soumyadeep Chakraborty wrote: > > Hey Amit, > > On Thu, Jul 9, 2020 at 12:16 AM Amit Langote wrote: > > > By the way, what happens today if you do INSERT INTO a_zedstore_table > > ... RETURNING xmin? Do you get an error "xmin is unrecognized" or >

Re: posgres 12 bug (partitioned table)

2020-07-09 Thread Soumyadeep Chakraborty
Hey Amit, On Thu, Jul 9, 2020 at 12:16 AM Amit Langote wrote: > By the way, what happens today if you do INSERT INTO a_zedstore_table > ... RETURNING xmin? Do you get an error "xmin is unrecognized" or > some such in slot_getsysattr() when trying to project the RETURNING > list? > We get garba

Re: posgres 12 bug (partitioned table)

2020-07-09 Thread Amit Langote
On Thu, Jul 9, 2020 at 1:53 AM Soumyadeep Chakraborty wrote: > On Tue, Jul 7, 2020 at 7:17 PM Amit Langote wrote: > > Ah, I see. You might've noticed that ExecInsert() only ever sees leaf > > partitions, because tuple routing would've switched the result > > relation to a leaf partition by the t

Re: posgres 12 bug (partitioned table)

2020-07-08 Thread Soumyadeep Chakraborty
Hey Amit, On Tue, Jul 7, 2020 at 7:17 PM Amit Langote wrote: > Ah, I see. You might've noticed that ExecInsert() only ever sees leaf > partitions, because tuple routing would've switched the result > relation to a leaf partition by the time we are in ExecInsert(). So, > table_tuple_insert() alw

Re: posgres 12 bug (partitioned table)

2020-07-07 Thread Amit Langote
Hi Soumyadeep, On Wed, Jul 8, 2020 at 9:37 AM Soumyadeep Chakraborty wrote: > On Tue, Jul 7, 2020 at 7:18 AM Amit Langote wrote: > > If I change this to return a "heap" slot for partitioned tables, just > > like for foreign tables, the problem goes away (see the attached). In > > fact, even mak

Re: posgres 12 bug (partitioned table)

2020-07-07 Thread Soumyadeep Chakraborty
Hi Amit, Thanks for your reply! On Tue, Jul 7, 2020 at 7:18 AM Amit Langote wrote: > > Hi Soumyadeep, > > Thanks for picking this up. > > On Tue, Jul 7, 2020 at 7:46 AM Soumyadeep Chakraborty > wrote: > > Upon investigation, it seems that the problem is caused by the > > following: > > > > The

Re: posgres 12 bug (partitioned table)

2020-07-07 Thread Amit Langote
Hi Soumyadeep, Thanks for picking this up. On Tue, Jul 7, 2020 at 7:46 AM Soumyadeep Chakraborty wrote: > Upon investigation, it seems that the problem is caused by the > following: > > The slot passed to the call to ExecProcessReturning() inside > ExecInsert() is often a virtual tuple table slo

Re: posgres 12 bug (partitioned table)

2020-07-06 Thread Soumyadeep Chakraborty
Hello, ccing pgsql-hack...@postgresql.org Upon investigation, it seems that the problem is caused by the following: The slot passed to the call to ExecProcessReturning() inside ExecInsert() is often a virtual tuple table slot. If there are system columns other than ctid and tableOid referenced i