aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/sequence.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2012-12-23 18:25:03 -0500
committerRobert Haas <rhaas@postgresql.org>2012-12-23 18:37:58 -0500
commitc504513f83a9ee8dce4a719746ca73102cae9f13 (patch)
tree3664999ca3242003181bef1fa171e28fe557ecb9 /src/backend/commands/sequence.c
parent31bc839724439440b2e94ea616b28ce5be94e19c (diff)
downloadpostgresql-c504513f83a9ee8dce4a719746ca73102cae9f13.tar.gz
postgresql-c504513f83a9ee8dce4a719746ca73102cae9f13.zip
Adjust many backend functions to return OID rather than void.
Extracted from a larger patch by Dimitri Fontaine. It is hoped that this will provide infrastructure for enriching the new event trigger functionality, but it seems possibly useful for other purposes as well.
Diffstat (limited to 'src/backend/commands/sequence.c')
-rw-r--r--src/backend/commands/sequence.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index 5583e721ead..585b5b2bed6 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -103,7 +103,7 @@ static void process_owned_by(Relation seqrel, List *owned_by);
* DefineSequence
* Creates a new sequence relation
*/
-void
+Oid
DefineSequence(CreateSeqStmt *seq)
{
FormData_pg_sequence new;
@@ -228,6 +228,8 @@ DefineSequence(CreateSeqStmt *seq)
process_owned_by(rel, owned_by);
heap_close(rel, NoLock);
+
+ return seqoid;
}
/*
@@ -400,7 +402,7 @@ fill_seq_with_data(Relation rel, HeapTuple tuple)
*
* Modify the definition of a sequence relation
*/
-void
+Oid
AlterSequence(AlterSeqStmt *stmt)
{
Oid relid;
@@ -419,7 +421,7 @@ AlterSequence(AlterSeqStmt *stmt)
ereport(NOTICE,
(errmsg("relation \"%s\" does not exist, skipping",
stmt->sequence->relname)));
- return;
+ return InvalidOid;
}
init_sequence(relid, &elm, &seqrel);
@@ -483,6 +485,8 @@ AlterSequence(AlterSeqStmt *stmt)
process_owned_by(seqrel, owned_by);
relation_close(seqrel, NoLock);
+
+ return relid;
}