pg_conversion.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_conversion.h
  4. * definition of the "conversion" system catalog (pg_conversion)
  5. *
  6. * Portions Copyright (c) 1996-2022, 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. #include "catalog/genbki.h"
  20. #include "catalog/objectaddress.h"
  21. #include "catalog/pg_conversion_d.h"
  22. /* ----------------
  23. * pg_conversion definition. cpp turns this into
  24. * typedef struct FormData_pg_conversion
  25. * ----------------
  26. */
  27. CATALOG(pg_conversion,2607,ConversionRelationId)
  28. {
  29. /* oid */
  30. Oid oid;
  31. /* name of the conversion */
  32. NameData conname;
  33. /* namespace that the conversion belongs to */
  34. Oid connamespace BKI_DEFAULT(pg_catalog) BKI_LOOKUP(pg_namespace);
  35. /* owner of the conversion */
  36. Oid conowner BKI_DEFAULT(POSTGRES) BKI_LOOKUP(pg_authid);
  37. /* FOR encoding id */
  38. int32 conforencoding BKI_LOOKUP(encoding);
  39. /* TO encoding id */
  40. int32 contoencoding BKI_LOOKUP(encoding);
  41. /* OID of the conversion proc */
  42. regproc conproc BKI_LOOKUP(pg_proc);
  43. /* true if this is a default conversion */
  44. bool condefault BKI_DEFAULT(t);
  45. } FormData_pg_conversion;
  46. /* ----------------
  47. * Form_pg_conversion corresponds to a pointer to a tuple with
  48. * the format of pg_conversion relation.
  49. * ----------------
  50. */
  51. typedef FormData_pg_conversion *Form_pg_conversion;
  52. DECLARE_UNIQUE_INDEX(pg_conversion_default_index, 2668, ConversionDefaultIndexId, on pg_conversion using btree(connamespace oid_ops, conforencoding int4_ops, contoencoding int4_ops, oid oid_ops));
  53. DECLARE_UNIQUE_INDEX(pg_conversion_name_nsp_index, 2669, ConversionNameNspIndexId, on pg_conversion using btree(conname name_ops, connamespace oid_ops));
  54. DECLARE_UNIQUE_INDEX_PKEY(pg_conversion_oid_index, 2670, ConversionOidIndexId, on pg_conversion using btree(oid oid_ops));
  55. extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace,
  56. Oid conowner,
  57. int32 conforencoding, int32 contoencoding,
  58. Oid conproc, bool def);
  59. extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding,
  60. int32 to_encoding);
  61. #endif /* PG_CONVERSION_H */