mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Add more ALTER <object> .. SET SCHEMA commands.
This adds support for changing the schema of a conversion, operator, operator class, operator family, text search configuration, text search dictionary, text search parser, or text search template. Dimitri Fontaine, with assorted corrections and other kibitzing.
This commit is contained in:
@ -19,7 +19,9 @@
|
||||
#include "catalog/indexing.h"
|
||||
#include "catalog/pg_conversion.h"
|
||||
#include "catalog/pg_conversion_fn.h"
|
||||
#include "catalog/pg_namespace.h"
|
||||
#include "catalog/pg_type.h"
|
||||
#include "commands/alter.h"
|
||||
#include "commands/conversioncmds.h"
|
||||
#include "mb/pg_wchar.h"
|
||||
#include "miscadmin.h"
|
||||
@ -326,3 +328,29 @@ AlterConversionOwner_internal(Relation rel, Oid conversionOid, Oid newOwnerId)
|
||||
|
||||
heap_freetuple(tup);
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute ALTER CONVERSION SET SCHEMA
|
||||
*/
|
||||
void
|
||||
AlterConversionNamespace(List *name, const char *newschema)
|
||||
{
|
||||
Oid convOid, nspOid;
|
||||
Relation rel;
|
||||
|
||||
rel = heap_open(ConversionRelationId, RowExclusiveLock);
|
||||
|
||||
convOid = get_conversion_oid(name, false);
|
||||
|
||||
/* get schema OID */
|
||||
nspOid = LookupCreationNamespace(newschema);
|
||||
|
||||
AlterObjectNamespace(rel, CONVOID, ConversionRelationId, convOid, nspOid,
|
||||
Anum_pg_conversion_conname,
|
||||
Anum_pg_conversion_connamespace,
|
||||
Anum_pg_conversion_conowner,
|
||||
ACL_KIND_CONVERSION,
|
||||
false);
|
||||
|
||||
heap_close(rel, NoLock);
|
||||
}
|
||||
|
Reference in New Issue
Block a user