Skip to content

Commit 99f61da

Browse files
committed
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.
1 parent fd31563 commit 99f61da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/parser/parse_target.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.34 1999/02/03 21:16:59 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.35 1999/04/29 03:01:50 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -216,6 +216,8 @@ MakeTargetEntryExpr(ParseState *pstate,
216216
rd = pstate->p_target_relation;
217217
Assert(rd != NULL);
218218
resdomno = attnameAttNum(rd, colname);
219+
if (resdomno <= 0)
220+
elog(ERROR, "Cannot assign to system attribute '%s'", colname);
219221
attrisset = attnameIsSet(rd, colname);
220222
attrtype = attnumTypeId(rd, resdomno);
221223
if ((arrayRef != NIL) && (lfirst(arrayRef) == NIL))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy