Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-09 Thread Andres Freund
Hi, On 2019-02-06 03:39:19 -0800, Andres Freund wrote: > On 2019-02-06 10:25:56 +, Andrew Gierth wrote: > > > "Andres" == Andres Freund writes: > > > > >> Cool. Here's the patch that I, after some commit message polishing, > > >> plan to commit to 11 and master to fix the issue at hand.

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-09 Thread Andres Freund
Hi, On 2019-02-05 22:44:38 -0300, Alvaro Herrera wrote: > On 2019-Feb-05, Andres Freund wrote: > > > @@ -82,7 +80,7 @@ static Datum getmissingattr(TupleDesc tupleDesc, int > > attnum, bool *isnull); > > /* > > * Return the missing value of an attribute, or NULL if there isn't one. > > */ >

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-06 Thread Alvaro Herrera
On 2019-Feb-05, Andres Freund wrote: > @@ -82,7 +80,7 @@ static Datum getmissingattr(TupleDesc tupleDesc, int > attnum, bool *isnull); > /* > * Return the missing value of an attribute, or NULL if there isn't one. > */ > -static Datum > +Datum > getmissingattr(TupleDesc tupleDesc, >

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-06 Thread Christoph Berg
> > Sorry I didn't spot this earlier, but... in the backpatch to v11, is the > > expansion of the trigger tuple really unnecessary now? Since > > heap_getattr is a macro, C-language triggers that aren't recompiled > > won't see the default? So perhaps the expansion should be left in? > >My

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-06 Thread Andres Freund
Hi, On 2019-02-06 10:25:56 +, Andrew Gierth wrote: > > "Andres" == Andres Freund writes: > > >> Cool. Here's the patch that I, after some commit message polishing, > >> plan to commit to 11 and master to fix the issue at hand. > > Andres> And pushed. > > Sorry I didn't spot this earlie

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-06 Thread Andrew Gierth
> "Andres" == Andres Freund writes: >> Cool. Here's the patch that I, after some commit message polishing, >> plan to commit to 11 and master to fix the issue at hand. Andres> And pushed. Sorry I didn't spot this earlier, but... in the backpatch to v11, is the expansion of the trigger tu

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-06 Thread Andres Freund
On 2019-02-05 08:57:05 -0800, Andres Freund wrote: > Hi, > > On 2019-02-05 10:14:48 -0500, Andrew Dunstan wrote: > > > > On 2/1/19 5:49 PM, Andres Freund wrote: > > > Hi, > > > > > > On 2019-02-01 08:24:04 -0800, Andres Freund wrote: > > > > > > Andrew, I think it'd be good to do a ground up revi

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-05 Thread Andres Freund
Hi, On 2019-02-05 10:14:48 -0500, Andrew Dunstan wrote: > > On 2/1/19 5:49 PM, Andres Freund wrote: > > Hi, > > > > On 2019-02-01 08:24:04 -0800, Andres Freund wrote: > > > > Andrew, I think it'd be good to do a ground up review of the fast > > defaults patch. There's been a fair number of issues

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-05 Thread Andrew Dunstan
On 2/1/19 5:49 PM, Andres Freund wrote: > Hi, > > On 2019-02-01 08:24:04 -0800, Andres Freund wrote: > > Andrew, I think it'd be good to do a ground up review of the fast > defaults patch. There's been a fair number of issues in it, and this is > a another pretty fundamental issue. > OK. Will t

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-02 Thread Andres Freund
Hi, On 2019-02-02 05:35:21 -0800, Andres Freund wrote: > This breaks HOT (and probably also foreign keys), when fast default > columns are set to NULL, because HeapDetermineModifiedColumns() gets the > values with heap_getattr(), which returns a spurious NULL for the old > value (instead of the fa

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-02 Thread Andres Freund
Hi, On 2019-02-01 08:24:04 -0800, Andres Freund wrote: > While working on the patch to slotify trigger.c I got somewhat confused > by the need to expand tuples in trigger.c: > > static HeapTuple > GetTupleForTrigger(EState *estate, >EPQState *epqstate, >Res

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-02 Thread Andres Freund
Him On 2019-02-01 14:49:05 -0800, Andres Freund wrote: > +#ifdef IAM_THE_WRONG_FIX > if (HeapTupleHeaderGetNatts(tuple.t_data) < relation->rd_att->natts) > result = heap_expand_tuple(&tuple, relation->rd_att); > else > result = heap_copytuple(&tuple); > +#el

Re: fast defaults in heap_getattr vs heap_deform_tuple

2019-02-01 Thread Andres Freund
Hi, On 2019-02-01 08:24:04 -0800, Andres Freund wrote: > While working on the patch to slotify trigger.c I got somewhat confused > by the need to expand tuples in trigger.c: > > static HeapTuple > GetTupleForTrigger(EState *estate, >EPQState *epqstate, >Res

fast defaults in heap_getattr vs heap_deform_tuple

2019-02-01 Thread Andres Freund
Hi, While working on the patch to slotify trigger.c I got somewhat confused by the need to expand tuples in trigger.c: static HeapTuple GetTupleForTrigger(EState *estate, EPQState *epqstate, ResultRelInfo *relinfo, ItemPointer tid,