Skip to content

Commit 41aeed4

Browse files
committed
Can't INSERT/UPDATE/DELETE sequence relation.
1 parent 9729f6c commit 41aeed4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/executor/execMain.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.11 1997/03/12 20:47:41 scrappy Exp $
29+
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.12 1997/04/02 04:04:11 vadim Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -419,6 +419,10 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
419419
resultRelationOid = rtentry->relid;
420420
resultRelationDesc = heap_open(resultRelationOid);
421421

422+
if ( resultRelationDesc->rd_rel->relkind == RELKIND_SEQUENCE )
423+
elog (WARN, "You can't change sequence relation %s",
424+
resultRelationDesc->rd_rel->relname.data);
425+
422426
/* Write-lock the result relation right away: if the relation
423427
is used in a subsequent scan, we won't have to elevate the
424428
read-lock set by heap_beginscan to a write-lock (needed by

0 commit comments

Comments
 (0)