Re: ANSI Compliant Inserts
От | Tom Lane |
---|---|
Тема | Re: ANSI Compliant Inserts |
Дата | |
Msg-id | 6326.1018840149@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | ANSI Compliant Inserts (Rod Taylor <rbt@zort.ca>) |
Ответы |
Re: ANSI Compliant Inserts
|
Список | pgsql-patches |
Rod Taylor <rbt@zort.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
В списке pgsql-patches по дате отправления: