aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_target.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-04-29 03:01:50 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-04-29 03:01:50 +0000
commit99f61dac7e7912a231125de0914c228e4cdc4986 (patch)
tree6a17b9de875b10f0a6915e8ff2229e8dc416d1a9 /src/backend/parser/parse_target.c
parentfd31563777e98882a0869223f67ff33cb61b7108 (diff)
downloadpostgresql-99f61dac7e7912a231125de0914c228e4cdc4986.tar.gz
postgresql-99f61dac7e7912a231125de0914c228e4cdc4986.zip
Defend against 'update oid'. Someday we might want to support
that, but it'd be a New Feature, wouldn't it ... in the meantime, avoiding a backend crash seems worthwhile.
Diffstat (limited to 'src/backend/parser/parse_target.c')
-rw-r--r--src/backend/parser/parse_target.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index b2a2af64ad8..b2376054fca 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.34 1999/02/03 21:16:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.35 1999/04/29 03:01:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -216,6 +216,8 @@ MakeTargetEntryExpr(ParseState *pstate,
rd = pstate->p_target_relation;
Assert(rd != NULL);
resdomno = attnameAttNum(rd, colname);
+ if (resdomno <= 0)
+ elog(ERROR, "Cannot assign to system attribute '%s'", colname);
attrisset = attnameIsSet(rd, colname);
attrtype = attnumTypeId(rd, resdomno);
if ((arrayRef != NIL) && (lfirst(arrayRef) == NIL))