Skip to content

Commit

Permalink
Add support for new catalog columns in v11, v12, and v13.
Browse files Browse the repository at this point in the history
Sumanta Mukherjee, reviewed by Rushabh Lathia and Beena Emerson
  • Loading branch information
robertmhaas committed Jun 12, 2020
1 parent 96ecca5 commit 9cf98b4
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion definitions.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ struct pg_catalog_check_oid check_database_oid =
{CHECK_OID_REFERENCE, false, "pg_database"};
struct pg_catalog_check_oid check_subscription_oid =
{CHECK_OID_REFERENCE, false, "pg_subscription"};
struct pg_catalog_check_oid check_redaction_policy_oid =
{CHECK_OID_REFERENCE, false, "edb_redaction_policy"};
struct pg_catalog_check_oid check_statistic_ext_oid =
{CHECK_OID_REFERENCE, false, "pg_statistic_ext"};
struct pg_catalog_check_oid check_trigger_optional_oid =
{CHECK_OID_REFERENCE, true, "pg_trigger"};

/* pg_catalog_table & pg_catalog_column */
struct pg_catalog_column pg_class_column[] =
Expand Down Expand Up @@ -259,6 +265,7 @@ struct pg_catalog_column pg_constraint_column[] =
{"conppeqop", NULL, 0, 0, false, false, false, &check_operator_oid_array},
{"conffeqop", NULL, 0, 0, false, false, false, &check_operator_oid_array},
{"conexclop", NULL, 90000, 0, false, false, false, &check_operator_oid_array},
{"conparentid", NULL, 110000, 0, false, false, false, &check_constraint_optional_oid},
{NULL}
};

Expand Down Expand Up @@ -314,8 +321,10 @@ struct pg_catalog_column pg_trigger_column[] =
{
/* pg_trigger */
{"oid", NULL, 0, 0, false, true, true},
{"tgpackageoid", NULL, 120000, 0, true, false, false, &check_namespace_optional_oid},
{"tgparentid", NULL, 130000, 0, false, false, false, &check_trigger_optional_oid},
{"tgrelid", NULL, 0, 0, false, false, false, &check_class_oid},
{"tgfoid", NULL, 0, 0, false, false, false, &check_proc_oid},
{"tgfoid", NULL, 0, 0, false, false, false, &check_proc_optional_oid},
{"tgconstrrelid", NULL, 0, 0, false, false, false, &check_class_optional_oid},
{"tgconstrindid", NULL, 90000, 0, false, false, false, &check_index_optional_oid},
{"tgconstraint", NULL, 0, 0, false, false, false, &check_constraint_optional_oid},
Expand Down Expand Up @@ -582,6 +591,10 @@ struct pg_catalog_column pg_statistic_column[] =
{"staop2", NULL, 0, 0, false, false, false, &check_operator_optional_oid},
{"staop3", NULL, 0, 0, false, false, false, &check_operator_optional_oid},
{"staop4", NULL, 0, 0, false, false, false, &check_operator_optional_oid},
{"stacoll1", NULL, 120000, 0, false, false, false, &check_collation_optional_oid},
{"stacoll2", NULL, 120000, 0, false, false, false, &check_collation_optional_oid},
{"stacoll3", NULL, 120000, 0, false, false, false, &check_collation_optional_oid},
{"stacoll4", NULL, 120000, 0, false, false, false, &check_collation_optional_oid},
{NULL}
};

Expand Down Expand Up @@ -796,6 +809,7 @@ struct pg_catalog_column pg_partitioned_table_column[] =
{
/* pg_partitioned_table */
{"partrelid", NULL, 100000, 0, false, true, true, &check_class_oid},
{"partdefid", NULL, 110000, 0, false, false, false, &check_class_optional_oid},
{"partclass", NULL, 100000, 0, false, false, false, &check_opclass_oid_vector},
{"partcollation", NULL, 100000, 0, false, false, false, &check_collation_optional_oid_vector},
{NULL}
Expand Down Expand Up @@ -850,6 +864,13 @@ struct pg_catalog_column pg_statistic_ext_column[] =
{NULL}
};

struct pg_catalog_column pg_statistic_ext_data_column[] =
{
/* pg_statistic_ext_data */
{"stxoid", NULL, 120000, 0, false, true, true, &check_statistic_ext_oid},
{NULL}
};

struct pg_catalog_column pg_subscription_column[] =
{
/* pg_subscription */
Expand Down Expand Up @@ -878,6 +899,23 @@ struct pg_catalog_column pg_transform_column[] =
{NULL}
};

struct pg_catalog_column edb_redaction_column[] =
{
/* edb_redaction_column */
{"oid", NULL, 110000, 0, true, true, true},
{"rdpolicyid", NULL, 110000, 0, true, false, false, &check_redaction_policy_oid},
{"rdrelid", NULL, 110000, 0, true, false, false, &check_class_oid},
{NULL}
};

struct pg_catalog_column edb_redaction_policy_column[] =
{
/* edb_redaction_policy */
{"oid", NULL, 110000, 0, true, true, true},
{"rdrelid", NULL, 110000, 0, true, false, false, &check_class_oid},
{NULL}
};

struct pg_catalog_table pg_catalog_tables[] =
{
{"pg_class", pg_class_column},
Expand Down Expand Up @@ -954,5 +992,8 @@ struct pg_catalog_table pg_catalog_tables[] =
{"pg_subscription", pg_subscription_column},
{"pg_subscription_rel", pg_subscription_rel_column},
{"pg_transform", pg_transform_column},
{"edb_redaction_column", edb_redaction_column},
{"edb_redaction_policy", edb_redaction_policy_column},
{"pg_statistic_ext_data", pg_statistic_ext_data_column},
{NULL}
};

0 comments on commit 9cf98b4

Please sign in to comment.