PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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-2026, 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" /* IWYU pragma: export */
23
24/* ----------------
25 * pg_collation definition. cpp turns this into
26 * typedef struct FormData_pg_collation
27 * ----------------
28 */
30
32{
33 Oid oid; /* oid */
34 NameData collname; /* collation name */
35
36 /* OID of namespace containing this collation */
38
39 /* owner of collation */
41 char collprovider; /* see constants below */
43 int32 collencoding; /* encoding for this collation; -1 = "all" */
44#ifdef CATALOG_VARLEN /* variable-length fields start here */
45 text collcollate BKI_DEFAULT(_null_); /* LC_COLLATE setting */
46 text collctype BKI_DEFAULT(_null_); /* LC_CTYPE setting */
47 text colllocale BKI_DEFAULT(_null_); /* locale ID */
48 text collicurules BKI_DEFAULT(_null_); /* ICU collation rules */
49 text collversion BKI_DEFAULT(_null_); /* provider-dependent
50 * version of collation
51 * data */
52#endif
54
56
57/* ----------------
58 * Form_pg_collation corresponds to a pointer to a row with
59 * the format of pg_collation relation.
60 * ----------------
61 */
63
65
68
71
72#ifdef EXPOSE_TO_CLIENT_CODE
73
74#define COLLPROVIDER_DEFAULT 'd'
75#define COLLPROVIDER_BUILTIN 'b'
76#define COLLPROVIDER_ICU 'i'
77#define COLLPROVIDER_LIBC 'c'
78
79static inline const char *
81{
82 switch (c)
83 {
85 return "builtin";
87 return "icu";
89 return "libc";
90 default:
91 return "???";
92 }
93}
94
95#endif /* EXPOSE_TO_CLIENT_CODE */
96
97
98extern Oid CollationCreate(const char *collname, Oid collnamespace,
100 char collprovider,
102 int32 collencoding,
103 const char *collcollate, const char *collctype,
104 const char *colllocale,
105 const char *collicurules,
106 const char *collversion,
107 bool if_not_exists,
108 bool quiet);
109
110#endif /* PG_COLLATION_H */
int32_t int32
Definition c.h:554
#define BEGIN_CATALOG_STRUCT
Definition genbki.h:37
#define DECLARE_UNIQUE_INDEX_PKEY(name, oid, oidmacro, tblname, decl)
Definition genbki.h:105
#define BKI_LOOKUP(catalog)
Definition genbki.h:65
#define END_CATALOG_STRUCT
Definition genbki.h:38
#define BKI_DEFAULT(value)
Definition genbki.h:54
#define DECLARE_UNIQUE_INDEX(name, oid, oidmacro, tblname, decl)
Definition genbki.h:104
#define DECLARE_TOAST(name, toastoid, indexoid)
Definition genbki.h:82
#define CATALOG(name, oid, oidmacro)
Definition genbki.h:42
#define MAKE_SYSCACHE(name, idxname, nbuckets)
Definition genbki.h:146
FormData_pg_collation
END_CATALOG_STRUCT typedef FormData_pg_collation * Form_pg_collation
Oid CollationCreate(const char *collname, Oid collnamespace, Oid collowner, char collprovider, bool collisdeterministic, int32 collencoding, const char *collcollate, const char *collctype, const char *colllocale, const char *collicurules, const char *collversion, bool if_not_exists, bool quiet)
unsigned int Oid
char * c
static int fb(int x)
Definition c.h:772
Definition c.h:718