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

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

From: "Pavlo Baron" <pb(at)pbit(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: INSERT INTO t VALUES (a, b, ..., DEFAULT, ...)
Date: 2001-12-27 20:37:40
Message-ID: 00dd01c18f16$5456c630$6500a8c0@bw1 (view raw or flat)
Thread:
Lists: pgsql-hackers
here is a new patch containing all changes you (Tom) suggested to make. I
still use my "pavlo (pbpbit.org)" for me to locate my code; feel free to
illiminate them before integrating :-)

Tom Lane:
> 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.

Now there is a newly declared parse node type "Default" - the corresponding
structure has no data. The "@default" hack is now illiminated - I'm the
happiest about it

Tom Lane:
>
> 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.

The grammer now contains two new rules: "insert_target_list" and
"insert_target_el", the SELECT and INSERT don't use the same targetlist
anymore, but the "insert_target_el" completely inherits "target_el" to avoid
multiple declarations and  it just provides the new DEFAULT-rule.

I hope, this patch is ok - to me, it looks correct now

rgds
Pavlo Baron


Attachment: patch.diff
Description: application/octet-stream (6.2 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Pavlo BaronDate: 2001-12-27 20:58:06
Subject: TODO question
Previous:From: Scott RoystonDate: 2001-12-27 20:37:14
Subject: Implicit cast of literal in SQL statements

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