| 1 | /*------------------------------------------------------------------------- | 
| 2 |  * | 
| 3 |  * pg_collation.h | 
| 4 |  *	  definition of the "collation" system catalog (pg_collation) | 
| 5 |  * | 
| 6 |  * | 
| 7 |  * Portions Copyright (c) 1996-2019, 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 | 	Oid			collnamespace;	/* OID of namespace containing collation */ | 
| 34 | 	Oid			collowner;		/* owner of collation */ | 
| 35 | 	char		collprovider;	/* see constants below */ | 
| 36 | 	bool		collisdeterministic BKI_DEFAULT(t); | 
| 37 | 	int32		collencoding;	/* encoding for this collation; -1 = "all" */ | 
| 38 | 	NameData	collcollate;	/* LC_COLLATE setting */ | 
| 39 | 	NameData	collctype;		/* LC_CTYPE setting */ | 
| 40 | #ifdef CATALOG_VARLEN			/* variable-length fields start here */ | 
| 41 | 	text		collversion;	/* provider-dependent version of collation | 
| 42 | 								 * data */ | 
| 43 | #endif | 
| 44 | } FormData_pg_collation; | 
| 45 |  | 
| 46 | /* ---------------- | 
| 47 |  *		Form_pg_collation corresponds to a pointer to a row with | 
| 48 |  *		the format of pg_collation relation. | 
| 49 |  * ---------------- | 
| 50 |  */ | 
| 51 | typedef FormData_pg_collation *Form_pg_collation; | 
| 52 |  | 
| 53 | #ifdef EXPOSE_TO_CLIENT_CODE | 
| 54 |  | 
| 55 | #define COLLPROVIDER_DEFAULT	'd' | 
| 56 | #define COLLPROVIDER_ICU		'i' | 
| 57 | #define COLLPROVIDER_LIBC		'c' | 
| 58 |  | 
| 59 | #endif							/* EXPOSE_TO_CLIENT_CODE */ | 
| 60 |  | 
| 61 |  | 
| 62 | extern Oid	CollationCreate(const char *collname, Oid collnamespace, | 
| 63 | 							Oid collowner, | 
| 64 | 							char collprovider, | 
| 65 | 							bool collisdeterministic, | 
| 66 | 							int32 collencoding, | 
| 67 | 							const char *collcollate, const char *collctype, | 
| 68 | 							const char *collversion, | 
| 69 | 							bool if_not_exists, | 
| 70 | 							bool quiet); | 
| 71 | extern void RemoveCollationById(Oid collationOid); | 
| 72 |  | 
| 73 | #endif							/* PG_COLLATION_H */ | 
| 74 |  |