diff --git a/nix/tests/expected/extensions_sql_interface.out b/nix/tests/expected/extensions_sql_interface.out index 07c0d6650..01f736115 100644 --- a/nix/tests/expected/extensions_sql_interface.out +++ b/nix/tests/expected/extensions_sql_interface.out @@ -76,7 +76,6 @@ order by pg_hashids | t pg_jsonschema | f pg_net | f - pg_partman | f pg_prewarm | t pg_repack | f pg_stat_monitor | t @@ -89,7 +88,6 @@ order by pgaudit | t pgcrypto | t pgjwt | f - pgmq | f pgroonga | f pgroonga_database | f pgrouting | t @@ -123,7 +121,7 @@ order by vector | t wrappers | f xml2 | f -(83 rows) +(81 rows) /* @@ -163,8 +161,8 @@ order by n.nspname, p.proname, pg_catalog.pg_get_function_identity_arguments(p.oid); - extension_name | schema_name | function_name | argument_types | return_type -------------------------+--------------------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + extension_name | schema_name | function_name | argument_types | return_type +------------------------+--------------------------+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- address_standardizer | public | parse_address | text, OUT num text, OUT street text, OUT street2 text, OUT address1 text, OUT city text, OUT state text, OUT zip text, OUT zipplus text, OUT country text | record address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, address text | stdaddr address_standardizer | public | standardize_address | lextab text, gaztab text, rultab text, micro text, macro text | stdaddr @@ -1160,45 +1158,6 @@ order by pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | worker_restart | | boolean - pg_partman | public | apply_cluster | p_parent_schema text, p_parent_tablename text, p_child_schema text, p_child_tablename text | void - pg_partman | public | apply_constraints | p_parent_table text, p_child_table text, p_analyze boolean, p_job_id bigint | void - pg_partman | public | apply_privileges | p_parent_schema text, p_parent_tablename text, p_child_schema text, p_child_tablename text, p_job_id bigint | void - pg_partman | public | autovacuum_off | p_parent_schema text, p_parent_tablename text, p_source_schema text, p_source_tablename text | boolean - pg_partman | public | autovacuum_reset | p_parent_schema text, p_parent_tablename text, p_source_schema text, p_source_tablename text | boolean - pg_partman | public | calculate_time_partition_info | p_time_interval interval, p_start_time timestamp with time zone, p_date_trunc_interval text, OUT base_timestamp timestamp with time zone, OUT datetime_string text | record - pg_partman | public | check_automatic_maintenance_value | p_automatic_maintenance text | boolean - pg_partman | public | check_control_type | p_parent_schema text, p_parent_tablename text, p_control text | TABLE(general_type text, exact_type text) - pg_partman | public | check_default | p_exact_count boolean | SETOF check_default_table - pg_partman | public | check_epoch_type | p_type text | boolean - pg_partman | public | check_name_length | p_object_name text, p_suffix text, p_table_partition boolean | text - pg_partman | public | check_partition_type | p_type text | boolean - pg_partman | public | check_subpart_sameconfig | p_parent_table text | TABLE(sub_control text, sub_partition_interval text, sub_partition_type text, sub_premake integer, sub_automatic_maintenance text, sub_template_table text, sub_retention text, sub_retention_schema text, sub_retention_keep_index boolean, sub_retention_keep_table boolean, sub_epoch text, sub_constraint_cols text[], sub_optimize_constraint integer, sub_infinite_time_partitions boolean, sub_jobmon boolean, sub_inherit_privileges boolean, sub_constraint_valid boolean, sub_date_trunc_interval text, sub_ignore_default_data boolean, sub_default_table boolean, sub_maintenance_order integer, sub_retention_keep_publication boolean) - pg_partman | public | check_subpartition_limits | p_parent_table text, p_type text, OUT sub_min text, OUT sub_max text | record - pg_partman | public | create_parent | p_parent_table text, p_control text, p_interval text, p_type text, p_epoch text, p_premake integer, p_start_partition text, p_default_table boolean, p_automatic_maintenance text, p_constraint_cols text[], p_template_table text, p_jobmon boolean, p_date_trunc_interval text | boolean - pg_partman | public | create_partition_id | p_parent_table text, p_partition_ids bigint[], p_start_partition text | boolean - pg_partman | public | create_partition_time | p_parent_table text, p_partition_times timestamp with time zone[], p_start_partition text | boolean - pg_partman | public | create_sub_parent | p_top_parent text, p_control text, p_interval text, p_type text, p_default_table boolean, p_declarative_check text, p_constraint_cols text[], p_premake integer, p_start_partition text, p_epoch text, p_jobmon boolean, p_date_trunc_interval text | boolean - pg_partman | public | drop_constraints | p_parent_table text, p_child_table text, p_debug boolean | void - pg_partman | public | drop_partition_id | p_parent_table text, p_retention bigint, p_keep_table boolean, p_keep_index boolean, p_retention_schema text | integer - pg_partman | public | drop_partition_time | p_parent_table text, p_retention interval, p_keep_table boolean, p_keep_index boolean, p_retention_schema text, p_reference_timestamp timestamp with time zone | integer - pg_partman | public | dump_partitioned_table_definition | p_parent_table text, p_ignore_template_table boolean | text - pg_partman | public | inherit_replica_identity | p_parent_schemaname text, p_parent_tablename text, p_child_tablename text | void - pg_partman | public | inherit_template_properties | p_parent_table text, p_child_schema text, p_child_tablename text | boolean - pg_partman | public | partition_data_id | p_parent_table text, p_batch_count integer, p_batch_interval bigint, p_lock_wait numeric, p_order text, p_analyze boolean, p_source_table text, p_ignored_columns text[] | bigint - pg_partman | public | partition_data_proc | IN p_parent_table text, IN p_loop_count integer, IN p_interval text, IN p_lock_wait integer, IN p_lock_wait_tries integer, IN p_wait integer, IN p_order text, IN p_source_table text, IN p_ignored_columns text[], IN p_quiet boolean | - pg_partman | public | partition_data_time | p_parent_table text, p_batch_count integer, p_batch_interval interval, p_lock_wait numeric, p_order text, p_analyze boolean, p_source_table text, p_ignored_columns text[] | bigint - pg_partman | public | partition_gap_fill | p_parent_table text | integer - pg_partman | public | reapply_constraints_proc | IN p_parent_table text, IN p_drop_constraints boolean, IN p_apply_constraints boolean, IN p_wait integer, IN p_dryrun boolean | - pg_partman | public | reapply_privileges | p_parent_table text | void - pg_partman | public | run_analyze | IN p_skip_locked boolean, IN p_quiet boolean, IN p_parent_table text | - pg_partman | public | run_maintenance | p_parent_table text, p_analyze boolean, p_jobmon boolean | void - pg_partman | public | run_maintenance_proc | IN p_wait integer, IN p_analyze boolean, IN p_jobmon boolean | - pg_partman | public | show_partition_info | p_child_table text, p_partition_interval text, p_parent_table text, OUT child_start_time timestamp with time zone, OUT child_end_time timestamp with time zone, OUT child_start_id bigint, OUT child_end_id bigint, OUT suffix text | record - pg_partman | public | show_partition_name | p_parent_table text, p_value text, OUT partition_schema text, OUT partition_table text, OUT suffix_timestamp timestamp with time zone, OUT suffix_id bigint, OUT table_exists boolean | record - pg_partman | public | show_partitions | p_parent_table text, p_order text, p_include_default boolean | TABLE(partition_schemaname text, partition_tablename text) - pg_partman | public | stop_sub_partition | p_parent_table text, p_jobmon boolean | boolean - pg_partman | public | undo_partition | p_parent_table text, p_target_table text, p_loop_count integer, p_batch_interval text, p_keep_table boolean, p_lock_wait numeric, p_ignored_columns text[], p_drop_cascade boolean, OUT partitions_undone integer, OUT rows_undone bigint | record - pg_partman | public | undo_partition_proc | IN p_parent_table text, IN p_target_table text, IN p_loop_count integer, IN p_interval text, IN p_keep_table boolean, IN p_lock_wait integer, IN p_lock_wait_tries integer, IN p_wait integer, IN p_ignored_columns text[], IN p_drop_cascade boolean, IN p_quiet boolean | pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void pg_prewarm | public | pg_prewarm | regclass, mode text, fork text, first_block bigint, last_block bigint | bigint @@ -1356,34 +1315,6 @@ order by pgjwt | public | url_decode | data text | bytea pgjwt | public | url_encode | data bytea | text pgjwt | public | verify | token text, secret text, algorithm text | TABLE(header json, payload json, valid boolean) - pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean - pgmq | pgmq | _ensure_pg_partman_installed | | void - pgmq | pgmq | _get_partition_col | partition_interval text | text - pgmq | pgmq | _get_pg_partman_major_version | | integer - pgmq | pgmq | _get_pg_partman_schema | | text - pgmq | pgmq | archive | queue_name text, msg_id bigint | boolean - pgmq | pgmq | archive | queue_name text, msg_ids bigint[] | SETOF bigint - pgmq | pgmq | convert_archive_partitioned | table_name text, partition_interval text, retention_interval text, leading_partition integer | void - pgmq | pgmq | create | queue_name text | void - pgmq | pgmq | create_non_partitioned | queue_name text | void - pgmq | pgmq | create_partitioned | queue_name text, partition_interval text, retention_interval text | void - pgmq | pgmq | create_unlogged | queue_name text | void - pgmq | pgmq | delete | queue_name text, msg_id bigint | boolean - pgmq | pgmq | delete | queue_name text, msg_ids bigint[] | SETOF bigint - pgmq | pgmq | detach_archive | queue_name text | void - pgmq | pgmq | drop_queue | queue_name text, partitioned boolean | boolean - pgmq | pgmq | format_table_name | queue_name text, prefix text | text - pgmq | pgmq | list_queues | | SETOF pgmq.queue_record - pgmq | pgmq | metrics | queue_name text | pgmq.metrics_result - pgmq | pgmq | metrics_all | | SETOF pgmq.metrics_result - pgmq | pgmq | pop | queue_name text | SETOF pgmq.message_record - pgmq | pgmq | purge_queue | queue_name text | bigint - pgmq | pgmq | read | queue_name text, vt integer, qty integer | SETOF pgmq.message_record - pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer | SETOF pgmq.message_record - pgmq | pgmq | send | queue_name text, msg jsonb, delay integer | SETOF bigint - pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay integer | SETOF bigint - pgmq | pgmq | set_vt | queue_name text, msg_id bigint, vt integer | SETOF pgmq.message_record - pgmq | pgmq | validate_queue_name | queue_name text | void pgroonga | pgroonga | command | groongacommand text | text pgroonga | pgroonga | command | groongacommand text, arguments text[] | text pgroonga | pgroonga | command_escape_value | value text | text @@ -5234,7 +5165,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5069 rows) +(5002 rows) /* @@ -5317,61 +5248,6 @@ order by pg_net | net | http_request_queue | method pg_net | net | http_request_queue | timeout_milliseconds pg_net | net | http_request_queue | url - pg_partman | public | part_config | automatic_maintenance - pg_partman | public | part_config | constraint_cols - pg_partman | public | part_config | constraint_valid - pg_partman | public | part_config | control - pg_partman | public | part_config | date_trunc_interval - pg_partman | public | part_config | datetime_string - pg_partman | public | part_config | default_table - pg_partman | public | part_config | epoch - pg_partman | public | part_config | ignore_default_data - pg_partman | public | part_config | infinite_time_partitions - pg_partman | public | part_config | inherit_privileges - pg_partman | public | part_config | jobmon - pg_partman | public | part_config | maintenance_last_run - pg_partman | public | part_config | maintenance_order - pg_partman | public | part_config | optimize_constraint - pg_partman | public | part_config | parent_table - pg_partman | public | part_config | partition_interval - pg_partman | public | part_config | partition_type - pg_partman | public | part_config | premake - pg_partman | public | part_config | retention - pg_partman | public | part_config | retention_keep_index - pg_partman | public | part_config | retention_keep_publication - pg_partman | public | part_config | retention_keep_table - pg_partman | public | part_config | retention_schema - pg_partman | public | part_config | sub_partition_set_full - pg_partman | public | part_config | template_table - pg_partman | public | part_config | undo_in_progress - pg_partman | public | part_config_sub | sub_automatic_maintenance - pg_partman | public | part_config_sub | sub_constraint_cols - pg_partman | public | part_config_sub | sub_constraint_valid - pg_partman | public | part_config_sub | sub_control - pg_partman | public | part_config_sub | sub_date_trunc_interval - pg_partman | public | part_config_sub | sub_default_table - pg_partman | public | part_config_sub | sub_epoch - pg_partman | public | part_config_sub | sub_ignore_default_data - pg_partman | public | part_config_sub | sub_infinite_time_partitions - pg_partman | public | part_config_sub | sub_inherit_privileges - pg_partman | public | part_config_sub | sub_jobmon - pg_partman | public | part_config_sub | sub_maintenance_order - pg_partman | public | part_config_sub | sub_optimize_constraint - pg_partman | public | part_config_sub | sub_parent - pg_partman | public | part_config_sub | sub_partition_interval - pg_partman | public | part_config_sub | sub_partition_type - pg_partman | public | part_config_sub | sub_premake - pg_partman | public | part_config_sub | sub_retention - pg_partman | public | part_config_sub | sub_retention_keep_index - pg_partman | public | part_config_sub | sub_retention_keep_publication - pg_partman | public | part_config_sub | sub_retention_keep_table - pg_partman | public | part_config_sub | sub_retention_schema - pg_partman | public | part_config_sub | sub_template_table - pg_partman | public | table_privs | grantee - pg_partman | public | table_privs | grantor - pg_partman | public | table_privs | privilege_type - pg_partman | public | table_privs | table_name - pg_partman | public | table_privs | table_schema pg_repack | repack | primary_keys | indexrelid pg_repack | repack | primary_keys | indrelid pg_repack | repack | tables | alter_col_storage @@ -5512,10 +5388,6 @@ order by pg_tle | pgtle | feature_info | obj_identity pg_tle | pgtle | feature_info | proname pg_tle | pgtle | feature_info | schema_name - pgmq | pgmq | meta | created_at - pgmq | pgmq | meta | is_partitioned - pgmq | pgmq | meta | is_unlogged - pgmq | pgmq | meta | queue_name pgsodium | pgsodium | decrypted_key | associated_data pgsodium | pgsodium | decrypted_key | comment pgsodium | pgsodium | decrypted_key | created @@ -6409,5 +6281,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(1141 rows) +(1082 rows) diff --git a/nix/tests/expected/pg_partman.out b/nix/tests/expected/pg_partman.out deleted file mode 100644 index 25aa80d2e..000000000 --- a/nix/tests/expected/pg_partman.out +++ /dev/null @@ -1,104 +0,0 @@ -create schema if not exists partman_test; -/* -Simple Time Based: 1 Partition Per Day - -For native partitioning, you must start with a parent table that has already been set up to be partitioned in the desired type. Currently pg_partman only supports the RANGE type of partitioning (both for time & id). You cannot turn a non-partitioned table into the parent table of a partitioned set, which can make migration a challenge. This document will show you some techniques for how to manage this later. For now, we will start with a brand new table in this example. Any non-unique indexes can also be added to the parent table in PG11+ and they will automatically be created on all child tables. -*/ -create table partman_test.time_taptest_table( - col1 int, - col2 text default 'stuff', - col3 timestamptz not null default now() -) - partition by range (col3); -create index on partman_test.time_tap (col3); -ERROR: relation "partman_test.time_tap" does not exist -/* -Unique indexes (including primary keys) cannot be created on a natively partitioned parent unless they include the partition key. For time-based partitioning that generally doesn't work out since that would limit only a single timestamp value in each child table. pg_partman helps to manage this by using a template table to manage properties that currently are not supported by native partitioning. Note that this does not solve the issue of the constraint not being enforced across the entire partition set. See the main documentation to see which properties are managed by the template. - -Manually create the template table first so that when we run create_parent() the initial child tables that are created will have a primary key. If you do not supply a template table to pg_partman, it will create one for you in the schema that you installed the extension to. However properties you add to that template are only then applied to newly created child tables after that point. You will have to retroactively apply those properties manually to any child tables that already existed. -*/ -create table partman_test.time_taptest_table_template (like partman_test.time_taptest_table); -alter table partman_test.time_taptest_table_template add primary key (col1); -/* -Review tables in the partman_test schema -*/ -select - table_name, - table_type -from - information_schema.tables -where - table_schema = 'partman_test' -order by - table_name, - table_type; - table_name | table_type ------------------------------+------------ - time_taptest_table | BASE TABLE - time_taptest_table_template | BASE TABLE -(2 rows) - -select public.create_parent( - p_parent_table := 'partman_test.time_taptest_table', - p_control := 'col3', - p_interval := '1 day', - p_template_table := 'partman_test.time_taptest_table_template' -); - create_parent ---------------- - t -(1 row) - -/* -Review tables in the partman_test schema, which should now include daily partitions -*/ -select - -- dates in partition names are variable, so reduced to the prefix - substring(table_name, 1, 21) as table_prefix, - table_type -from - information_schema.tables -where - table_schema = 'partman_test' -order by - table_name; - table_prefix | table_type ------------------------+------------ - time_taptest_table | BASE TABLE - time_taptest_table_de | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_p2 | BASE TABLE - time_taptest_table_te | BASE TABLE -(12 rows) - -/* -Confirm maintenance proc runs without issue -*/ -call public.run_maintenance_proc(); -/* -Make sure the background worker is NOT enabled. -This is intentional. We document using pg_cron to schedule calls to -public.run_maintenance_proc(). That is consistent with other providers. -*/ -select - application_name -from - pg_stat_activity -where - application_name = 'pg_partman_bgw'; - application_name ------------------- -(0 rows) - --- Cleanup -drop schema partman_test cascade; -NOTICE: drop cascades to 2 other objects -DETAIL: drop cascades to table partman_test.time_taptest_table -drop cascades to table partman_test.time_taptest_table_template diff --git a/nix/tests/expected/pgmq.out b/nix/tests/expected/pgmq.out deleted file mode 100644 index b2886d9fa..000000000 --- a/nix/tests/expected/pgmq.out +++ /dev/null @@ -1,143 +0,0 @@ --- Test the standard flow -select - pgmq.create('Foo'); - create --------- - -(1 row) - -select - * -from - pgmq.send( - queue_name:='Foo', - msg:='{"foo": "bar1"}' - ); - send ------- - 1 -(1 row) - --- Test queue is not case sensitive -select - msg_id, - read_ct, - message -from - pgmq.send( - queue_name:='foo', -- note: lowercase useage - msg:='{"foo": "bar2"}', - delay:=5 - ); -ERROR: column "msg_id" does not exist -LINE 2: msg_id, - ^ -select - msg_id, - read_ct, - message -from - pgmq.read( - queue_name:='Foo', - vt:=30, - qty:=2 - ); - msg_id | read_ct | message ---------+---------+----------------- - 1 | 1 | {"foo": "bar1"} -(1 row) - -select - msg_id, - read_ct, - message -from - pgmq.pop('Foo'); - msg_id | read_ct | message ---------+---------+--------- -(0 rows) - --- Archive message with msg_id=2. -select - pgmq.archive( - queue_name:='Foo', - msg_id:=2 - ); - archive ---------- - f -(1 row) - -select - pgmq.create('my_queue'); - create --------- - -(1 row) - -select - pgmq.send_batch( - queue_name:='my_queue', - msgs:=array['{"foo": "bar3"}','{"foo": "bar4"}','{"foo": "bar5"}']::jsonb[] -); - send_batch ------------- - 1 - 2 - 3 -(3 rows) - -select - pgmq.archive( - queue_name:='my_queue', - msg_ids:=array[3, 4, 5] - ); - archive ---------- - 3 -(1 row) - -select - pgmq.delete('my_queue', 6); - delete --------- - f -(1 row) - -select - pgmq.drop_queue('my_queue'); - drop_queue ------------- - t -(1 row) - -select - pgmq.create_partitioned( - 'my_partitioned_queue', - '5 seconds', - '10 seconds' -); - create_partitioned --------------------- - -(1 row) - --- Make sure SQLI enabling characters are blocked -select pgmq.create('F--oo'); -ERROR: queue name contains invalid characters: $, ;, --, or \' -CONTEXT: PL/pgSQL function pgmq.format_table_name(text,text) line 5 at RAISE -PL/pgSQL function pgmq.create_non_partitioned(text) line 3 during statement block local variable initialization -SQL statement "SELECT pgmq.create_non_partitioned(queue_name)" -PL/pgSQL function pgmq."create"(text) line 3 at PERFORM -select pgmq.create('F$oo'); -ERROR: queue name contains invalid characters: $, ;, --, or \' -CONTEXT: PL/pgSQL function pgmq.format_table_name(text,text) line 5 at RAISE -PL/pgSQL function pgmq.create_non_partitioned(text) line 3 during statement block local variable initialization -SQL statement "SELECT pgmq.create_non_partitioned(queue_name)" -PL/pgSQL function pgmq."create"(text) line 3 at PERFORM -select pgmq.create($$F'oo$$); -ERROR: queue name contains invalid characters: $, ;, --, or \' -CONTEXT: PL/pgSQL function pgmq.format_table_name(text,text) line 5 at RAISE -PL/pgSQL function pgmq.create_non_partitioned(text) line 3 during statement block local variable initialization -SQL statement "SELECT pgmq.create_non_partitioned(queue_name)" -PL/pgSQL function pgmq."create"(text) line 3 at PERFORM diff --git a/nix/tests/prime.sql b/nix/tests/prime.sql index 3891817e1..09fa8b273 100644 --- a/nix/tests/prime.sql +++ b/nix/tests/prime.sql @@ -43,7 +43,7 @@ create extension pg_graphql; create extension pg_freespacemap; create extension pg_hashids; create extension pg_prewarm; -create extension pg_partman; +-- create extension pg_partman; create extension pg_jsonschema; create extension pg_repack; create extension pg_stat_monitor; @@ -55,7 +55,7 @@ create extension pg_visibility; create extension pg_walinspect; create extension pgaudit; create extension pgcrypto; -create extension pgmq; +-- create extension pgmq; create extension pgtap; create extension pgjwt; create extension pgroonga; diff --git a/nix/tests/sql/pg_partman.sql b/nix/tests/sql/pg_partman.sql deleted file mode 100644 index d1fb9f4ba..000000000 --- a/nix/tests/sql/pg_partman.sql +++ /dev/null @@ -1,85 +0,0 @@ -create schema if not exists partman_test; - -/* -Simple Time Based: 1 Partition Per Day - -For native partitioning, you must start with a parent table that has already been set up to be partitioned in the desired type. Currently pg_partman only supports the RANGE type of partitioning (both for time & id). You cannot turn a non-partitioned table into the parent table of a partitioned set, which can make migration a challenge. This document will show you some techniques for how to manage this later. For now, we will start with a brand new table in this example. Any non-unique indexes can also be added to the parent table in PG11+ and they will automatically be created on all child tables. -*/ - -create table partman_test.time_taptest_table( - col1 int, - col2 text default 'stuff', - col3 timestamptz not null default now() -) - partition by range (col3); - -create index on partman_test.time_tap (col3); - -/* -Unique indexes (including primary keys) cannot be created on a natively partitioned parent unless they include the partition key. For time-based partitioning that generally doesn't work out since that would limit only a single timestamp value in each child table. pg_partman helps to manage this by using a template table to manage properties that currently are not supported by native partitioning. Note that this does not solve the issue of the constraint not being enforced across the entire partition set. See the main documentation to see which properties are managed by the template. - -Manually create the template table first so that when we run create_parent() the initial child tables that are created will have a primary key. If you do not supply a template table to pg_partman, it will create one for you in the schema that you installed the extension to. However properties you add to that template are only then applied to newly created child tables after that point. You will have to retroactively apply those properties manually to any child tables that already existed. -*/ - -create table partman_test.time_taptest_table_template (like partman_test.time_taptest_table); - -alter table partman_test.time_taptest_table_template add primary key (col1); - -/* -Review tables in the partman_test schema -*/ - -select - table_name, - table_type -from - information_schema.tables -where - table_schema = 'partman_test' -order by - table_name, - table_type; - - -select public.create_parent( - p_parent_table := 'partman_test.time_taptest_table', - p_control := 'col3', - p_interval := '1 day', - p_template_table := 'partman_test.time_taptest_table_template' -); - -/* -Review tables in the partman_test schema, which should now include daily partitions -*/ - -select - -- dates in partition names are variable, so reduced to the prefix - substring(table_name, 1, 21) as table_prefix, - table_type -from - information_schema.tables -where - table_schema = 'partman_test' -order by - table_name; - - -/* -Confirm maintenance proc runs without issue -*/ -call public.run_maintenance_proc(); - -/* -Make sure the background worker is NOT enabled. -This is intentional. We document using pg_cron to schedule calls to -public.run_maintenance_proc(). That is consistent with other providers. -*/ -select - application_name -from - pg_stat_activity -where - application_name = 'pg_partman_bgw'; - --- Cleanup -drop schema partman_test cascade; diff --git a/nix/tests/sql/pgmq.sql b/nix/tests/sql/pgmq.sql deleted file mode 100644 index 4d4045484..000000000 --- a/nix/tests/sql/pgmq.sql +++ /dev/null @@ -1,89 +0,0 @@ --- Test the standard flow -select - pgmq.create('Foo'); - -select - * -from - pgmq.send( - queue_name:='Foo', - msg:='{"foo": "bar1"}' - ); - --- Test queue is not case sensitive -select - msg_id, - read_ct, - message -from - pgmq.send( - queue_name:='foo', -- note: lowercase useage - msg:='{"foo": "bar2"}', - delay:=5 - ); - -select - msg_id, - read_ct, - message -from - pgmq.read( - queue_name:='Foo', - vt:=30, - qty:=2 - ); - -select - msg_id, - read_ct, - message -from - pgmq.pop('Foo'); - - --- Archive message with msg_id=2. -select - pgmq.archive( - queue_name:='Foo', - msg_id:=2 - ); - - -select - pgmq.create('my_queue'); - -select - pgmq.send_batch( - queue_name:='my_queue', - msgs:=array['{"foo": "bar3"}','{"foo": "bar4"}','{"foo": "bar5"}']::jsonb[] -); - -select - pgmq.archive( - queue_name:='my_queue', - msg_ids:=array[3, 4, 5] - ); - -select - pgmq.delete('my_queue', 6); - - -select - pgmq.drop_queue('my_queue'); - -select - pgmq.create_partitioned( - 'my_partitioned_queue', - '5 seconds', - '10 seconds' -); - - --- Make sure SQLI enabling characters are blocked -select pgmq.create('F--oo'); -select pgmq.create('F$oo'); -select pgmq.create($$F'oo$$); - - - -