From 38bb77a5d15aa022248488bc8c0147139ce120a9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 2 Aug 2002 18:15:10 +0000 Subject: ALTER TABLE DROP COLUMN works. Patch by Christopher Kings-Lynne, code review by Tom Lane. Remaining issues: functions that take or return tuple types are likely to break if one drops (or adds!) a column in the table defining the type. Need to think about what to do here. Along the way: some code review for recent COPY changes; mark system columns attnotnull = true where appropriate, per discussion a month ago. --- src/backend/commands/indexcmds.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/backend/commands/indexcmds.c') diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 4049e7435c5..9edebc1e690 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.79 2002/07/29 23:46:35 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.80 2002/08/02 18:15:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -294,10 +294,7 @@ FuncIndexArgs(IndexInfo *indexInfo, HeapTuple tuple; Form_pg_attribute att; - tuple = SearchSysCache(ATTNAME, - ObjectIdGetDatum(relId), - PointerGetDatum(arg), - 0, 0); + tuple = SearchSysCacheAttName(relId, arg); if (!HeapTupleIsValid(tuple)) elog(ERROR, "DefineIndex: attribute \"%s\" not found", arg); att = (Form_pg_attribute) GETSTRUCT(tuple); @@ -387,10 +384,7 @@ NormIndexAttrs(IndexInfo *indexInfo, if (attribute->name == NULL) elog(ERROR, "missing attribute for define index"); - atttuple = SearchSysCache(ATTNAME, - ObjectIdGetDatum(relId), - PointerGetDatum(attribute->name), - 0, 0); + atttuple = SearchSysCacheAttName(relId, attribute->name); if (!HeapTupleIsValid(atttuple)) elog(ERROR, "DefineIndex: attribute \"%s\" not found", attribute->name); -- cgit v1.2.3