1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

Make the world at least somewhat safe for zero-column tables, and

remove the special case in ALTER DROP COLUMN to prohibit dropping a
table's last column.
This commit is contained in:
Tom Lane
2002-09-28 20:00:19 +00:00
parent 23616b47d5
commit 6d0d15c451
6 changed files with 64 additions and 81 deletions

View File

@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.59 2002/09/04 20:31:17 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.60 2002/09/28 20:00:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -560,23 +560,14 @@ ExecInitNullTupleSlot(EState *estate, TupleDesc tupType)
TupleDesc
ExecTypeFromTL(List *targetList, bool hasoid)
{
List *tlitem;
TupleDesc typeInfo;
Resdom *resdom;
Oid restype;
List *tlitem;
int len;
/*
* examine targetlist - if empty then return NULL
*/
len = ExecTargetListLength(targetList);
if (len == 0)
return NULL;
/*
* allocate a new typeInfo
*/
len = ExecTargetListLength(targetList);
typeInfo = CreateTemplateTupleDesc(len, hasoid);
/*
@ -585,6 +576,8 @@ ExecTypeFromTL(List *targetList, bool hasoid)
foreach(tlitem, targetList)
{
TargetEntry *tle = lfirst(tlitem);
Resdom *resdom;
Oid restype;
if (tle->resdom != NULL)
{