| 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); |
| 55 | } FormData_pg_conversion; |
| 56 | |
| 57 | /* ---------------- |
| 58 | * Form_pg_conversion corresponds to a pointer to a tuple with |
| 59 | * the format of pg_conversion relation. |
| 60 | * ---------------- |
| 61 | */ |
| 62 | typedef FormData_pg_conversion *Form_pg_conversion; |
| 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 */ |
| 74 | |