61 bool nulls[Natts_pg_collation];
70 AssertArg((collcollate && collctype) || colliculocale);
86 else if (if_not_exists)
91 ?
errmsg(
"collation \"%s\" already exists, skipping",
93 :
errmsg(
"collation \"%s\" for encoding \"%s\" already exists, skipping",
101 ?
errmsg(
"collation \"%s\" already exists",
103 :
errmsg(
"collation \"%s\" for encoding \"%s\" already exists",
117 if ((collencoding == -1 &&
122 (collencoding != -1 &&
133 else if (if_not_exists)
138 errmsg(
"collation \"%s\" already exists, skipping",
145 errmsg(
"collation \"%s\" already exists",
152 memset(nulls, 0,
sizeof(nulls));
156 Anum_pg_collation_oid);
162 values[Anum_pg_collation_collisdeterministic - 1] =
BoolGetDatum(collisdeterministic);
167 nulls[Anum_pg_collation_collcollate - 1] =
true;
171 nulls[Anum_pg_collation_collctype - 1] =
true;
175 nulls[Anum_pg_collation_colliculocale - 1] =
true;
179 nulls[Anum_pg_collation_collversion - 1] =
true;
188 myself.
classId = CollationRelationId;
193 referenced.
classId = NamespaceRelationId;
194 referenced.
objectId = collnamespace;
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
#define OidIsValid(objectId)
#define AssertArg(condition)
Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
const char * pg_encoding_to_char(int encoding)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
void heap_freetuple(HeapTuple htup)
void CatalogTupleInsert(Relation heapRel, HeapTuple tup)
Assert(fmt[strlen(fmt) - 1] !='\n')
#define ShareRowExclusiveLock
int GetDatabaseEncoding(void)
void namestrcpy(Name name, const char *str)
#define InvokeObjectPostCreateHook(classId, objectId, subId)
void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior)
void recordDependencyOnCurrentExtension(const ObjectAddress *object, bool isReplace)
void recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner)
#define ObjectIdGetDatum(X)
#define PointerGetDatum(X)
#define RelationGetDescr(relation)
#define ERRCODE_DUPLICATE_OBJECT
#define SearchSysCacheExists3(cacheId, key1, key2, key3)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)