Re: Shouldn't this be an error?

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: Vince Vielhaber <vev(at)michvhf(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Shouldn't this be an error?
Date: 2001-01-29 16:58:15
Message-ID: 200101291658.LAA17063@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Vince Vielhaber <vev(at)michvhf(dot)com> writes:
> > Shouldn't this insert fail? This is 7.0.3.
>
> > template1=# create table foo(x int,y varchar(10),z datetime);
> > CREATE
> > template1=# insert into foo(x,y,z) values(1,'asdf');
> > INSERT 19222 1
>
> We've always allowed trailing columns to be omitted, whether a column
> name list is specified or not. This is not per spec --- SQL92 and SQL99
> both say that all the columns must be provided --- but I'm rather
> hesitant to enforce the spec's stricter rule at this point. Seems like
> it'd probably break some existing apps.
>
> A compromise position would be to allow dropping trailing columns only
> when the column name list is omitted.

Yikes, we allow the column to be missing even if they specify it in
INSERT. That seems very wrong.

--
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 Zeugswetter Andreas SB 2001-01-29 17:04:25 AW: Shouldn't this be an error?
Previous Message KuroiNeko 2001-01-29 16:55:14 Re: Security hole in PL/pgSQL