Re: [PATCHES] ANSI Compliant Inserts

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rod Taylor <rbt(at)zort(dot)ca>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] ANSI Compliant Inserts
Date: 2002-04-15 04:11:34
Message-ID: 200204150411.g3F4BYI25419@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


[ Discussion moved to hackers.]

We are discussing TODO item:

o Disallow missing columns in INSERT ... VALUES, per ANSI

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Do you want to argue we should continue allowing it?
>
> No; I'm objecting that there hasn't been adequate discussion about
> this change of behavior.

So, you don't want to allow it, I don't want to allow it, the patch
author doesn't want to allow it. The reason the item doesn't require
much discussion is that I can't imagine anyone arguing we should allow
it. If there is anyone out there that doesn't want the listed TODO item
completed, please chime in now.

> BTW, if the rationale for the change is "ANSI compliance" then the patch
> is still wrong. SQL92 says:
>
> 3) No <column name> of T shall be identified more than once. If the
> <insert column list> is omitted, then an <insert column list>
> that identifies all columns of T in the ascending sequence of
> their ordinal positions within T is implicit.
>
> 5) Let QT be the table specified by the <query expression>. The
> degree of QT shall be equal to the number of <column name>s in
> the <insert column list>.
>
> The patch enforces equality only for the case of an explicit <insert
> column list> --- which is the behavior I suggested in the original
> comment, but the spec clearly requires an exact match for an implicit
> list too. How tight do we want to get?

Yes, I think we want both implicit and explicit column names to match
the VALUES list. We do have DEFAULT for INSERT now, so that should make
things somewhat easier for people wanting to insert DEFAULT values
without specifying the column list.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-15 04:13:46 Re: [PATCHES] ANSI Compliant Inserts
Previous Message Tom Lane 2002-04-15 04:10:52 Re: [PATCHES] ANSI Compliant Inserts

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2002-04-15 04:13:40 contrib/dblink update
Previous Message Tom Lane 2002-04-15 04:10:52 Re: [PATCHES] ANSI Compliant Inserts