PostgreSQL Source Code  git master
pg_collation.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_collation.h
4  * definition of the "collation" system catalog (pg_collation)
5  *
6  *
7  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/catalog/pg_collation.h
11  *
12  * NOTES
13  * The Catalog.pm module reads this file and derives schema
14  * information.
15  *
16  *-------------------------------------------------------------------------
17  */
18 #ifndef PG_COLLATION_H
19 #define PG_COLLATION_H
20 
21 #include "catalog/genbki.h"
22 #include "catalog/pg_collation_d.h"
23 
24 /* ----------------
25  * pg_collation definition. cpp turns this into
26  * typedef struct FormData_pg_collation
27  * ----------------
28  */
29 CATALOG(pg_collation,3456,CollationRelationId)
30 {
31  Oid oid; /* oid */
32  NameData collname; /* collation name */
33 
34  /* OID of namespace containing this collation */
35  Oid collnamespace BKI_DEFAULT(pg_catalog) BKI_LOOKUP(pg_namespace);
36 
37  /* owner of collation */
38  Oid collowner BKI_DEFAULT(POSTGRES) BKI_LOOKUP(pg_authid);
39  char collprovider; /* see constants below */
40  bool collisdeterministic BKI_DEFAULT(t);
41  int32 collencoding; /* encoding for this collation; -1 = "all" */
42  NameData collcollate; /* LC_COLLATE setting */
43  NameData collctype; /* LC_CTYPE setting */
45 
46 /* ----------------
47  * Form_pg_collation corresponds to a pointer to a row with
48  * the format of pg_collation relation.
49  * ----------------
50  */
52 
53 DECLARE_UNIQUE_INDEX(pg_collation_name_enc_nsp_index, 3164, on pg_collation using btree(collname name_ops, collencoding int4_ops, collnamespace oid_ops));
54 #define CollationNameEncNspIndexId 3164
55 DECLARE_UNIQUE_INDEX_PKEY(pg_collation_oid_index, 3085, on pg_collation using btree(oid oid_ops));
56 #define CollationOidIndexId 3085
57 
58 #ifdef EXPOSE_TO_CLIENT_CODE
59 
60 #define COLLPROVIDER_DEFAULT 'd'
61 #define COLLPROVIDER_ICU 'i'
62 #define COLLPROVIDER_LIBC 'c'
63 
64 #endif /* EXPOSE_TO_CLIENT_CODE */
65 
66 
67 extern Oid CollationCreate(const char *collname, Oid collnamespace,
68  Oid collowner,
69  char collprovider,
70  bool collisdeterministic,
71  int32 collencoding,
72  const char *collcollate, const char *collctype,
73  bool if_not_exists,
74  bool quiet);
75 
76 #endif /* PG_COLLATION_H */
DECLARE_UNIQUE_INDEX(pg_collation_name_enc_nsp_index, 3164, on pg_collation using btree(collname name_ops, collencoding int4_ops, collnamespace oid_ops))
unsigned int Oid
Definition: postgres_ext.h:31
#define BKI_DEFAULT(value)
Definition: genbki.h:35
signed int int32
Definition: c.h:429
DECLARE_UNIQUE_INDEX_PKEY(pg_collation_oid_index, 3085, on pg_collation using btree(oid oid_ops))
Definition: c.h:675
#define BKI_LOOKUP(catalog)
Definition: genbki.h:46
Oid CollationCreate(const char *collname, Oid collnamespace, Oid collowner, char collprovider, bool collisdeterministic, int32 collencoding, const char *collcollate, const char *collctype, bool if_not_exists, bool quiet)
Definition: pg_collation.c:46
FormData_pg_collation
Definition: pg_collation.h:44
FormData_pg_collation * Form_pg_collation
Definition: pg_collation.h:51
CATALOG(pg_collation, 3456, CollationRelationId)
Definition: pg_collation.h:29