[PATCH v1] [BUG #19516] Skip whole-row projection shortcut for OLD/NEW returning type - Mailing list pgsql-hackers

From Marko Grujic
Subject [PATCH v1] [BUG #19516] Skip whole-row projection shortcut for OLD/NEW returning type
Date
Msg-id CAOvwyF2cO_5mAt=w=y-dFnaG5UkZ+3H8nSDoKF_iuWZHsU2ARg@mail.gmail.com
Whole thread
List pgsql-hackers
Hi, submitting a patch for bug #19516 (held in moderation queue atm).

Looks like the root cause is that the shortcut taken in ParseComplexProjection
loses the `varreturningtype` flag, causing it to default to `VAR_RETURNING_DEFAULT`.

Consequently, the default RETURNING behavior is applied, which is strictly wrong
when a user typed (old).col on INSERT/UPDATE or (new).col on DELETE.

To fix this simply skip the shortcut when varreturningtype is set to VAR_RETURNING_OLD/VAR_RETURNING_NEW.

Also added tests that exercise this.

Thanks,
Marko
Attachment

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: Row pattern recognition
Next
From: Ashutosh Bapat
Date:
Subject: Re: GetBufferDescriptor() being called for local buffers from MarkBufferDirtyHint()