mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
Identity columns
This is the SQL standard-conforming variant of PostgreSQL's serial columns. It fixes a few usability issues that serial columns have: - CREATE TABLE / LIKE copies default but refers to same sequence - cannot add/drop serialness with ALTER TABLE - dropping default does not drop sequence - need to grant separate privileges to sequence - other slight weirdnesses because serial is some kind of special macro Reviewed-by: Vitaly Burovoy <vitaly.burovoy@gmail.com>
This commit is contained in:
@ -1993,6 +1993,18 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state,
|
||||
break;
|
||||
}
|
||||
|
||||
case T_NextValueExpr:
|
||||
{
|
||||
NextValueExpr *nve = (NextValueExpr *) node;
|
||||
|
||||
scratch.opcode = EEOP_NEXTVALUEEXPR;
|
||||
scratch.d.nextvalueexpr.seqid = nve->seqid;
|
||||
scratch.d.nextvalueexpr.seqtypid = nve->typeId;
|
||||
|
||||
ExprEvalPushStep(state, &scratch);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
elog(ERROR, "unrecognized node type: %d",
|
||||
(int) nodeTag(node));
|
||||
|
Reference in New Issue
Block a user