diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-02-08 16:08:41 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-02-08 16:13:22 -0500 |
commit | d9572c4e3b474031060189050e14ef384b94e001 (patch) | |
tree | 07646762f4086b94a69b9fc215734d2bccade5db /src/backend/commands/operatorcmds.c | |
parent | 414c5a2ea65cbd38d79ffdf9b1fde7cc75c134e0 (diff) | |
download | postgresql-d9572c4e3b474031060189050e14ef384b94e001.tar.gz postgresql-d9572c4e3b474031060189050e14ef384b94e001.zip |
Core support for "extensions", which are packages of SQL objects.
This patch adds the server infrastructure to support extensions.
There is still one significant loose end, namely how to make it play nice
with pg_upgrade, so I am not yet committing the changes that would make
all the contrib modules depend on this feature.
In passing, fix a disturbingly large amount of breakage in
AlterObjectNamespace() and callers.
Dimitri Fontaine, reviewed by Anssi Kääriäinen,
Itagaki Takahiro, Tom Lane, and numerous others
Diffstat (limited to 'src/backend/commands/operatorcmds.c')
-rw-r--r-- | src/backend/commands/operatorcmds.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c index 35bb76162d2..b4374a62f4f 100644 --- a/src/backend/commands/operatorcmds.c +++ b/src/backend/commands/operatorcmds.c @@ -477,12 +477,32 @@ AlterOperatorNamespace(List *names, List *argtypes, const char *newschema) /* get schema OID */ nspOid = LookupCreationNamespace(newschema); - AlterObjectNamespace(rel, OPEROID, OperatorRelationId, operOid, nspOid, + AlterObjectNamespace(rel, OPEROID, -1, + operOid, nspOid, Anum_pg_operator_oprname, Anum_pg_operator_oprnamespace, Anum_pg_operator_oprowner, - ACL_KIND_OPER, - false); + ACL_KIND_OPER); - heap_close(rel, NoLock); + heap_close(rel, RowExclusiveLock); +} + +Oid +AlterOperatorNamespace_oid(Oid operOid, Oid newNspOid) +{ + Oid oldNspOid; + Relation rel; + + rel = heap_open(OperatorRelationId, RowExclusiveLock); + + oldNspOid = AlterObjectNamespace(rel, OPEROID, -1, + operOid, newNspOid, + Anum_pg_operator_oprname, + Anum_pg_operator_oprnamespace, + Anum_pg_operator_oprowner, + ACL_KIND_OPER); + + heap_close(rel, RowExclusiveLock); + + return oldNspOid; } |