PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pg_conversion.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * pg_conversion.h
4 * definition of the "conversion" system catalog (pg_conversion)
5 *
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/include/catalog/pg_conversion.h
10 *
11 * NOTES
12 * The Catalog.pm module reads this file and derives schema
13 * information.
14 *
15 *-------------------------------------------------------------------------
16 */
17#ifndef PG_CONVERSION_H
18#define PG_CONVERSION_H
19
20#include "catalog/genbki.h"
22#include "catalog/pg_conversion_d.h"
23
24/* ----------------
25 * pg_conversion definition. cpp turns this into
26 * typedef struct FormData_pg_conversion
27 * ----------------
28 */
29CATALOG(pg_conversion,2607,ConversionRelationId)
30{
31 /* oid */
32 Oid oid;
33
34 /* name of the conversion */
35 NameData conname;
36
37 /* namespace that the conversion belongs to */
38 Oid connamespace BKI_DEFAULT(pg_catalog) BKI_LOOKUP(pg_namespace);
39
40 /* owner of the conversion */
41 Oid conowner BKI_DEFAULT(POSTGRES) BKI_LOOKUP(pg_authid);
42
43 /* FOR encoding id */
44 int32 conforencoding BKI_LOOKUP(encoding);
45
46 /* TO encoding id */
47 int32 contoencoding BKI_LOOKUP(encoding);
48
49 /* OID of the conversion proc */
50 regproc conproc BKI_LOOKUP(pg_proc);
51
52 /* true if this is a default conversion */
53 bool condefault BKI_DEFAULT(t);
55
56/* ----------------
57 * Form_pg_conversion corresponds to a pointer to a tuple with
58 * the format of pg_conversion relation.
59 * ----------------
60 */
62
63DECLARE_UNIQUE_INDEX(pg_conversion_default_index, 2668, ConversionDefaultIndexId, pg_conversion, btree(connamespace oid_ops, conforencoding int4_ops, contoencoding int4_ops, oid oid_ops));
64DECLARE_UNIQUE_INDEX(pg_conversion_name_nsp_index, 2669, ConversionNameNspIndexId, pg_conversion, btree(conname name_ops, connamespace oid_ops));
65DECLARE_UNIQUE_INDEX_PKEY(pg_conversion_oid_index, 2670, ConversionOidIndexId, pg_conversion, btree(oid oid_ops));
66
67MAKE_SYSCACHE(CONDEFAULT, pg_conversion_default_index, 8);
68MAKE_SYSCACHE(CONNAMENSP, pg_conversion_name_nsp_index, 8);
69MAKE_SYSCACHE(CONVOID, pg_conversion_oid_index, 8);
70
71
72extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace,
73 Oid conowner,
74 int32 conforencoding, int32 contoencoding,
75 Oid conproc, bool def);
76extern Oid FindDefaultConversion(Oid name_space, int32 for_encoding,
77 int32 to_encoding);
78
79#endif /* PG_CONVERSION_H */
Oid regproc
Definition: c.h:603
int32_t int32
Definition: c.h:481
#define BKI_LOOKUP(catalog)
Definition: genbki.h:46
#define BKI_DEFAULT(value)
Definition: genbki.h:35
FormData_pg_conversion * Form_pg_conversion
Definition: pg_conversion.h:61
FormData_pg_conversion
Definition: pg_conversion.h:54
DECLARE_UNIQUE_INDEX(pg_conversion_default_index, 2668, ConversionDefaultIndexId, pg_conversion, btree(connamespace oid_ops, conforencoding int4_ops, contoencoding int4_ops, oid oid_ops))
MAKE_SYSCACHE(CONDEFAULT, pg_conversion_default_index, 8)
DECLARE_UNIQUE_INDEX_PKEY(pg_conversion_oid_index, 2670, ConversionOidIndexId, pg_conversion, btree(oid oid_ops))
Oid FindDefaultConversion(Oid name_space, int32 for_encoding, int32 to_encoding)
CATALOG(pg_conversion, 2607, ConversionRelationId)
Definition: pg_conversion.h:29
ObjectAddress ConversionCreate(const char *conname, Oid connamespace, Oid conowner, int32 conforencoding, int32 contoencoding, Oid conproc, bool def)
Definition: pg_conversion.c:38
int32 encoding
Definition: pg_database.h:41
unsigned int Oid
Definition: postgres_ext.h:31
Definition: c.h:695