59 bool nulls[Natts_pg_collation];
87 else if (if_not_exists)
92 ?
errmsg(
"collation \"%s\" already exists, skipping",
94 :
errmsg(
"collation \"%s\" for encoding \"%s\" already exists, skipping",
102 ?
errmsg(
"collation \"%s\" already exists",
104 :
errmsg(
"collation \"%s\" for encoding \"%s\" already exists",
118 if ((collencoding == -1 &&
123 (collencoding != -1 &&
134 else if (if_not_exists)
139 errmsg(
"collation \"%s\" already exists, skipping",
146 errmsg(
"collation \"%s\" already exists",
153 memset(nulls, 0,
sizeof(nulls));
157 Anum_pg_collation_oid);
159 values[Anum_pg_collation_collname - 1] =
NameGetDatum(&name_name);
160 values[Anum_pg_collation_collnamespace - 1] =
ObjectIdGetDatum(collnamespace);
162 values[Anum_pg_collation_collprovider - 1] =
CharGetDatum(collprovider);
163 values[Anum_pg_collation_collisdeterministic - 1] =
BoolGetDatum(collisdeterministic);
164 values[Anum_pg_collation_collencoding - 1] =
Int32GetDatum(collencoding);
166 values[Anum_pg_collation_collcollate - 1] =
NameGetDatum(&name_collate);
168 values[Anum_pg_collation_collctype - 1] =
NameGetDatum(&name_ctype);
177 myself.
classId = CollationRelationId;
182 referenced.
classId = NamespaceRelationId;
183 referenced.
objectId = collnamespace;
Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
void table_close(Relation relation, LOCKMODE lockmode)
#define InvokeObjectPostCreateHook(classId, objectId, subId)
#define RelationGetDescr(relation)
void namestrcpy(Name name, const char *str)
#define PointerGetDatum(X)
int errcode(int sqlerrcode)
void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
void recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner)
void heap_freetuple(HeapTuple htup)
#define OidIsValid(objectId)
#define CollationOidIndexId
#define ObjectIdGetDatum(X)
#define SearchSysCacheExists3(cacheId, key1, key2, key3)
#define AssertArg(condition)
int GetDatabaseEncoding(void)
#define ereport(elevel,...)
const char * pg_encoding_to_char(int encoding)
#define Assert(condition)
#define ShareRowExclusiveLock
void recordDependencyOnCurrentExtension(const ObjectAddress *object, bool isReplace)
static Datum values[MAXATTR]
int errmsg(const char *fmt,...)
Relation table_open(Oid relationId, LOCKMODE lockmode)
#define ERRCODE_DUPLICATE_OBJECT
void CatalogTupleInsert(Relation heapRel, HeapTuple tup)