Skip site navigation (1) Skip section navigation (2)

Re: patch: INSERT INTO t VALUES (a, b, ..., DEFAULT, ...)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavlo Baron" <pb(at)pbit(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: patch: INSERT INTO t VALUES (a, b, ..., DEFAULT, ...)
Date: 2001-12-27 15:11:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
"Pavlo Baron" <pb(at)pbit(dot)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 break
	INSERT 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

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2001-12-27 15:26:40
Subject: Re: Problem with TOAST column corruption
Previous:From: Pavlo BaronDate: 2001-12-27 11:05:55
Subject: patch: INSERT INTO t VALUES (a, b, ..., DEFAULT, ...)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group