Reduce the need for frontend programs to include "postgres.h" by refactoring
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Mar 2008 03:57:34 +0000 (03:57 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Mar 2008 03:57:34 +0000 (03:57 +0000)
inclusions in src/include/catalog/*.h files.  The main idea here is to push
function declarations for src/backend/catalog/*.c files into separate headers,
rather than sticking them into the corresponding catalog definition file as
has been done in the past.  This commit only carries out that idea fully for
pg_proc, pg_type and pg_conversion, but that's enough for the moment ---
if pg_list.h ever becomes unsafe for frontend code to include, we'll need
to work a bit more.

Zdenek Kotala

67 files changed:
src/backend/catalog/dependency.c
src/backend/catalog/heap.c
src/backend/catalog/namespace.c
src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_conversion.c
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_type.c
src/backend/commands/conversioncmds.c
src/backend/commands/functioncmds.c
src/backend/commands/proclang.c
src/backend/commands/tablecmds.c
src/backend/commands/typecmds.c
src/backend/parser/keywords.c
src/backend/utils/hash/pg_crc.c
src/bin/pg_config/pg_config.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_dump/common.c
src/bin/pg_dump/pg_dump.c
src/bin/psql/print.c
src/include/catalog/genbki.h [new file with mode: 0644]
src/include/catalog/pg_aggregate.h
src/include/catalog/pg_am.h
src/include/catalog/pg_amop.h
src/include/catalog/pg_amproc.h
src/include/catalog/pg_attrdef.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_auth_members.h
src/include/catalog/pg_authid.h
src/include/catalog/pg_autovacuum.h
src/include/catalog/pg_cast.h
src/include/catalog/pg_class.h
src/include/catalog/pg_constraint.h
src/include/catalog/pg_conversion.h
src/include/catalog/pg_conversion_fn.h [new file with mode: 0644]
src/include/catalog/pg_database.h
src/include/catalog/pg_depend.h
src/include/catalog/pg_description.h
src/include/catalog/pg_enum.h
src/include/catalog/pg_index.h
src/include/catalog/pg_inherits.h
src/include/catalog/pg_language.h
src/include/catalog/pg_largeobject.h
src/include/catalog/pg_listener.h
src/include/catalog/pg_namespace.h
src/include/catalog/pg_opclass.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_opfamily.h
src/include/catalog/pg_pltemplate.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc_fn.h [new file with mode: 0644]
src/include/catalog/pg_rewrite.h
src/include/catalog/pg_shdepend.h
src/include/catalog/pg_shdescription.h
src/include/catalog/pg_statistic.h
src/include/catalog/pg_tablespace.h
src/include/catalog/pg_trigger.h
src/include/catalog/pg_ts_config.h
src/include/catalog/pg_ts_config_map.h
src/include/catalog/pg_ts_dict.h
src/include/catalog/pg_ts_parser.h
src/include/catalog/pg_ts_template.h
src/include/catalog/pg_type.h
src/include/catalog/pg_type_fn.h [new file with mode: 0644]
src/include/commands/sequence.h
src/include/pg_config_manual.h
src/include/postgres.h
src/pl/plpgsql/src/pl_comp.c

index 2d6d7133d3e6afa419528c75cf85a4619138e548..f60bea3c87baeeecc0afc26bc6443f60dbbefd1d 100644 (file)
@@ -29,6 +29,7 @@
 #include "catalog/pg_cast.h"
 #include "catalog/pg_constraint.h"
 #include "catalog/pg_conversion.h"
+#include "catalog/pg_conversion_fn.h"
 #include "catalog/pg_database.h"
 #include "catalog/pg_depend.h"
 #include "catalog/pg_language.h"
index 012207a05cf542c082fda288bd70baf930253eb8..3553c3bde5b5e04a69d44401806599b1dd797cc2 100644 (file)
@@ -45,6 +45,7 @@
 #include "catalog/pg_statistic.h"
 #include "catalog/pg_tablespace.h"
 #include "catalog/pg_type.h"
+#include "catalog/pg_type_fn.h"
 #include "commands/tablecmds.h"
 #include "commands/typecmds.h"
 #include "miscadmin.h"
index 0fdcc63971e53464c9f8cccc6c9797d788a14490..2fa63d08bd0331a4dfc411a7cbb348f78f811e8a 100644 (file)
@@ -24,6 +24,7 @@
 #include "catalog/namespace.h"
 #include "catalog/pg_authid.h"
 #include "catalog/pg_conversion.h"
+#include "catalog/pg_conversion_fn.h"
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_opclass.h"
 #include "catalog/pg_operator.h"
index c8d0c6e30eb3f7375ddd9209ec149a544ff70486..1a6c8502066c9e2a0c47a6433991ea9c88d6320b 100644 (file)
@@ -21,6 +21,7 @@
 #include "catalog/pg_language.h"
 #include "catalog/pg_operator.h"
 #include "catalog/pg_proc.h"
+#include "catalog/pg_proc_fn.h"
 #include "catalog/pg_type.h"
 #include "miscadmin.h"
 #include "parser/parse_coerce.h"
index b3c2aca5739ad0f9d273a6ed57bc36ed1166dff1..42a3de5b7fe8c895455e46696c72f8b319363b40 100644 (file)
@@ -19,6 +19,7 @@
 #include "catalog/indexing.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_conversion.h"
+#include "catalog/pg_conversion_fn.h"
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_proc.h"
 #include "mb/pg_wchar.h"
index adf17bfdda4d1b44b70381d05c13c6175e75d223..c7edf63eafe4d78a752f97b14b15f3a130315ab4 100644 (file)
@@ -21,6 +21,7 @@
 #include "catalog/pg_language.h"
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_proc.h"
+#include "catalog/pg_proc_fn.h"
 #include "catalog/pg_type.h"
 #include "executor/functions.h"
 #include "funcapi.h"
index 888b66c6f25cc98d04ddc4cbc75e6b6bcf4202ec..cde8cc383502367c697fe2e30e9fdf66ca9eab81 100644 (file)
@@ -21,6 +21,7 @@
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_type.h"
+#include "catalog/pg_type_fn.h"
 #include "commands/typecmds.h"
 #include "miscadmin.h"
 #include "parser/scansup.h"
index 2bdb144a238109d576a030baa6107afc397af632..3e74f2e5d8f65b1638d97b9b85f293fa6437fc31 100644 (file)
@@ -18,6 +18,7 @@
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_conversion.h"
+#include "catalog/pg_conversion_fn.h"
 #include "catalog/pg_type.h"
 #include "commands/conversioncmds.h"
 #include "mb/pg_wchar.h"
index 22d71f2cb19d3b7fc657e7dcb65528aa6176b2d7..942f64ebf643e56f200b64b548d52c3fb6ad4634 100644 (file)
@@ -41,7 +41,9 @@
 #include "catalog/pg_language.h"
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_proc.h"
+#include "catalog/pg_proc_fn.h"
 #include "catalog/pg_type.h"
+#include "catalog/pg_type_fn.h"
 #include "commands/defrem.h"
 #include "commands/proclang.h"
 #include "miscadmin.h"
index c1bf7224ebb14d0483a6047a51b278c888f904e9..b4f62bece1db893883f26204ec57c15b10d205d9 100644 (file)
@@ -22,6 +22,7 @@
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_pltemplate.h"
 #include "catalog/pg_proc.h"
+#include "catalog/pg_proc_fn.h"
 #include "catalog/pg_type.h"
 #include "commands/dbcommands.h"
 #include "commands/defrem.h"
index df21a5b824bad0736579a9cc2408ae73b4b5f5c7..16377168364f65cbc243fe06bf81b3c60860bf2e 100644 (file)
@@ -32,6 +32,7 @@
 #include "catalog/pg_tablespace.h"
 #include "catalog/pg_trigger.h"
 #include "catalog/pg_type.h"
+#include "catalog/pg_type_fn.h"
 #include "catalog/toasting.h"
 #include "commands/cluster.h"
 #include "commands/defrem.h"
index c1d970c38461ad491ffc49c983cc0f267e791fb4..188fe43e7b273dbe65f9d8bb72a1d6cfc357127c 100644 (file)
@@ -43,6 +43,7 @@
 #include "catalog/pg_enum.h"
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_type.h"
+#include "catalog/pg_type_fn.h"
 #include "commands/defrem.h"
 #include "commands/tablecmds.h"
 #include "commands/typecmds.h"
index d363be4a5552dccf5bcea2cddd5190a2013f4840..d26bece8744569254a2465c40ef54d77d807a905 100644 (file)
@@ -3,6 +3,9 @@
  * keywords.c
  *       lexical token lookup for key words in PostgreSQL
  *
+ * NB: This file is also used by pg_dump.
+ *
+ *
  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
  *-------------------------------------------------------------------------
  */
-#include "postgres.h"
+
+/* Use c.h so that this file can be built in either frontend or backend */
+#include "c.h"
 
 #include <ctype.h>
 
-#include "nodes/parsenodes.h"
-#include "parser/gramparse.h"  /* required before parser/parse.h! */
+/*
+ * This macro definition overrides the YYSTYPE union definition in parse.h.
+ * We don't need that struct in this file, and including the real definition
+ * would require sucking in some backend-only include files.
+ */
+#define YYSTYPE int
+
 #include "parser/keywords.h"
 #include "parser/parse.h"
 
-/* NB: This file is also used by pg_dump. */
 
 /*
  * List of keyword (name, token-value, category) entries.
index 7823170e93628ae65155be55b0c6bce03870f1f5..d0a256cda50cf286fb999b96ff3ac18c6641345b 100644 (file)
@@ -23,8 +23,9 @@
  *
  *-------------------------------------------------------------------------
  */
-#include "postgres.h"
 
+/* Use c.h so that this file can be built in either frontend or backend */
+#include "c.h"
 
 
 /*
index 955d85a5b82b4815ed16d5109d653f9a7d4c6241..d9807308ac1b2db91ac946b602e61bc880b7456f 100644 (file)
@@ -22,7 +22,7 @@
  *-------------------------------------------------------------------------
  */
 
-#include "postgres.h"
+#include "postgres_fe.h"
 
 #include "port.h"
 
index 2e6a5dc09a723bb2091ac2f4100e4a22545e0f50..52619838b2b94fb77ee9ff627120ff23955bdca0 100644 (file)
@@ -8,7 +8,7 @@
  *
  * $PostgreSQL$
  */
-#include "postgres.h"
+#include "postgres_fe.h"
 
 #include <unistd.h>
 #include <time.h>
index 279a59886501ca5993cc2b08f32da8bceab27ebe..b1dfd02f318a78f130b84d11e6ef4250de0d8535 100644 (file)
  *
  *-------------------------------------------------------------------------
  */
-
 #include "postgres_fe.h"
-#include "pg_backup_archiver.h"
 
-#include "postgres.h"
+#include <ctype.h>
+
 #include "catalog/pg_class.h"
 
-#include <ctype.h>
+#include "pg_backup_archiver.h"
 
 
 /*
index 28421849f8b062865b558f4be4d19bd6759d4adf..74478e1e7dfe3fded6a5db50836f1d5be65da4a1 100644 (file)
  *-------------------------------------------------------------------------
  */
 
-/*
- * Although this is not a backend module, we must include postgres.h anyway
- * so that we can include a bunch of backend include files.  pg_dump has
- * never pretended to be very independent of the backend anyhow ...
- */
-#include "postgres.h"
+#include "postgres_fe.h"
 
 #include <unistd.h>
-
 #include <ctype.h>
 #ifdef ENABLE_NLS
 #include <locale.h>
 int                    optreset;
 #endif
 
+#include "access/attnum.h"
 #include "access/htup.h"
 #include "catalog/pg_class.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_trigger.h"
 #include "catalog/pg_type.h"
-#include "commands/sequence.h"
 #include "libpq/libpq-fs.h"
 
 #include "pg_backup_archiver.h"
index 2ac6ee12640f9a34fb5b2c0dc54ebafaafdba070..a91da18c5423e451e2fbf03a970ff02d224e5ac2 100644 (file)
@@ -4,11 +4,9 @@
  * Copyright (c) 2000-2008, PostgreSQL Global Development Group
  *
  * $PostgreSQL$
- *
- * Note: we include postgres.h not postgres_fe.h so that we can include
- * catalog/pg_type.h, and thereby have access to INT4OID and similar macros.
  */
-#include "postgres.h"
+#include "postgres_fe.h"
+
 #include "print.h"
 #include "catalog/pg_type.h"
 
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
new file mode 100644 (file)
index 0000000..2b87227
--- /dev/null
@@ -0,0 +1,39 @@
+/*-------------------------------------------------------------------------
+ *
+ * genbki.h
+ *       Required include file for all POSTGRES catalog header files
+ *
+ * genbki.h defines CATALOG(), DATA(), BKI_BOOTSTRAP and related macros
+ * so that the catalog header files can be read by the C compiler.
+ * (These same words are recognized by genbki.sh to build the BKI
+ * bootstrap file from these header files.)
+ *
+ *
+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL$
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef GENBKI_H 
+#define GENBKI_H
+
+/* Introduces a catalog's structure definition */
+#define CATALOG(name,oid)      typedef struct CppConcat(FormData_,name)
+
+/* Options that may appear after CATALOG (on the same line) */
+#define BKI_BOOTSTRAP
+#define BKI_SHARED_RELATION
+#define BKI_WITHOUT_OIDS
+
+/* Declarations that provide the initial content of a catalog */
+/* In C, these need to expand into some harmless, repeatable declaration */
+#define DATA(x)   extern int no_such_variable
+#define DESCR(x)  extern int no_such_variable
+#define SHDESCR(x) extern int no_such_variable
+
+/* PHONY type definition for use in catalog structure definitions only */
+typedef int aclitem;
+
+#endif   /* GENBKI_H */
index a5c011b3fc0d7a4c3f891b3f3c1a1e114f36f49d..99757b6f93e8b0d5418be8bf16a061f41a371222 100644 (file)
 #ifndef PG_AGGREGATE_H
 #define PG_AGGREGATE_H
 
+#include "catalog/genbki.h"
 #include "nodes/pg_list.h"
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
-
 /* ----------------------------------------------------------------
  *             pg_aggregate definition.
  *
index dc233fd07f4afe3689dbafaa3b21d6599d08012b..affc937f1deacd5a53b6550004c449023ab3a989 100644 (file)
 #ifndef PG_AM_H
 #define PG_AM_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_am definition.  cpp turns this into
index 2cfc373624a50250b0fcc6e79911334744f02680..3a6ee11f26bbafe0978f0b0eefa644af17fcfe75 100644 (file)
 #ifndef PG_AMOP_H
 #define PG_AMOP_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_amop definition.  cpp turns this into
index 6eb066423c97d84e513e96cb143b7285add9ce85..752d69221e0665902d1003d69c97a1797339b0ab 100644 (file)
 #ifndef PG_AMPROC_H
 #define PG_AMPROC_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_amproc definition.  cpp turns this into
index 763a3292cb6c4a16c90247cdfc39b176f87a64e9..5dc72695004bacdea83c638df96cbe1e11579b05 100644 (file)
 #ifndef PG_ATTRDEF_H
 #define PG_ATTRDEF_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_attrdef definition.  cpp turns this into
index e48ab23a101a1e472cf16bdd91db74ab49404476..cb713ee3bdbbf073071fc9e6edf70a71041c4585 100644 (file)
 #ifndef PG_ATTRIBUTE_H
 #define PG_ATTRIBUTE_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_attribute definition.  cpp turns this into
index 1e14dcee0644ef2aa592e51ab28d2105d0206d2c..6ee357a684843f7523044ee7634103c99af32732 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef PG_AUTH_MEMBERS_H
 #define PG_AUTH_MEMBERS_H
 
+#include "catalog/genbki.h"
+
 /* ----------------
  *             pg_auth_members definition.  cpp turns this into
  *             typedef struct FormData_pg_auth_members
index de146301059d7ebb293098ccc5def4a1470d6525..004ab5c42db50c1c295daeb16128ef41a8d9bcc1 100644 (file)
 #ifndef PG_AUTHID_H
 #define PG_AUTHID_H
 
+#include "catalog/genbki.h"
+
 /*
  * The CATALOG definition has to refer to the type of rolvaliduntil as
  * "timestamptz" (lower case) so that bootstrap mode recognizes it.  But
  * the C header files define this type as TimestampTz. Since the field is
  * potentially-null and therefore can't be accessed directly from C code,
  * there is no particular need for the C struct definition to show the
- * field type as TimestampTz --- instead we just make it Datum.
+ * field type as TimestampTz --- instead we just make it int.
  */
-
-#define timestamptz Datum
+#define timestamptz int
 
 
 /* ----------------
index babd946fb796dd999c2eb2ff2a5100eb9e38c5b0..4c10d8a202c73a68080f135b81797bdae6262876 100644 (file)
 #ifndef PG_AUTOVACUUM_H
 #define PG_AUTOVACUUM_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_autovacuum definition.       cpp turns this into
@@ -26,6 +21,7 @@
  * ----------------
  */
 #define AutovacuumRelationId   1248
+
 CATALOG(pg_autovacuum,1248) BKI_WITHOUT_OIDS
 {
        Oid                     vacrelid;               /* OID of table */
index 756f7493369f9931e64d13ee94d538259c518e6c..44e92b34826138b961e1b182dcf1fe3b72d2960b 100644 (file)
 #ifndef PG_CAST_H
 #define PG_CAST_H
 
+#include "catalog/genbki.h"
+
+/* ----------------
+ *             pg_cast definition.  cpp turns this into
+ *             typedef struct FormData_pg_cast
+ * ----------------
+ */
 #define CastRelationId 2605
 
 CATALOG(pg_cast,2605)
index d61bbc8eba5df506ea84a263e5ba33ce74fd8803..e803ab25d89168f06c95bf5ad7eb5d389e542763 100644 (file)
 #ifndef PG_CLASS_H
 #define PG_CLASS_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_class definition.  cpp turns this into
index ed71aa2f3e6b793db38b30e9dff61bd1b088b942..501899dffba4a05206144077b64a94d49ef6c336 100644 (file)
 #ifndef PG_CONSTRAINT_H
 #define PG_CONSTRAINT_H
 
+#include "catalog/genbki.h"
 #include "nodes/pg_list.h"
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
-
 /* ----------------
  *             pg_constraint definition.  cpp turns this into
  *             typedef struct FormData_pg_constraint
index c97731a1798753b661cba60260ed4a3827ee198b..7f0f37dc5abc0f4d5ebbb121d72c63afb3f2667e 100644 (file)
 #ifndef PG_CONVERSION_H
 #define PG_CONVERSION_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------------------------------------------------------
  *             pg_conversion definition.
@@ -79,18 +74,4 @@ typedef FormData_pg_conversion *Form_pg_conversion;
  * ---------------
  */
 
-/*
- * prototypes for functions in pg_conversion.c
- */
-#include "nodes/parsenodes.h"
-
-extern Oid ConversionCreate(const char *conname, Oid connamespace,
-                                Oid conowner,
-                                int32 conforencoding, int32 contoencoding,
-                                Oid conproc, bool def);
-extern void ConversionDrop(Oid conversionOid, DropBehavior behavior);
-extern void RemoveConversionById(Oid conversionOid);
-extern Oid     FindConversion(const char *conname, Oid connamespace);
-extern Oid     FindDefaultConversion(Oid connamespace, int32 for_encoding, int32 to_encoding);
-
 #endif   /* PG_CONVERSION_H */
diff --git a/src/include/catalog/pg_conversion_fn.h b/src/include/catalog/pg_conversion_fn.h
new file mode 100644 (file)
index 0000000..c5ff7bc
--- /dev/null
@@ -0,0 +1,28 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_conversion_fn.h
+ *      prototypes for functions in catalog/pg_conversion.c
+ *
+ *
+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL$
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_CONVERSION_FN_H
+#define PG_CONVERSION_FN_H
+
+#include "nodes/parsenodes.h"
+
+extern Oid ConversionCreate(const char *conname, Oid connamespace,
+                                Oid conowner,
+                                int32 conforencoding, int32 contoencoding,
+                                Oid conproc, bool def);
+extern void ConversionDrop(Oid conversionOid, DropBehavior behavior);
+extern void RemoveConversionById(Oid conversionOid);
+extern Oid     FindConversion(const char *conname, Oid connamespace);
+extern Oid     FindDefaultConversion(Oid connamespace, int32 for_encoding, int32 to_encoding);
+
+#endif   /* PG_CONVERSION_FN_H */
index 015bc885948f3b140758a66a6b80dca278136e8a..6e9e5d23bf01924ee6691cf9b8048264a768a518 100644 (file)
 #ifndef PG_DATABASE_H
 #define PG_DATABASE_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_database definition.  cpp turns this into
index fae74f05e716c4aa4c264685ed0499ad017ffd70..262529d6dafcea6430af53d04075e1a59d869a7b 100644 (file)
 #ifndef PG_DEPEND_H
 #define PG_DEPEND_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_depend definition.  cpp turns this into
index ccfd3485b2fd8a63a1c758d8052d93927d888ce2..44ecebeaceec57ee5949f403aed16a6850ed3644 100644 (file)
 #ifndef PG_DESCRIPTION_H
 #define PG_DESCRIPTION_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_description definition.      cpp turns this into
index b4fb5d334ba3dea81157643278e47cc9dc7cc951..eab57fb2b98fe4104687529d691caff3fdffa2db 100644 (file)
 #ifndef PG_ENUM_H
 #define PG_ENUM_H
 
+#include "catalog/genbki.h"
 #include "nodes/pg_list.h"
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
-
 /* ----------------
  *             pg_enum definition.  cpp turns this into
  *             typedef struct FormData_pg_enum
index 679371f593dbf83d9b9e2dc7f431793decba2f76..9f4bd78462f36a9867a44ba04cc2dbaba1864c62 100644 (file)
 #ifndef PG_INDEX_H
 #define PG_INDEX_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_index definition.  cpp turns this into
index cb1d13667bc8c9f108eb0a9e5571f53f7c30a276..5adf50e6036edb1824742b1e9ba34933b8a961a4 100644 (file)
 #ifndef PG_INHERITS_H
 #define PG_INHERITS_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_inherits definition.  cpp turns this into
index 522d9e3027813f6f637b7a31840e3034113cce65..64e881e02a1b67d0d7dd26fd4b515034e079866a 100644 (file)
 #ifndef PG_LANGUAGE_H
 #define PG_LANGUAGE_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_language definition.  cpp turns this into
index 4e4776d969ed5aec414346cc56aa39f87dbaba28..d75759424573b6f940232c749c75f8610e1fa1f5 100644 (file)
 #ifndef PG_LARGEOBJECT_H
 #define PG_LARGEOBJECT_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_largeobject definition.      cpp turns this into
index 175be18047b9ad0a5804036817efc44b0b0feb1d..99f17054e26c0b2cfbd3ad378aa8e299b34f3bf4 100644 (file)
 #ifndef PG_LISTENER_H
 #define PG_LISTENER_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------------------------------------------------------
  *             pg_listener definition.
index fe0a6735ca5d6ce9b1e1b2c80eb74cf9db6ca73a..1a7c3180cc6d7328a1039815ef0ad06614e9dab1 100644 (file)
 #ifndef PG_NAMESPACE_H
 #define PG_NAMESPACE_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------------------------------------------------------
  *             pg_namespace definition.
index 2f74979794c4122b0b31519349dee6dd00807575..2f56df38bbbee499d33a4f97ae5a618b21c8c83d 100644 (file)
 #ifndef PG_OPCLASS_H
 #define PG_OPCLASS_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_opclass definition.  cpp turns this into
index 8c475ecdac5cc9be1dafc3222f5598e045b10666..eea0677e85ae671ecf112e81ecbfceac134b13ab 100644 (file)
 #ifndef PG_OPERATOR_H
 #define PG_OPERATOR_H
 
+#include "catalog/genbki.h"
 #include "nodes/pg_list.h"
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
-
 /* ----------------
  *             pg_operator definition.  cpp turns this into
  *             typedef struct FormData_pg_operator
index 2798ba707968a0044f2cc7693d1ee7b9621e3c2a..89583031e2c8516a85389bbfc374174de429e20d 100644 (file)
 #ifndef PG_OPFAMILY_H
 #define PG_OPFAMILY_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_opfamily definition. cpp turns this into
index 537bd3c53e61ac88c10d8c71b448f7093e7c2dd8..b9b03c2f299e694e35a7de86e9ad299602e744c1 100644 (file)
 #ifndef PG_PLTEMPLATE_H
 #define PG_PLTEMPLATE_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_pltemplate definition.  cpp turns this into
index 61c035eefdf4c92b76860237adee0bd8cdb39359..23484149bb62d2de8d0e3109bc62191591173d47 100644 (file)
 #ifndef PG_PROC_H
 #define PG_PROC_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_proc definition.  cpp turns this into
@@ -4443,31 +4438,4 @@ DESCR("is txid visible in snapshot?");
 #define PROARGMODE_OUT         'o'
 #define PROARGMODE_INOUT       'b'
 
-
-/*
- * prototypes for functions in pg_proc.c
- */
-extern Oid ProcedureCreate(const char *procedureName,
-                               Oid procNamespace,
-                               bool replace,
-                               bool returnsSet,
-                               Oid returnType,
-                               Oid languageObjectId,
-                               Oid languageValidator,
-                               const char *prosrc,
-                               const char *probin,
-                               bool isAgg,
-                               bool security_definer,
-                               bool isStrict,
-                               char volatility,
-                               oidvector *parameterTypes,
-                               Datum allParameterTypes,
-                               Datum parameterModes,
-                               Datum parameterNames,
-                               Datum proconfig,
-                               float4 procost,
-                               float4 prorows);
-
-extern bool function_parse_error_transpose(const char *prosrc);
-
 #endif   /* PG_PROC_H */
diff --git a/src/include/catalog/pg_proc_fn.h b/src/include/catalog/pg_proc_fn.h
new file mode 100644 (file)
index 0000000..43b73c2
--- /dev/null
@@ -0,0 +1,40 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_proc_fn.h
+ *      prototypes for functions in catalog/pg_proc.c
+ *
+ *
+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL$
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_PROC_FN_H
+#define PG_PROC_FN_H
+
+extern Oid ProcedureCreate(const char *procedureName,
+                               Oid procNamespace,
+                               bool replace,
+                               bool returnsSet,
+                               Oid returnType,
+                               Oid languageObjectId,
+                               Oid languageValidator,
+                               const char *prosrc,
+                               const char *probin,
+                               bool isAgg,
+                               bool security_definer,
+                               bool isStrict,
+                               char volatility,
+                               oidvector *parameterTypes,
+                               Datum allParameterTypes,
+                               Datum parameterModes,
+                               Datum parameterNames,
+                               Datum proconfig,
+                               float4 procost,
+                               float4 prorows);
+
+extern bool function_parse_error_transpose(const char *prosrc);
+
+#endif   /* PG_PROC_FN_H */
index 60b8ec608852ce9d428e43e1dc8936c8e7eb6161..389eff762c14ce4799076c34367830262efa0895 100644 (file)
 #ifndef PG_REWRITE_H
 #define PG_REWRITE_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_rewrite definition.  cpp turns this into
index bf4312858cacbec7c9135f406660a00f69bb4717..db51f1a4803863756995b694fe1fa1a83003a2c2 100644 (file)
 #ifndef PG_SHDEPEND_H
 #define PG_SHDEPEND_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_shdepend definition.  cpp turns this into
@@ -32,6 +27,7 @@
  * ----------------
  */
 #define SharedDependRelationId 1214
+
 CATALOG(pg_shdepend,1214) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
 {
        /*
index 46b38f60226950974cc7da3a9a236eb1952884d7..770bd3014b0ff6e6b2416d3d70303ef68df84914 100644 (file)
 #ifndef PG_SHDESCRIPTION_H
 #define PG_SHDESCRIPTION_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_shdescription definition.    cpp turns this into
index 763c88cedba2bf4f556ada6b00c20ab15f8a3494..9b967c6d6c4d51e8d1ba07be1543a954157f5250 100644 (file)
 #ifndef PG_STATISTIC_H
 #define PG_STATISTIC_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /*
- * Keep C compiler happy with anyarray, below. This will need to go elsewhere
- * if we ever use anyarray for more than pg_statistic.
+ * The CATALOG definition has to refer to the type of stavaluesN as
+ * "anyarray" so that bootstrap mode recognizes it.  There is no real
+ * typedef for that, however.  Since the fields are potentially-null and
+ * therefore can't be accessed directly from C code, there is no particular
+ * need for the C struct definition to show a valid field type --- instead
+ * we just make it int.
  */
-typedef struct varlena anyarray;
+#define anyarray int
 
 /* ----------------
  *             pg_statistic definition.  cpp turns this into
@@ -129,6 +128,9 @@ CATALOG(pg_statistic,2619) BKI_WITHOUT_OIDS
 
 #define STATISTIC_NUM_SLOTS  4
 
+#undef anyarray
+
+
 /* ----------------
  *             Form_pg_statistic corresponds to a pointer to a tuple with
  *             the format of pg_statistic relation.
index 2ab5a64f8a429318c38ce1c08f3e336cea6a0f8f..20e481dba249394c34905dcf3275676aa1e236f4 100644 (file)
 #ifndef PG_TABLESPACE_H
 #define PG_TABLESPACE_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_tablespace definition.  cpp turns this into
index ca33309e3561f9d846745fb7a0f47d1520cdf67b..7e90ebb6bb9663b8b80826940f025cedaa809936 100644 (file)
 #ifndef PG_TRIGGER_H
 #define PG_TRIGGER_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_trigger definition.  cpp turns this into
index 2f26005951fbb9d851e09615ecbd1eff79ca49d4..5aae8d6c6d9af46ac15ecf5e95de5392301d2c36 100644 (file)
 #ifndef PG_TS_CONFIG_H
 #define PG_TS_CONFIG_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_ts_config definition.  cpp turns this into
index be75f51d97b92ce723be641650b4b7a96780befb..8a3d69cf7b16f525f3b1828ac3220dfd89283896 100644 (file)
 #ifndef PG_TS_CONFIG_MAP_H
 #define PG_TS_CONFIG_MAP_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_ts_config_map definition.  cpp turns this into
index f80c071f018669b2a95a148fc8f449a018f6fe59..f53765438fb4f419bf329f944502f1f57687d599 100644 (file)
 #ifndef PG_TS_DICT_H
 #define PG_TS_DICT_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_ts_dict definition.  cpp turns this into
index 8711cb6485c46b09d53ce94023330a4c15da4dfd..85e0256577bfcee938f915e61e79b2c0eac3a6ab 100644 (file)
 #ifndef PG_TS_PARSER_H
 #define PG_TS_PARSER_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_ts_parser definition.  cpp turns this into
index bd504dfdef90b6597d4267cc8e5252aa5296f0d9..2b53880cf9a02a44f59e6aa543119d1899a4983e 100644 (file)
 #ifndef PG_TS_TEMPLATE_H
 #define PG_TS_TEMPLATE_H
 
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_ts_template definition.      cpp turns this into
index a4e9e8a9296c6874923b9aec56644265be05a0d6..d517da7cb27b8ba01179bcd9c4471a54643fecb7 100644 (file)
 #ifndef PG_TYPE_H
 #define PG_TYPE_H
 
-#include "nodes/nodes.h"
-
-/* ----------------
- *             postgres.h contains the system type definitions and the
- *             CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_type definition.  cpp turns this into
@@ -631,63 +624,4 @@ DATA(insert OID = 3500 ( anyenum           PGNSP PGUID  4 t p t \054 0 0 0 anyenum_in any
         (typid) == ANYNONARRAYOID || \
         (typid) == ANYENUMOID)
 
-/*
- * prototypes for functions in pg_type.c
- */
-extern Oid     TypeShellMake(const char *typeName, Oid typeNamespace);
-
-extern Oid TypeCreate(Oid newTypeOid,
-                  const char *typeName,
-                  Oid typeNamespace,
-                  Oid relationOid,
-                  char relationKind,
-                  int16 internalSize,
-                  char typeType,
-                  char typDelim,
-                  Oid inputProcedure,
-                  Oid outputProcedure,
-                  Oid receiveProcedure,
-                  Oid sendProcedure,
-                  Oid typmodinProcedure,
-                  Oid typmodoutProcedure,
-                  Oid analyzeProcedure,
-                  Oid elementType,
-                  bool isImplicitArray,
-                  Oid arrayType,
-                  Oid baseType,
-                  const char *defaultTypeValue,
-                  char *defaultTypeBin,
-                  bool passedByValue,
-                  char alignment,
-                  char storage,
-                  int32 typeMod,
-                  int32 typNDims,
-                  bool typeNotNull);
-
-extern void GenerateTypeDependencies(Oid typeNamespace,
-                                                Oid typeObjectId,
-                                                Oid relationOid,
-                                                char relationKind,
-                                                Oid owner,
-                                                Oid inputProcedure,
-                                                Oid outputProcedure,
-                                                Oid receiveProcedure,
-                                                Oid sendProcedure,
-                                                Oid typmodinProcedure,
-                                                Oid typmodoutProcedure,
-                                                Oid analyzeProcedure,
-                                                Oid elementType,
-                                                bool isImplicitArray,
-                                                Oid baseType,
-                                                Node *defaultExpr,
-                                                bool rebuild);
-
-extern void RenameTypeInternal(Oid typeOid, const char *newTypeName,
-                  Oid typeNamespace);
-
-extern char *makeArrayTypeName(const char *typeName, Oid typeNamespace);
-
-extern bool moveArrayTypeName(Oid typeOid, const char *typeName,
-                                 Oid typeNamespace);
-
 #endif   /* PG_TYPE_H */
diff --git a/src/include/catalog/pg_type_fn.h b/src/include/catalog/pg_type_fn.h
new file mode 100644 (file)
index 0000000..2990cc1
--- /dev/null
@@ -0,0 +1,76 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_type_fn.h
+ *      prototypes for functions in catalog/pg_type.c
+ *
+ *
+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL$
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_TYPE_FN_H
+#define PG_TYPE_FN_H
+
+#include "nodes/nodes.h"
+
+
+extern Oid     TypeShellMake(const char *typeName, Oid typeNamespace);
+
+extern Oid TypeCreate(Oid newTypeOid,
+                  const char *typeName,
+                  Oid typeNamespace,
+                  Oid relationOid,
+                  char relationKind,
+                  int16 internalSize,
+                  char typeType,
+                  char typDelim,
+                  Oid inputProcedure,
+                  Oid outputProcedure,
+                  Oid receiveProcedure,
+                  Oid sendProcedure,
+                  Oid typmodinProcedure,
+                  Oid typmodoutProcedure,
+                  Oid analyzeProcedure,
+                  Oid elementType,
+                  bool isImplicitArray,
+                  Oid arrayType,
+                  Oid baseType,
+                  const char *defaultTypeValue,
+                  char *defaultTypeBin,
+                  bool passedByValue,
+                  char alignment,
+                  char storage,
+                  int32 typeMod,
+                  int32 typNDims,
+                  bool typeNotNull);
+
+extern void GenerateTypeDependencies(Oid typeNamespace,
+                                                Oid typeObjectId,
+                                                Oid relationOid,
+                                                char relationKind,
+                                                Oid owner,
+                                                Oid inputProcedure,
+                                                Oid outputProcedure,
+                                                Oid receiveProcedure,
+                                                Oid sendProcedure,
+                                                Oid typmodinProcedure,
+                                                Oid typmodoutProcedure,
+                                                Oid analyzeProcedure,
+                                                Oid elementType,
+                                                bool isImplicitArray,
+                                                Oid baseType,
+                                                Node *defaultExpr,
+                                                bool rebuild);
+
+extern void RenameTypeInternal(Oid typeOid, const char *newTypeName,
+                  Oid typeNamespace);
+
+extern char *makeArrayTypeName(const char *typeName, Oid typeNamespace);
+
+extern bool moveArrayTypeName(Oid typeOid, const char *typeName,
+                                 Oid typeNamespace);
+
+#endif   /* PG_TYPE_FN_H */
index c8e5ccb703d444faf8a660d55d3fc5c75e597570..02f6297b3d055ba64f40a438dad1ecdb7d83e101 100644 (file)
@@ -94,13 +94,4 @@ extern void AlterSequence(AlterSeqStmt *stmt);
 extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr);
 extern void seq_desc(StringInfo buf, uint8 xl_info, char *rec);
 
-/* Set the upper and lower bounds of a sequence */
-#ifndef INT64_IS_BUSTED
-#define SEQ_MAXVALUE   INT64CONST(0x7FFFFFFFFFFFFFFF)
-#else                                                  /* INT64_IS_BUSTED */
-#define SEQ_MAXVALUE   ((int64) 0x7FFFFFFF)
-#endif   /* INT64_IS_BUSTED */
-
-#define SEQ_MINVALUE   (-SEQ_MAXVALUE)
-
 #endif   /* SEQUENCE_H */
index d4e1e4183748f8630762acdec07211182ac761a6..fe4f1a00d7824db125f9ef6437ca7a367c27640b 100644 (file)
  */
 #define INDEX_MAX_KEYS         32
 
+/*
+ * Set the upper and lower bounds of sequence values.
+ */
+#ifndef INT64_IS_BUSTED
+#define SEQ_MAXVALUE   INT64CONST(0x7FFFFFFFFFFFFFFF)
+#else                                                  /* INT64_IS_BUSTED */
+#define SEQ_MAXVALUE   ((int64) 0x7FFFFFFF)
+#endif   /* INT64_IS_BUSTED */
+
+#define SEQ_MINVALUE   (-SEQ_MAXVALUE)
+
 /*
  * Number of spare LWLocks to allocate for user-defined add-on code.
  */
index 47f9d875bc3de499a8435c634298950700d32139..043922a8d2e93c7bb5d833e2c11a3fffaa5835af 100644 (file)
@@ -26,7 +26,6 @@
  *             1)              variable-length datatypes (TOAST support)
  *             2)              datum type + support macros
  *             3)              exception handling definitions
- *             4)              genbki macros used by catalog/pg_xxx.h files
  *
  *      NOTES
  *
@@ -708,21 +707,4 @@ extern int ExceptionalCondition(const char *conditionName,
                                         const char *errorType,
                                         const char *fileName, int lineNumber);
 
-/* ----------------------------------------------------------------
- *                             Section 4: genbki macros used by catalog/pg_xxx.h files
- * ----------------------------------------------------------------
- */
-#define CATALOG(name,oid)      typedef struct CppConcat(FormData_,name)
-
-#define BKI_BOOTSTRAP
-#define BKI_SHARED_RELATION
-#define BKI_WITHOUT_OIDS
-
-/* these need to expand into some harmless, repeatable declaration */
-#define DATA(x)   extern int no_such_variable
-#define DESCR(x)  extern int no_such_variable
-#define SHDESCR(x) extern int no_such_variable
-
-typedef int4 aclitem;                  /* PHONY definition for catalog use only */
-
 #endif   /* POSTGRES_H */
index ab4f9b94cc97ba71f919fc85c869e0a5e4931e06..89f27182bdbf0bf9b784765046f936f71933c935 100644 (file)
@@ -25,6 +25,7 @@
 #include "catalog/pg_attribute.h"
 #include "catalog/pg_class.h"
 #include "catalog/pg_proc.h"
+#include "catalog/pg_proc_fn.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "nodes/makefuncs.h"