PostgreSQL Source Code  git master
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-2019, 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"
21 #include "catalog/pg_conversion_d.h"
22 
23 #include "catalog/objectaddress.h"
24 
25 /* ----------------
26  * pg_conversion definition. cpp turns this into
27  * typedef struct FormData_pg_conversion
28  * ----------------
29  */
30 CATALOG(pg_conversion,2607,ConversionRelationId)
31 {
32  /* oid */
33  Oid oid;
34 
35  /* name of the conversion */
36  NameData conname;
37 
38  /* namespace that the conversion belongs to */
39  Oid connamespace BKI_DEFAULT(PGNSP);
40 
41  /* owner of the conversion */
42  Oid conowner BKI_DEFAULT(PGUID);
43 
44  /* FOR encoding id */
45  int32 conforencoding BKI_LOOKUP(encoding);
46 
47  /* TO encoding id */
48  int32 contoencoding BKI_LOOKUP(encoding);
49 
50  /* OID of the conversion proc */
51  regproc conproc BKI_LOOKUP(pg_proc);
52 
53  /* true if this is a default conversion */
54  bool condefault BKI_DEFAULT(t);
56 
57 /* ----------------
58  * Form_pg_conversion corresponds to a pointer to a tuple with
59  * the format of pg_conversion relation.
60  * ----------------
61  */
63 
64 
65 extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace,
66  Oid conowner,
67  int32 conforencoding, int32 contoencoding,
68  Oid conproc, bool def);
69 extern void RemoveConversionById(Oid conversionOid);
70 extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding,
71  int32 to_encoding);
72 
73 #endif /* PG_CONVERSION_H */
FormData_pg_conversion
Definition: pg_conversion.h:55
unsigned int Oid
Definition: postgres_ext.h:31
#define BKI_DEFAULT(value)
Definition: genbki.h:35
signed int int32
Definition: c.h:346
Oid FindDefaultConversion(Oid connamespace, int32 for_encoding, int32 to_encoding)
Definition: c.h:603
#define BKI_LOOKUP(catalog)
Definition: genbki.h:42
FormData_pg_conversion * Form_pg_conversion
Definition: pg_conversion.h:62
void RemoveConversionById(Oid conversionOid)
CATALOG(pg_conversion, 2607, ConversionRelationId)
Definition: pg_conversion.h:30
int32 encoding
Definition: pg_database.h:41
Oid regproc
Definition: c.h:504
ObjectAddress ConversionCreate(const char *conname, Oid connamespace, Oid conowner, int32 conforencoding, int32 contoencoding, Oid conproc, bool def)
Definition: pg_conversion.c:41