
> A compromise position would be to allow dropping trailing columns only
> when the column name list is omitted.
> 
> Comments?

Sounds reasonable to me.

Andreas

Mon, 29 Jan 2001 18:04:25 +0100
Zeugswetter Andreas SB  <ZeugswetterA@wien.spardat.at>
AW: Shouldn't this be an error? 
Zeugswetter Andreas SB  <ZeugswetterA@wien.spardat.at> writes:
>> A compromise position would be to allow dropping trailing columns only
>> when the column name list is omitted.

> Sounds reasonable to me.

IIRC, there's some interaction between this behavior and the way that
INSERT ... DEFAULT VALUES is implemented; I think DEFAULT VALUES is
parsed as an empty values list and then the trailing-column-omission
code is what actually makes the right things happen.  So changing it
without breaking DEFAULT VALUES is not entirely trivial; it'll take
some changes in the raw-parsetree representation.  There are other
missing SQL features hereabouts also, such as being able to write
a DEFAULTed column explicitly:
	INSERT ... VALUES('foo', DEFAULT, 42);
and being able to insert multiple explicit rows:
	INSERT ... VALUES('foo', DEFAULT, 42), VALUES('bar', 99, 44);
I think we should deal with all of these issues at once, which means
it's not something to try to fix for 7.1.  Bruce, would you add a
TODO item?

  * Bring INSERT ... VALUES up to full SQL92 spec.

			regards, tom lane

Mon, 29 Jan 2001 12:30:45 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: AW: Shouldn't this be an error? 
> missing SQL features hereabouts also, such as being able to write
> a DEFAULTed column explicitly:
> 	INSERT ... VALUES('foo', DEFAULT, 42);
> and being able to insert multiple explicit rows:
> 	INSERT ... VALUES('foo', DEFAULT, 42), VALUES('bar', 99, 44);
> I think we should deal with all of these issues at once, which means
> it's not something to try to fix for 7.1.  Bruce, would you add a
> TODO item?
> 
>   * Bring INSERT ... VALUES up to full SQL92 spec.

Added to TODO:

  * Bring INSERT ... VALUES up to full SQL92 spec, disallow missing columns

-- 
  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, Pennsylvania 19026

Mon, 29 Jan 2001 12:44:37 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: AW: Shouldn't this be an error?
> a DEFAULTed column explicitly:
> 	INSERT ... VALUES('foo', DEFAULT, 42);
> and being able to insert multiple explicit rows:
> 	INSERT ... VALUES('foo', DEFAULT, 42), VALUES('bar', 99, 44);
> I think we should deal with all of these issues at once, which means
> it's not something to try to fix for 7.1.  Bruce, would you add a
> TODO item?
> 
>   * Bring INSERT ... VALUES up to full SQL92 spec.

Oops, I have now added:

* Bring INSERT ... VALUES up to full SQL92 spec, disallow missing
  columns, allow DEFAULT

-- 
  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, Pennsylvania 19026

Mon, 29 Jan 2001 12:45:24 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: AW: Shouldn't this be an error?