toasting.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*-------------------------------------------------------------------------
  2. *
  3. * toasting.h
  4. * This file provides some definitions to support creation of toast tables
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/catalog/toasting.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef TOASTING_H
  15. #define TOASTING_H
  16. #include "storage/lock.h"
  17. /*
  18. * toasting.c prototypes
  19. */
  20. extern void NewRelationCreateToastTable(Oid relOid, Datum reloptions);
  21. extern void NewHeapCreateToastTable(Oid relOid, Datum reloptions,
  22. LOCKMODE lockmode);
  23. extern void AlterTableCreateToastTable(Oid relOid, Datum reloptions,
  24. LOCKMODE lockmode);
  25. extern void BootstrapToastTable(char *relName,
  26. Oid toastOid, Oid toastIndexOid);
  27. /*
  28. * This macro is just to keep the C compiler from spitting up on the
  29. * upcoming commands for genbki.pl.
  30. */
  31. #define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable
  32. /*
  33. * What follows are lines processed by genbki.pl to create the statements
  34. * the bootstrap parser will turn into BootstrapToastTable commands.
  35. * Each line specifies the system catalog that needs a toast table,
  36. * the OID to assign to the toast table, and the OID to assign to the
  37. * toast table's index. The reason we hard-wire these OIDs is that we
  38. * need stable OIDs for shared relations, and that includes toast tables
  39. * of shared relations.
  40. */
  41. /* normal catalogs */
  42. DECLARE_TOAST(pg_attrdef, 2830, 2831);
  43. DECLARE_TOAST(pg_constraint, 2832, 2833);
  44. DECLARE_TOAST(pg_description, 2834, 2835);
  45. DECLARE_TOAST(pg_proc, 2836, 2837);
  46. DECLARE_TOAST(pg_rewrite, 2838, 2839);
  47. DECLARE_TOAST(pg_seclabel, 3598, 3599);
  48. DECLARE_TOAST(pg_statistic, 2840, 2841);
  49. DECLARE_TOAST(pg_trigger, 2336, 2337);
  50. /* shared catalogs */
  51. DECLARE_TOAST(pg_shdescription, 2846, 2847);
  52. #define PgShdescriptionToastTable 2846
  53. #define PgShdescriptionToastIndex 2847
  54. DECLARE_TOAST(pg_db_role_setting, 2966, 2967);
  55. #define PgDbRoleSettingToastTable 2966
  56. #define PgDbRoleSettingToastIndex 2967
  57. DECLARE_TOAST(pg_shseclabel, 4060, 4061);
  58. #define PgShseclabelToastTable 4060
  59. #define PgShseclabelToastIndex 4061
  60. #endif /* TOASTING_H */