Re: patch: INSERT INTO t VALUES (a, b, ..., DEFAULT, ...) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: patch: INSERT INTO t VALUES (a, b, ..., DEFAULT, ...)
Date
Msg-id 24440.1009465881@sss.pgh.pa.us
Whole thread Raw
In response to patch: INSERT INTO t VALUES (a, b, ..., DEFAULT, ...)  ("Pavlo Baron" <pb@pbit.org>)
List pgsql-hackers
"Pavlo Baron" <pb@pbit.org> writes:
> 3. gram.y - here I added a rule for the DEFAULT-element in the target_list
> used for the INSERT-statement. It now replaces DEFAULT by an anti-thing like
> "@default" because I couldn't find out were it fails if I leave DEFAULT
> unchainged. If smb. knows a way to do it I'll drop this @default

This would breakINSERT INTO foo(textcolumn) VALUES ('@default')
which I find hardly acceptable.

The only way to do it without breaking valid data entries is to
introduce a new parse node type to represent a DEFAULT placeholder.

I also wonder what's going to happen if I write DEFAULT in a SELECT's
targetlist, which is possible given where you made the grammar change.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Pavlo Baron"
Date:
Subject: patch: INSERT INTO t VALUES (a, b, ..., DEFAULT, ...)
Next
From: Tom Lane
Date:
Subject: Re: Problem with TOAST column corruption