Re: ANSI Compliant Inserts

From: "Rod Taylor" <rbt(at)zort(dot)ca>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: ANSI Compliant Inserts
Date: 2002-04-15 03:39:01
Message-ID: 07ad01c1e42f$15e7e780$8001a8c0@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

A team member had a bug in their SQL code which would have been caught
with this, so I looked it up. Found the TODO entry indicating it was
something that should be done. It was fairly simple to do, so I went
forward with it.

If it's not wanted, then feel free to reject the patch and remove the
TODO item -- or change the TODO item to indicate discussion is
required.
--
Rod Taylor

Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. You cannot imagine why you ever felt
otherwise.

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rod Taylor" <rbt(at)zort(dot)ca>
Cc: <pgsql-patches(at)postgresql(dot)org>
Sent: Sunday, April 14, 2002 11:09 PM
Subject: Re: [PATCHES] ANSI Compliant Inserts

> Rod Taylor <rbt(at)zort(dot)ca> writes:
> > /*
> > ! * XXX It is possible that the targetlist has fewer entries than
were
> > ! * in the columns list. We do not consider this an error.
Perhaps we
> > ! * should, if the columns list was explicitly given?
> > */
> > =20=20
> > /* done building the range table and jointree */
> > qry->rtable =3D pstate->p_rtable;
> > --- 547,558 ----
> > }
> > =20=20
> > /*
> > ! * Ensure that the targetlist has the same number of entries
> > ! * that were present in the columns list. Don't do the check
> > ! * for select statements.
> > */
> > + if (stmt->cols !=3D NIL && (icolumns !=3D NIL || attnos !=3D
NIL))
> > + elog(ERROR, "INSERT has more target columns than expressions");
>
>
> What's the rationale for changing this exactly?
>
> The code might or might not need changing (I believe the XXX comment
> questioning it is mine, in fact) but changing behavior without any
> pghackers discussion is not the way to approach this.
>
> In general I'm suspicious of rejecting cases we used to accept for
> no good reason other than that it's not in the spec. There is a LOT
> of Postgres behavior that's not in the spec.
>
> regards, tom lane
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-15 03:40:59 Re: ANSI Compliant Inserts
Previous Message Bruce Momjian 2002-04-15 03:37:20 Re: ANSI Compliant Inserts

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-04-15 03:40:59 Re: ANSI Compliant Inserts
Previous Message Bruce Momjian 2002-04-15 03:37:20 Re: ANSI Compliant Inserts