Re: [PATCHES] ANSI Compliant Inserts - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [PATCHES] ANSI Compliant Inserts
Date
Msg-id 200204150411.g3F4BYI25419@candle.pha.pa.us
Whole thread Raw
List pgsql-hackers
[ Discussion moved to hackers.]

We are discussing TODO item:
       o Disallow missing columns in INSERT ... VALUES, per ANSI

Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: "Rod Taylor"
Date:
Subject: Re: [PATCHES] ANSI Compliant Inserts
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] ANSI Compliant Inserts