Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions sql/object_reference--stable.sql
Original file line numberDiff line numberDiff line change
Expand Up@@ -85,7 +85,7 @@ CREATE FUNCTION __object_reference.create_function(
, grants text DEFAULT NULL
) RETURNS void LANGUAGE plpgsql AS $body$
DECLARE
c_clean_args text := cat_tools.function__arg_types_text(args);
c_clean_args text := cat_tools.routine__parse_arg_types_text(args);

create_template CONSTANT text := $template$
CREATE OR REPLACE FUNCTION %s(
Expand DownExpand Up@@ -523,7 +523,12 @@ SELECT __object_reference.create_function(
, $body$
SELECT cat_tools.objects__shared()
|| cat_tools.objects__address_unsupported()
|| '{event trigger}'
/*
* pg_get_object_address() doesn't recognize "partitioned table" or
* "partitioned index" (only the base "table"/"index" types it derives
* from), so object identity tracking can't round-trip them.
*/
|| '{event trigger, partitioned table, partitioned index}'
$body$
, 'Returns array of object types that are not supported.'
, 'object_reference__usage'
Expand Down
9 changes: 7 additions & 2 deletions sql/object_reference.sql
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,7 +84,7 @@ CREATE FUNCTION __object_reference.create_function(
, grants text DEFAULT NULL
) RETURNS void LANGUAGE plpgsql AS $body$
DECLARE
c_clean_args text := cat_tools.function__arg_types_text(args);
c_clean_args text := cat_tools.routine__parse_arg_types_text(args);

create_template CONSTANT text := $template$
CREATE OR REPLACE FUNCTION %s(
Expand DownExpand Up@@ -522,7 +522,12 @@ SELECT __object_reference.create_function(
, $body$
SELECT cat_tools.objects__shared()
|| cat_tools.objects__address_unsupported()
|| '{event trigger}'
/*
* pg_get_object_address() doesn't recognize "partitioned table" or
* "partitioned index" (only the base "table"/"index" types it derives
* from), so object identity tracking can't round-trip them.
*/
|| '{event trigger, partitioned table, partitioned index}'
$body$
, 'Returns array of object types that are not supported.'
, 'object_reference__usage'
Expand Down
10 changes: 5 additions & 5 deletions test/expected/zzz_build.out
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,16 +2,16 @@
This extension must be loaded via CREATE EXTENSION object_reference;
You really, REALLY do NOT want to try and load this via psql!!!

psql:test/temp_load.not_sql:188: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!
psql:test/temp_load.not_sql:187: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!

psql:test/temp_load.not_sql:189: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!
psql:test/temp_load.not_sql:188: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!






psql:test/temp_load.not_sql:513: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!
psql:test/temp_load.not_sql:512: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!



Expand All@@ -21,9 +21,9 @@ psql:test/temp_load.not_sql:513: WARNING: I promise you will be sorry if you tr



psql:test/temp_load.not_sql:620: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!
psql:test/temp_load.not_sql:624: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!

psql:test/temp_load.not_sql:627: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!
psql:test/temp_load.not_sql:631: WARNING: I promise you will be sorry if you try to use this as anything other than an extension!



Expand Down
7 changes: 7 additions & 0 deletions test/sql/all.sql
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,6 +53,13 @@ SELECT bag_eq(
UNION -- Intentionally not UNION ALL; we want to know if object_reference.unsupported has dupes
SELECT * FROM cat_tools.objects__address_unsupported_srf()
UNION SELECT 'event trigger'
/*
* pg_identify_object_as_address() returns these as plain "table"/"index",
* and pg_get_object_address() doesn't recognize "partitioned table" or
* "partitioned index" at all, so the round-trip is broken.
*/
UNION SELECT 'partitioned table'
UNION SELECT 'partitioned index'
$$
, 'Verify object_reference.unsupported()'
);
Expand Down
Loading