From a12c86ea7010e75960acca296d7981717b8327df Mon Sep 17 00:00:00 2001 From: Ajin Cherian Date: Mon, 13 Mar 2023 23:52:10 -0400 Subject: [PATCH v80 4/8] Introduce the test_ddl_deparse_regress test module. This testing module aims to achieve the following four testing goals for the DDL deparser: 1. Test that the generated JSON blob is expected using SQL tests. 2. Test that the re-formed DDL command is expected using SQL tests. 3. Test that the re-formed DDL command has the same effect as the original command by comparing the results of pg_dump, using the SQL tests in 1 and 2. 4. Test that new DDL syntax is handled by the DDL deparser by capturing and deparing DDL commands ran by pg_regress. 1 and 2 is tested with SQL tests, by printing the deparsed JSON blob and the re-formed command. Goal 3 is tested with TAP framework in t/001_compare_dumped_results.pl, see README for details. Goal 4 is tested with TAP framework and pg_regress in 002_regress_tests.pl, the execution is currently commented out because it will fail due unimplemented commands in the DDL deparser. Test coverage is added for: CREATE TABLE ALTER TABLE column constraints/table constraints --- src/test/modules/Makefile | 1 + .../modules/test_ddl_deparse_regress/.gitignore | 4 + src/test/modules/test_ddl_deparse_regress/Makefile | 46 + .../modules/test_ddl_deparse_regress/README.md | 38 + .../expected/aggregate.out | 8 + .../expected/alter_table.out | 924 +++++++++++++++++++++ .../expected/constraints.out | 638 ++++++++++++++ .../expected/create_extension.out | 6 + .../expected/create_schema.out | 22 + .../expected/create_table.out | 599 +++++++++++++ .../expected/test_ddl_deparse.out | 20 + .../modules/test_ddl_deparse_regress/meson.build | 45 + .../test_ddl_deparse_regress/sql/aggregate.sql | 7 + .../test_ddl_deparse_regress/sql/alter_table.sql | 524 ++++++++++++ .../test_ddl_deparse_regress/sql/constraints.sql | 385 +++++++++ .../sql/create_extension.sql | 5 + .../test_ddl_deparse_regress/sql/create_schema.sql | 16 + .../test_ddl_deparse_regress/sql/create_table.sql | 417 ++++++++++ .../sql/test_ddl_deparse.sql | 23 + .../t/001_compare_dumped_results.pl | 211 +++++ .../t/002_regress_tests.pl | 207 +++++ .../test_ddl_deparse_regress--1.0.sql | 9 + .../test_ddl_deparse_regress.c | 59 ++ .../test_ddl_deparse_regress.control | 4 + 24 files changed, 4218 insertions(+) create mode 100644 src/test/modules/test_ddl_deparse_regress/.gitignore create mode 100644 src/test/modules/test_ddl_deparse_regress/Makefile create mode 100644 src/test/modules/test_ddl_deparse_regress/README.md create mode 100644 src/test/modules/test_ddl_deparse_regress/expected/aggregate.out create mode 100644 src/test/modules/test_ddl_deparse_regress/expected/alter_table.out create mode 100644 src/test/modules/test_ddl_deparse_regress/expected/constraints.out create mode 100644 src/test/modules/test_ddl_deparse_regress/expected/create_extension.out create mode 100644 src/test/modules/test_ddl_deparse_regress/expected/create_schema.out create mode 100644 src/test/modules/test_ddl_deparse_regress/expected/create_table.out create mode 100644 src/test/modules/test_ddl_deparse_regress/expected/test_ddl_deparse.out create mode 100644 src/test/modules/test_ddl_deparse_regress/meson.build create mode 100644 src/test/modules/test_ddl_deparse_regress/sql/aggregate.sql create mode 100644 src/test/modules/test_ddl_deparse_regress/sql/alter_table.sql create mode 100644 src/test/modules/test_ddl_deparse_regress/sql/constraints.sql create mode 100644 src/test/modules/test_ddl_deparse_regress/sql/create_extension.sql create mode 100644 src/test/modules/test_ddl_deparse_regress/sql/create_schema.sql create mode 100644 src/test/modules/test_ddl_deparse_regress/sql/create_table.sql create mode 100644 src/test/modules/test_ddl_deparse_regress/sql/test_ddl_deparse.sql create mode 100644 src/test/modules/test_ddl_deparse_regress/t/001_compare_dumped_results.pl create mode 100644 src/test/modules/test_ddl_deparse_regress/t/002_regress_tests.pl create mode 100644 src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress--1.0.sql create mode 100644 src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress.c create mode 100644 src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress.control diff --git a/src/test/modules/Makefile b/src/test/modules/Makefile index c629cbe..c272c64 100644 --- a/src/test/modules/Makefile +++ b/src/test/modules/Makefile @@ -18,6 +18,7 @@ SUBDIRS = \ test_copy_callbacks \ test_custom_rmgrs \ test_ddl_deparse \ + test_ddl_deparse_regress \ test_extensions \ test_ginpostinglist \ test_integerset \ diff --git a/src/test/modules/test_ddl_deparse_regress/.gitignore b/src/test/modules/test_ddl_deparse_regress/.gitignore new file mode 100644 index 0000000..5dcb3ff --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/.gitignore @@ -0,0 +1,4 @@ +# Generated subdirectories +/log/ +/results/ +/tmp_check/ diff --git a/src/test/modules/test_ddl_deparse_regress/Makefile b/src/test/modules/test_ddl_deparse_regress/Makefile new file mode 100644 index 0000000..84cc108 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/Makefile @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------- +# +# Makefile for src/test/modules/test_ddl_deparse_regress +# +# Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/test/modules/test_ddl_deparse_regress/Makefile +# +#------------------------------------------------------------------------- + + +MODULES = test_ddl_deparse_regress +PGFILEDESC = "test_ddl_deparse_regress - regression testing for DDL deparsing" + +EXTENSION = test_ddl_deparse_regress +DATA = test_ddl_deparse_regress--1.0.sql + +# test_ddl_deparse must be first +REGRESS = test_ddl_deparse \ + create_extension \ + create_schema \ + aggregate \ + create_table \ + constraints \ + alter_table + +export REGRESS + +EXTRA_INSTALL = contrib/pg_stat_statements + +TAP_TESTS = 1 + +ifdef USE_PGXS +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) +else +subdir = src/test/modules/test_ddl_deparse_regress +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global +include $(top_srcdir)/contrib/contrib-global.mk +endif + +REGRESS_SHLIB=$(abs_top_builddir)/src/test/regress/regress$(DLSUFFIX) +export REGRESS_SHLIB diff --git a/src/test/modules/test_ddl_deparse_regress/README.md b/src/test/modules/test_ddl_deparse_regress/README.md new file mode 100644 index 0000000..e261319 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/README.md @@ -0,0 +1,38 @@ +# Testing harness for DDL deparser + +## Testing goals + +DDL Deparser provides the ability to encode the original DDL command to a JSON string, then decode it to a fully schema-qualified DDL command which is supposed to have the same effect as the original command. This testing module aims to achieve the following four testing for the DDL deparser: + +1. Test that the generated JSON blob is expected using SQL tests. +2. Test that the re-formed DDL command is expected using SQL tests. +3. Test that the re-formed DDL command has the same effect as the original command + by comparing the results of pg_dump, using the SQL tests in 1 and 2. +4. Test that new DDL syntax is handled by the DDL deparser by capturing and deparing + DDL commands ran by pg_regress. + +1 and 2 is tested with SQL tests, by noticing the deparsed JSON blob and the re-formed command. + +Goal 3 is tested with TAP framework in t/001_compare_dumped_results.pl + +Goal 4 is tested with TAP framework and pg_regress in 002_regress_tests.pl (Not enabled) + +## Usage + +Run `make check`, it will run the SQL tests first, then it will run the TAP tests. The execution of 002_regress_tests.pl is currently commented out because it will fail due to unimplemented commands in the DDL deparser. + +## How to add more test cases and find out the failure? + +You can add test cases to existed files in `sql` folder directly. If you need to create a new test file, you can create a file in `sql` folder, add that test file name to `meson.build` and `Makefile` following the convention used by other test files. + +After you have added you test cases, run `make check` and check goal 1 and goal 2 of the added test cases in `results` folder, if the result is right, copy that file to `expected` folder. + +Now SQL tests should pass, run `make check` again to check the TAP tests. If everything passed, this test case also meet goal 3. If it fails, check the error message to locate the failure position. + +You can find execution logs are in `tmp_check/log` folder, dumped results are in `tmp_check/dumps` folder, reformed sql commands are in `tmp_check/ddl` folder for further investigation. + + + + + + diff --git a/src/test/modules/test_ddl_deparse_regress/expected/aggregate.out b/src/test/modules/test_ddl_deparse_regress/expected/aggregate.out new file mode 100644 index 0000000..1e19a7c --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/expected/aggregate.out @@ -0,0 +1,8 @@ +CREATE AGGREGATE newavg(int4) ( + sfunc = int4_avg_accum, stype = _int8, + finalfunc = int8_avg, + initcond1 = '{0,0}' +); +NOTICE: deparsed json: {"fmt": "CREATE AGGREGATE %{identity}D (%{types}s) (%{elems:, }s)", "elems": [{"fmt": "SFUNC=%{procedure}D", "procedure": {"objname": "int4_avg_accum", "schemaname": "pg_catalog"}}, {"fmt": "STYPE=%{type}T", "type": {"typmod": "", "typarray": true, "typename": "int8", "schemaname": "pg_catalog"}}, {"fmt": "SSPACE=", "present": false}, {"fmt": "FINALFUNC= %{procedure}D", "procedure": {"objname": "int8_avg", "schemaname": "pg_catalog"}}, {"fmt": "FINALFUNC_EXTRA=", "present": false}, {"fmt": "INITCOND= %{initval}L", "initval": "{0,0}"}, {"fmt": "MSFUNC=", "present": false}, {"fmt": "MSTYPE=", "present": false}, {"fmt": "MSSPACE=", "present": false}, {"fmt": "MINVFUNC=", "present": false}, {"fmt": "MFINALFUNC=", "present": false}, {"fmt": "MFINALFUNC_EXTRA=", "present": false}, {"fmt": "MINITCOND=", "present": false}, {"fmt": "HYPOTHETICAL=", "present": false}, {"fmt": "SORTOP=", "present": false}], "types": {"fmt": "%{direct:, }s", "direct": [{"fmt": "%{mode}s %{name}s %{type}T", "mode": "", "name": "", "type": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}}]}, "identity": {"objname": "newavg", "schemaname": "public"}} +NOTICE: re-formed command: CREATE AGGREGATE public.newavg ( pg_catalog.int4) (SFUNC=pg_catalog.int4_avg_accum, STYPE=pg_catalog.int8[], FINALFUNC= pg_catalog.int8_avg, INITCOND= '{0,0}') +DROP AGGREGATE newavg(int4); diff --git a/src/test/modules/test_ddl_deparse_regress/expected/alter_table.out b/src/test/modules/test_ddl_deparse_regress/expected/alter_table.out new file mode 100644 index 0000000..7537b2a --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/expected/alter_table.out @@ -0,0 +1,924 @@ +-- parent table defintion +CREATE TABLE orders( + id int, + name varchar, + description text, + price float4, + quantity int, + purchase_date date +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "orders", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.orders (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +-- ALTER TABLE [ IF EXISTS ] [ ONLY ] name [ * ] +-- action [, ... ] +CREATE TABLE parent_table( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "parent_table", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.parent_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +CREATE TABLE test_only () INHERITS (parent_table); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D () %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_only", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": [{"objname": "parent_table", "schemaname": "public"}]}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE TABLE public.test_only () INHERITS (public.parent_table) +ALTER TABLE test_only ADD col1 int; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD %{objtype}s %{if_not_exists}s %{definition}s", "type": "add column", "objtype": "COLUMN", "definition": {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col1", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, "if_not_exists": ""}], "identity": {"objname": "test_only", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_only ADD COLUMN col1 pg_catalog.int4 STORAGE plain +ALTER TABLE IF EXISTS fake_table ADD col2 int; +NOTICE: relation "fake_table" does not exist, skipping +-- ALTER TABLE IF EXISTS ONLY parent_table ADD PRIMARY KEY (id); +ALTER TABLE IF EXISTS parent_table * ADD CHECK (id > 10); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "parent_table_id_check", "type": "add constraint", "definition": "CHECK ((id OPERATOR(pg_catalog.>) 10))"}], "identity": {"objname": "parent_table", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.parent_table ADD CONSTRAINT parent_table_id_check CHECK ((id OPERATOR(pg_catalog.>) 10)) +-- ADD [ COLUMN ] [ IF NOT EXISTS ] column_name data_type [ COLLATE collation ] [ column_constraint [ ... ] ] +CREATE TABLE test_add_column( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_add_column", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_add_column (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_add_column ADD col1 int; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD %{objtype}s %{if_not_exists}s %{definition}s", "type": "add column", "objtype": "COLUMN", "definition": {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col1", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, "if_not_exists": ""}], "identity": {"objname": "test_add_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_column ADD COLUMN col1 pg_catalog.int4 STORAGE plain +ALTER TABLE test_add_column ADD COLUMN col2 int; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD %{objtype}s %{if_not_exists}s %{definition}s", "type": "add column", "objtype": "COLUMN", "definition": {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, "if_not_exists": ""}], "identity": {"objname": "test_add_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_column ADD COLUMN col2 pg_catalog.int4 STORAGE plain +ALTER TABLE test_add_column ADD COLUMN IF NOT EXISTS col2 varchar; +NOTICE: column "col2" of relation "test_add_column" already exists, skipping +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD %{objtype}s %{if_not_exists}s %{definition}s", "type": "add column", "objtype": "COLUMN", "definition": {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, "if_not_exists": "IF NOT EXISTS"}], "identity": {"objname": "test_add_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_column ADD COLUMN IF NOT EXISTS col2 pg_catalog.int4 STORAGE plain +ALTER TABLE test_add_column ADD col3 varchar COLLATE "fr_FR"; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD %{objtype}s %{if_not_exists}s %{definition}s", "type": "add column", "objtype": "COLUMN", "definition": {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col3", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "fr_FR", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, "if_not_exists": ""}], "identity": {"objname": "test_add_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_column ADD COLUMN col3 pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."fr_FR" +ALTER TABLE test_add_column ADD col4 int CHECK (col4 > 100) UNIQUE; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD %{objtype}s %{if_not_exists}s %{definition}s", "type": "add column", "objtype": "COLUMN", "definition": {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col4", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, "if_not_exists": ""}, {"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "test_add_column_col4_key", "type": "add constraint", "definition": "UNIQUE (col4)"}, {"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "test_add_column_col4_check", "type": "add constraint", "definition": "CHECK ((col4 OPERATOR(pg_catalog.>) 100))"}], "identity": {"objname": "test_add_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_column ADD COLUMN col4 pg_catalog.int4 STORAGE plain , ADD CONSTRAINT test_add_column_col4_key UNIQUE (col4), ADD CONSTRAINT test_add_column_col4_check CHECK ((col4 OPERATOR(pg_catalog.>) 100)) +ALTER TABLE test_add_column ADD COLUMN IF NOT EXISTS col5 text COLLATE "es_ES" DEFAULT 'foo' NOT NULL; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD %{objtype}s %{if_not_exists}s %{definition}s", "type": "add column", "objtype": "COLUMN", "definition": {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col5", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT %{default}s", "default": "'foo'::pg_catalog.text"}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "es_ES", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, "if_not_exists": "IF NOT EXISTS"}], "identity": {"objname": "test_add_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_column ADD COLUMN IF NOT EXISTS col5 pg_catalog.text STORAGE extended COLLATE pg_catalog."es_ES" NOT NULL DEFAULT 'foo'::pg_catalog.text +-- DROP [ COLUMN ] [ IF EXISTS ] column_name [ RESTRICT | CASCADE ] +CREATE TABLE test_drop_column( + LIKE orders, + UNIQUE (id), + UNIQUE (name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_drop_column", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_drop_column_id_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id)"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_drop_column_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (name)"}]} +NOTICE: re-formed command: CREATE TABLE public.test_drop_column (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , CONSTRAINT test_drop_column_id_key UNIQUE (id), CONSTRAINT test_drop_column_name_key UNIQUE (name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE foreign_table( + id int REFERENCES test_drop_column (id), + name varchar REFERENCES test_drop_column (name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "foreign_table", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.foreign_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "foreign_table_id_fkey", "type": "add constraint", "definition": "FOREIGN KEY (id) REFERENCES public.test_drop_column(id)"}, {"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "foreign_table_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.test_drop_column(name)"}], "identity": {"objname": "foreign_table", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.foreign_table ADD CONSTRAINT foreign_table_id_fkey FOREIGN KEY (id) REFERENCES public.test_drop_column(id), ADD CONSTRAINT foreign_table_name_fkey FOREIGN KEY (name) REFERENCES public.test_drop_column(name) +ALTER TABLE test_drop_column DROP price; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "DROP %{objtype}s %{if_exists}s %{column}I %{cascade}s", "type": "drop column", "column": "price", "cascade": {"fmt": "CASCADE", "present": false}, "objtype": "COLUMN", "if_exists": ""}], "identity": {"objname": "test_drop_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_column DROP COLUMN price +ALTER TABLE test_drop_column DROP COLUMN quantity; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "DROP %{objtype}s %{if_exists}s %{column}I %{cascade}s", "type": "drop column", "column": "quantity", "cascade": {"fmt": "CASCADE", "present": false}, "objtype": "COLUMN", "if_exists": ""}], "identity": {"objname": "test_drop_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_column DROP COLUMN quantity +ALTER TABLE test_drop_column DROP IF EXISTS description RESTRICT; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "DROP %{objtype}s %{if_exists}s %{column}I %{cascade}s", "type": "drop column", "column": "description", "cascade": {"fmt": "CASCADE", "present": false}, "objtype": "COLUMN", "if_exists": "IF EXISTS"}], "identity": {"objname": "test_drop_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_column DROP COLUMN IF EXISTS description +-- TOFIX +-- ALTER TABLE test_drop_column DROP IF EXISTS name CASCADE; +-- ALTER [ COLUMN ] column_name [ SET DATA ] TYPE data_type [ COLLATE collation ] [ USING expression ] +CREATE TABLE test_alter_type( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_alter_type", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_alter_type (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_alter_type ALTER price TYPE int; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER %{objtype}s %{column}I SET DATA TYPE %{datatype}T %{collation}s %{using}s", "type": "alter column type", "using": {"fmt": "USING", "present": false}, "column": "price", "objtype": "COLUMN", "datatype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE", "present": false}}], "identity": {"objname": "test_alter_type", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_type ALTER COLUMN price SET DATA TYPE pg_catalog.int4 +ALTER TABLE test_alter_type ALTER COLUMN purchase_date TYPE text COLLATE "fr_FR"; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER %{objtype}s %{column}I SET DATA TYPE %{datatype}T %{collation}s %{using}s", "type": "alter column type", "using": {"fmt": "USING", "present": false}, "column": "purchase_date", "objtype": "COLUMN", "datatype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "fr_FR", "schemaname": "pg_catalog"}}}], "identity": {"objname": "test_alter_type", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_type ALTER COLUMN purchase_date SET DATA TYPE pg_catalog.text COLLATE pg_catalog."fr_FR" +ALTER TABLE test_alter_type ALTER COLUMN quantity SET DATA TYPE float4; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER %{objtype}s %{column}I SET DATA TYPE %{datatype}T %{collation}s %{using}s", "type": "alter column type", "using": {"fmt": "USING", "present": false}, "column": "quantity", "objtype": "COLUMN", "datatype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE", "present": false}}], "identity": {"objname": "test_alter_type", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_type ALTER COLUMN quantity SET DATA TYPE pg_catalog.float4 +ALTER TABLE test_alter_type ALTER name TYPE int USING id::integer; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER %{objtype}s %{column}I SET DATA TYPE %{datatype}T %{collation}s %{using}s", "type": "alter column type", "using": {"fmt": "USING %{expression}s", "expression": "id"}, "column": "name", "objtype": "COLUMN", "datatype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE", "present": false}}], "identity": {"objname": "test_alter_type", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_type ALTER COLUMN name SET DATA TYPE pg_catalog.int4 USING id +-- ALTER [ COLUMN ] column_name SET DEFAULT expression +CREATE TABLE test_alter_set_default( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_alter_set_default", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_alter_set_default (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_alter_set_default ALTER price SET DEFAULT 100; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET DEFAULT %{definition}s", "type": "set default", "column": "price", "definition": "100"}], "identity": {"objname": "test_alter_set_default", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_set_default ALTER COLUMN price SET DEFAULT 100 +ALTER TABLE test_alter_set_default ALTER COLUMN quantity SET DEFAULT 10; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET DEFAULT %{definition}s", "type": "set default", "column": "quantity", "definition": "10"}], "identity": {"objname": "test_alter_set_default", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_set_default ALTER COLUMN quantity SET DEFAULT 10 +-- ALTER [ COLUMN ] column_name DROP DEFAULT +CREATE TABLE test_drop_default( + LIKE orders, + default_price float4 DEFAULT 10.0, + default_name varchar DEFAULT 'foo' +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_drop_default", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "default_price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT %{default}s", "default": "10.0"}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "default_name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT %{default}s", "default": "'foo'::character varying"}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_drop_default (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , default_price pg_catalog.float4 STORAGE plain DEFAULT 10.0 , default_name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" DEFAULT 'foo'::character varying ) +ALTER TABLE test_drop_default ALTER default_price DROP DEFAULT; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I DROP DEFAULT", "type": "drop default", "column": "default_price"}], "identity": {"objname": "test_drop_default", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_default ALTER COLUMN default_price DROP DEFAULT +ALTER TABLE test_drop_default ALTER COLUMN default_name DROP DEFAULT; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I DROP DEFAULT", "type": "drop default", "column": "default_name"}], "identity": {"objname": "test_drop_default", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_default ALTER COLUMN default_name DROP DEFAULT +-- ALTER [ COLUMN ] column_name { SET | DROP } NOT NULL +CREATE TABLE test_set_not_null( + LIKE orders, + size int NOT NULL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_not_null", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "size", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_not_null (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , size pg_catalog.int4 STORAGE plain NOT NULL ) +ALTER TABLE test_set_not_null ALTER COLUMN id SET NOT NULL; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET NOT NULL", "type": "set not null", "column": "id"}], "identity": {"objname": "test_set_not_null", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_not_null ALTER COLUMN id SET NOT NULL +ALTER TABLE test_set_not_null ALTER size DROP NOT NULL; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I DROP NOT NULL", "type": "drop not null", "column": "size"}], "identity": {"objname": "test_set_not_null", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_not_null ALTER COLUMN size DROP NOT NULL +-- ALTER [ COLUMN ] column_name DROP EXPRESSION [ IF EXISTS ] +CREATE TABLE test_drop_expression( + LIKE orders, + new_id int GENERATED ALWAYS AS ( 3 * ID ) STORED +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_drop_expression", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "new_id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS (%{generation_expr}s) STORED", "generation_expr": "(3 OPERATOR(pg_catalog.*) id)"}}]} +NOTICE: re-formed command: CREATE TABLE public.test_drop_expression (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , new_id pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS ((3 OPERATOR(pg_catalog.*) id)) STORED) +ALTER TABLE test_drop_expression ALTER new_id DROP EXPRESSION; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I DROP EXPRESSION %{if_exists}s", "type": "drop expression", "column": "new_id", "if_exists": ""}], "identity": {"objname": "test_drop_expression", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_expression ALTER COLUMN new_id DROP EXPRESSION +ALTER TABLE test_drop_expression ALTER id DROP EXPRESSION IF EXISTS; +NOTICE: column "id" of relation "test_drop_expression" is not a stored generated column, skipping +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I DROP EXPRESSION %{if_exists}s", "type": "drop expression", "column": "id", "if_exists": "IF EXISTS"}], "identity": {"objname": "test_drop_expression", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_expression ALTER COLUMN id DROP EXPRESSION IF EXISTS +-- ALTER [ COLUMN ] column_name ADD GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] +CREATE TABLE test_add_generated( + LIKE orders, + col1 int NOT NULL, + col2 int NOT NULL, + col3 int NOT NULL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_add_generated", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col1", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "col3", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_add_generated (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , col1 pg_catalog.int4 STORAGE plain NOT NULL , col2 pg_catalog.int4 STORAGE plain NOT NULL , col3 pg_catalog.int4 STORAGE plain NOT NULL ) +ALTER TABLE test_add_generated ALTER col1 ADD GENERATED ALWAYS AS IDENTITY; +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I ADD %{identity_column}s", "type": "add identity", "column": "col1", "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "ALWAYS"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}}], "identity": {"objname": "test_add_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_generated ALTER COLUMN col1 ADD GENERATED ALWAYS AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) +ALTER TABLE test_add_generated ALTER COLUMN col2 ADD GENERATED BY DEFAULT AS IDENTITY; +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I ADD %{identity_column}s", "type": "add identity", "column": "col2", "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "BY DEFAULT"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}}], "identity": {"objname": "test_add_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_generated ALTER COLUMN col2 ADD GENERATED BY DEFAULT AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) +ALTER TABLE test_add_generated ALTER col3 ADD GENERATED BY DEFAULT AS IDENTITY ( INCREMENT BY 10 ); +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I ADD %{identity_column}s", "type": "add identity", "column": "col3", "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "BY DEFAULT"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "10", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}}], "identity": {"objname": "test_add_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_generated ALTER COLUMN col3 ADD GENERATED BY DEFAULT AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 10 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) +-- ALTER [ COLUMN ] column_name { SET GENERATED { ALWAYS | BY DEFAULT } | SET sequence_option | RESTART [ [ WITH ] restart ] } [...] +CREATE TABLE test_set_generated( + id1 int GENERATED BY DEFAULT AS IDENTITY, + id2 int GENERATED ALWAYS AS IDENTITY, + id3 int GENERATED ALWAYS AS IDENTITY, + id4 int GENERATED ALWAYS AS IDENTITY, + id5 int GENERATED ALWAYS AS IDENTITY, + id6 int GENERATED ALWAYS AS IDENTITY, + id7 int GENERATED ALWAYS AS IDENTITY +); +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_generated", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id1", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "BY DEFAULT"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "ALWAYS"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id3", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "ALWAYS"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id4", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "ALWAYS"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id5", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "ALWAYS"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id6", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "ALWAYS"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id7", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "ALWAYS"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_generated (id1 pg_catalog.int4 STORAGE plain GENERATED BY DEFAULT AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) , id2 pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) , id3 pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) , id4 pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) , id5 pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) , id6 pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) , id7 pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) ) +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +ALTER TABLE test_set_generated ALTER id1 SET GENERATED ALWAYS; +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{definition}s", "type": "set identity", "column": "id1", "definition": {"fmt": "%{identity_type}s %{seq_definition: }s", "identity_type": {"fmt": "SET GENERATED %{option}s", "option": "ALWAYS"}, "seq_definition": [{"fmt": "SET CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "SET %{no}s CYCLE", "clause": "cycle"}, {"fmt": "SET INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "SET MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "SET MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "SET START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}}], "identity": {"objname": "test_set_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_generated ALTER COLUMN id1 SET GENERATED ALWAYS SET CACHE 1 SET NO CYCLE SET INCREMENT BY 1 SET MINVALUE 1 SET MAXVALUE 2147483647 SET START WITH 1 RESTART 1 +ALTER TABLE test_set_generated ALTER id2 SET GENERATED BY DEFAULT; +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{definition}s", "type": "set identity", "column": "id2", "definition": {"fmt": "%{identity_type}s %{seq_definition: }s", "identity_type": {"fmt": "SET GENERATED %{option}s", "option": "BY DEFAULT"}, "seq_definition": [{"fmt": "SET CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "SET %{no}s CYCLE", "clause": "cycle"}, {"fmt": "SET INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "SET MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "SET MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "SET START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}}], "identity": {"objname": "test_set_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_generated ALTER COLUMN id2 SET GENERATED BY DEFAULT SET CACHE 1 SET NO CYCLE SET INCREMENT BY 1 SET MINVALUE 1 SET MAXVALUE 2147483647 SET START WITH 1 RESTART 1 +ALTER TABLE test_set_generated ALTER id3 SET INCREMENT BY 10; +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{definition}s", "type": "set identity", "column": "id3", "definition": {"fmt": "%{identity_type}s %{seq_definition: }s", "identity_type": {"fmt": "SET GENERATED ", "present": false}, "seq_definition": [{"fmt": "SET CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "SET %{no}s CYCLE", "clause": "cycle"}, {"fmt": "SET INCREMENT BY %{value}s", "value": "10", "clause": "seqincrement"}, {"fmt": "SET MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "SET MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "SET START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}}], "identity": {"objname": "test_set_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_generated ALTER COLUMN id3 SET CACHE 1 SET NO CYCLE SET INCREMENT BY 10 SET MINVALUE 1 SET MAXVALUE 2147483647 SET START WITH 1 RESTART 1 +ALTER TABLE test_set_generated ALTER id4 RESTART; +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{definition}s", "type": "set identity", "column": "id4", "definition": {"fmt": "%{identity_type}s %{seq_definition: }s", "identity_type": {"fmt": "SET GENERATED ", "present": false}, "seq_definition": [{"fmt": "SET CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "SET %{no}s CYCLE", "clause": "cycle"}, {"fmt": "SET INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "SET MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "SET MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "SET START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}}], "identity": {"objname": "test_set_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_generated ALTER COLUMN id4 SET CACHE 1 SET NO CYCLE SET INCREMENT BY 1 SET MINVALUE 1 SET MAXVALUE 2147483647 SET START WITH 1 RESTART 1 +ALTER TABLE test_set_generated ALTER id5 RESTART WITH 101; +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{definition}s", "type": "set identity", "column": "id5", "definition": {"fmt": "%{identity_type}s %{seq_definition: }s", "identity_type": {"fmt": "SET GENERATED ", "present": false}, "seq_definition": [{"fmt": "SET CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "SET %{no}s CYCLE", "clause": "cycle"}, {"fmt": "SET INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "SET MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "SET MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "SET START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "101", "clause": "restart"}]}}], "identity": {"objname": "test_set_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_generated ALTER COLUMN id5 SET CACHE 1 SET NO CYCLE SET INCREMENT BY 1 SET MINVALUE 1 SET MAXVALUE 2147483647 SET START WITH 1 RESTART 101 +ALTER TABLE test_set_generated ALTER id6 RESTART WITH 201; +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{definition}s", "type": "set identity", "column": "id6", "definition": {"fmt": "%{identity_type}s %{seq_definition: }s", "identity_type": {"fmt": "SET GENERATED ", "present": false}, "seq_definition": [{"fmt": "SET CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "SET %{no}s CYCLE", "clause": "cycle"}, {"fmt": "SET INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "SET MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "SET MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "SET START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "201", "clause": "restart"}]}}], "identity": {"objname": "test_set_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_generated ALTER COLUMN id6 SET CACHE 1 SET NO CYCLE SET INCREMENT BY 1 SET MINVALUE 1 SET MAXVALUE 2147483647 SET START WITH 1 RESTART 201 +ALTER TABLE test_set_generated ALTER COLUMN id7 SET GENERATED BY DEFAULT SET INCREMENT BY 100 RESTART WITH 301; +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{definition}s", "type": "set identity", "column": "id7", "definition": {"fmt": "%{identity_type}s %{seq_definition: }s", "identity_type": {"fmt": "SET GENERATED %{option}s", "option": "BY DEFAULT"}, "seq_definition": [{"fmt": "SET CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "SET %{no}s CYCLE", "clause": "cycle"}, {"fmt": "SET INCREMENT BY %{value}s", "value": "100", "clause": "seqincrement"}, {"fmt": "SET MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "SET MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "SET START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "301", "clause": "restart"}]}}], "identity": {"objname": "test_set_generated", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_generated ALTER COLUMN id7 SET GENERATED BY DEFAULT SET CACHE 1 SET NO CYCLE SET INCREMENT BY 100 SET MINVALUE 1 SET MAXVALUE 2147483647 SET START WITH 1 RESTART 301 +-- ALTER [ COLUMN ] column_name DROP IDENTITY [ IF EXISTS ] +CREATE TABLE test_drop_identity( + id int, + id_generated int GENERATED ALWAYS AS IDENTITY +); +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_drop_identity", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id_generated", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "ALWAYS"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_drop_identity (id pg_catalog.int4 STORAGE plain , id_generated pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) ) +NOTICE: deparsed json: +NOTICE: re-formed command: +ALTER TABLE test_drop_identity ALTER id_generated DROP IDENTITY; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I DROP IDENTITY %{if_exists}s", "type": "drop identity", "column": "id_generated", "if_exists": ""}], "identity": {"objname": "test_drop_identity", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_identity ALTER COLUMN id_generated DROP IDENTITY +ALTER TABLE test_drop_identity ALTER id DROP IDENTITY IF EXISTS; +NOTICE: column "id" of relation "test_drop_identity" is not an identity column, skipping +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I DROP IDENTITY %{if_exists}s", "type": "drop identity", "column": "id", "if_exists": "IF EXISTS"}], "identity": {"objname": "test_drop_identity", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_identity ALTER COLUMN id DROP IDENTITY IF EXISTS +-- ALTER [ COLUMN ] column_name SET STATISTICS integer +CREATE TABLE test_set_statistics( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_statistics", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_statistics (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_statistics ALTER id SET STATISTICS 1; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET STATISTICS %{statistics}n", "type": "set statistics", "column": "id", "statistics": 1}], "identity": {"objname": "test_set_statistics", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_statistics ALTER COLUMN id SET STATISTICS 1 +-- ALTER [ COLUMN ] column_name SET ( attribute_option = value [, ... ] ) +CREATE TABLE test_set_attribute( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_attribute", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_attribute (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_attribute ALTER name SET (n_distinct = 102); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{option}s (%{options:, }s)", "column": "name", "option": "SET", "options": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "n_distinct"}, "value": "102"}]}], "identity": {"objname": "test_set_attribute", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_attribute ALTER COLUMN name SET (n_distinct = '102') +ALTER TABLE test_set_attribute ALTER id SET (n_distinct_inherited = 99, n_distinct = 9); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{option}s (%{options:, }s)", "column": "id", "option": "SET", "options": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "n_distinct_inherited"}, "value": "99"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "n_distinct"}, "value": "9"}]}], "identity": {"objname": "test_set_attribute", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_attribute ALTER COLUMN id SET (n_distinct_inherited = '99', n_distinct = '9') +-- ALTER [ COLUMN ] column_name RESET ( attribute_option [, ... ] ) +CREATE TABLE test_reset_attribute( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_reset_attribute", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_reset_attribute (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_reset_attribute ALTER name RESET (n_distinct); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{option}s (%{options:, }s)", "column": "name", "option": "RESET", "options": [{"fmt": "%{label}s", "label": {"fmt": "%{label}I", "label": "n_distinct"}}]}], "identity": {"objname": "test_reset_attribute", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_reset_attribute ALTER COLUMN name RESET (n_distinct) +ALTER TABLE test_reset_attribute ALTER id RESET (n_distinct, n_distinct_inherited); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I %{option}s (%{options:, }s)", "column": "id", "option": "RESET", "options": [{"fmt": "%{label}s", "label": {"fmt": "%{label}I", "label": "n_distinct"}}, {"fmt": "%{label}s", "label": {"fmt": "%{label}I", "label": "n_distinct_inherited"}}]}], "identity": {"objname": "test_reset_attribute", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_reset_attribute ALTER COLUMN id RESET (n_distinct, n_distinct_inherited) +-- ALTER [ COLUMN ] column_name SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN } +CREATE TABLE test_set_storage( + LIKE orders, + product_name text +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_storage", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "product_name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_storage (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , product_name pg_catalog.text STORAGE extended COLLATE pg_catalog."default" ) +ALTER TABLE test_set_storage ALTER id SET STORAGE PLAIN; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET STORAGE %{storage}s", "type": "set storage", "column": "id", "storage": "plain"}], "identity": {"objname": "test_set_storage", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_storage ALTER COLUMN id SET STORAGE plain +ALTER TABLE test_set_storage ALTER name SET STORAGE EXTERNAL; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET STORAGE %{storage}s", "type": "set storage", "column": "name", "storage": "external"}], "identity": {"objname": "test_set_storage", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_storage ALTER COLUMN name SET STORAGE external +ALTER TABLE test_set_storage ALTER description SET STORAGE EXTENDED; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET STORAGE %{storage}s", "type": "set storage", "column": "description", "storage": "extended"}], "identity": {"objname": "test_set_storage", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_storage ALTER COLUMN description SET STORAGE extended +ALTER TABLE test_set_storage ALTER product_name SET STORAGE MAIN; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET STORAGE %{storage}s", "type": "set storage", "column": "product_name", "storage": "main"}], "identity": {"objname": "test_set_storage", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_storage ALTER COLUMN product_name SET STORAGE main +-- ALTER [ COLUMN ] column_name SET COMPRESSION compression_method +CREATE TABLE test_set_compression( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_compression", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_compression (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_compression ALTER name SET COMPRESSION "lz4"; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET COMPRESSION %{compression_method}s", "type": "set compression", "column": "name", "compression_method": "lz4"}], "identity": {"objname": "test_set_compression", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_compression ALTER COLUMN name SET COMPRESSION lz4 +ALTER TABLE test_set_compression ALTER COLUMN description SET COMPRESSION "lz4"; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET COMPRESSION %{compression_method}s", "type": "set compression", "column": "description", "compression_method": "lz4"}], "identity": {"objname": "test_set_compression", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_compression ALTER COLUMN description SET COMPRESSION lz4 +-- ADD table_constraint [ NOT VALID ] +CREATE TABLE test_add_table_constraint( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_add_table_constraint", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_add_table_constraint (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_add_table_constraint ADD PRIMARY KEY (id); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET NOT NULL", "type": "set not null", "column": "id"}, {"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "test_add_table_constraint_pkey", "type": "add constraint", "definition": "PRIMARY KEY (id)"}], "identity": {"objname": "test_add_table_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_table_constraint ALTER COLUMN id SET NOT NULL, ADD CONSTRAINT test_add_table_constraint_pkey PRIMARY KEY (id) +ALTER TABLE test_add_table_constraint ADD CONSTRAINT max_name_len CHECK (length(name) < 4) NOT VALID; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "max_name_len", "type": "add constraint", "definition": "CHECK ((pg_catalog.length((name)::pg_catalog.text) OPERATOR(pg_catalog.<) 4)) NOT VALID"}], "identity": {"objname": "test_add_table_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_table_constraint ADD CONSTRAINT max_name_len CHECK ((pg_catalog.length((name)::pg_catalog.text) OPERATOR(pg_catalog.<) 4)) NOT VALID +ALTER TABLE test_add_table_constraint ADD CHECK (id < 10); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "test_add_table_constraint_id_check", "type": "add constraint", "definition": "CHECK ((id OPERATOR(pg_catalog.<) 10))"}], "identity": {"objname": "test_add_table_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_table_constraint ADD CONSTRAINT test_add_table_constraint_id_check CHECK ((id OPERATOR(pg_catalog.<) 10)) +-- ADD table_constraint_using_index +CREATE TABLE test_add_constraint_using_index( + id1 int, + id2 int, + id3 int, + id4 int, + id5 int, + id6 int, + id7 int +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_add_constraint_using_index", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id1", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id3", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id4", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id5", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id6", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id7", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_add_constraint_using_index (id1 pg_catalog.int4 STORAGE plain , id2 pg_catalog.int4 STORAGE plain , id3 pg_catalog.int4 STORAGE plain , id4 pg_catalog.int4 STORAGE plain , id5 pg_catalog.int4 STORAGE plain , id6 pg_catalog.int4 STORAGE plain , id7 pg_catalog.int4 STORAGE plain ) +CREATE UNIQUE INDEX test_add_constraint_used_index1 ON test_add_constraint_using_index (id1); +NOTICE: deparsed json: {"fmt": "CREATE %{unique}s INDEX %{concurrently}s %{if_not_exists}s %{name}I ON %{table}D USING %{index_am}s %{definition}s %{with}s %{tablespace}s %{where_clause}s NULLS DISTINCT", "name": "test_add_constraint_used_index1", "with": {"fmt": "WITH", "present": false}, "table": {"objname": "test_add_constraint_using_index", "schemaname": "public"}, "unique": "UNIQUE", "index_am": "btree", "definition": "(id1 pg_catalog.int4_ops)", "tablespace": {"fmt": "TABLESPACE", "present": false}, "concurrently": "", "where_clause": {"fmt": "WHERE", "present": false}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE UNIQUE INDEX test_add_constraint_used_index1 ON public.test_add_constraint_using_index USING btree (id1 pg_catalog.int4_ops) NULLS DISTINCT +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index1; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{constraint_type}s USING INDEX %{index_name}I %{deferrable}s %{init_deferred}s", "name": "test_add_constraint_used_index1", "type": "add constraint using index", "deferrable": "NOT DEFERRABLE", "index_name": "test_add_constraint_used_index1", "init_deferred": "INITIALLY IMMEDIATE", "constraint_type": "UNIQUE"}], "identity": {"objname": "test_add_constraint_using_index", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_constraint_using_index ADD CONSTRAINT test_add_constraint_used_index1 UNIQUE USING INDEX test_add_constraint_used_index1 NOT DEFERRABLE INITIALLY IMMEDIATE +CREATE UNIQUE INDEX test_add_constraint_used_index2 ON test_add_constraint_using_index (id2); +NOTICE: deparsed json: {"fmt": "CREATE %{unique}s INDEX %{concurrently}s %{if_not_exists}s %{name}I ON %{table}D USING %{index_am}s %{definition}s %{with}s %{tablespace}s %{where_clause}s NULLS DISTINCT", "name": "test_add_constraint_used_index2", "with": {"fmt": "WITH", "present": false}, "table": {"objname": "test_add_constraint_using_index", "schemaname": "public"}, "unique": "UNIQUE", "index_am": "btree", "definition": "(id2 pg_catalog.int4_ops)", "tablespace": {"fmt": "TABLESPACE", "present": false}, "concurrently": "", "where_clause": {"fmt": "WHERE", "present": false}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE UNIQUE INDEX test_add_constraint_used_index2 ON public.test_add_constraint_using_index USING btree (id2 pg_catalog.int4_ops) NULLS DISTINCT +--TOFIX +-- ALTER TABLE test_add_constraint_using_index ADD CONSTRAINT primary_constraint_using_index PRIMARY KEY USING INDEX test_add_constraint_used_index2; +CREATE UNIQUE INDEX test_add_constraint_used_index3 ON test_add_constraint_using_index (id3); +NOTICE: deparsed json: {"fmt": "CREATE %{unique}s INDEX %{concurrently}s %{if_not_exists}s %{name}I ON %{table}D USING %{index_am}s %{definition}s %{with}s %{tablespace}s %{where_clause}s NULLS DISTINCT", "name": "test_add_constraint_used_index3", "with": {"fmt": "WITH", "present": false}, "table": {"objname": "test_add_constraint_using_index", "schemaname": "public"}, "unique": "UNIQUE", "index_am": "btree", "definition": "(id3 pg_catalog.int4_ops)", "tablespace": {"fmt": "TABLESPACE", "present": false}, "concurrently": "", "where_clause": {"fmt": "WHERE", "present": false}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE UNIQUE INDEX test_add_constraint_used_index3 ON public.test_add_constraint_using_index USING btree (id3 pg_catalog.int4_ops) NULLS DISTINCT +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index3 DEFERRABLE; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{constraint_type}s USING INDEX %{index_name}I %{deferrable}s %{init_deferred}s", "name": "test_add_constraint_used_index3", "type": "add constraint using index", "deferrable": "DEFERRABLE", "index_name": "test_add_constraint_used_index3", "init_deferred": "INITIALLY IMMEDIATE", "constraint_type": "UNIQUE"}], "identity": {"objname": "test_add_constraint_using_index", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_constraint_using_index ADD CONSTRAINT test_add_constraint_used_index3 UNIQUE USING INDEX test_add_constraint_used_index3 DEFERRABLE INITIALLY IMMEDIATE +CREATE UNIQUE INDEX test_add_constraint_used_index4 ON test_add_constraint_using_index (id4); +NOTICE: deparsed json: {"fmt": "CREATE %{unique}s INDEX %{concurrently}s %{if_not_exists}s %{name}I ON %{table}D USING %{index_am}s %{definition}s %{with}s %{tablespace}s %{where_clause}s NULLS DISTINCT", "name": "test_add_constraint_used_index4", "with": {"fmt": "WITH", "present": false}, "table": {"objname": "test_add_constraint_using_index", "schemaname": "public"}, "unique": "UNIQUE", "index_am": "btree", "definition": "(id4 pg_catalog.int4_ops)", "tablespace": {"fmt": "TABLESPACE", "present": false}, "concurrently": "", "where_clause": {"fmt": "WHERE", "present": false}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE UNIQUE INDEX test_add_constraint_used_index4 ON public.test_add_constraint_using_index USING btree (id4 pg_catalog.int4_ops) NULLS DISTINCT +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index4 NOT DEFERRABLE; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{constraint_type}s USING INDEX %{index_name}I %{deferrable}s %{init_deferred}s", "name": "test_add_constraint_used_index4", "type": "add constraint using index", "deferrable": "NOT DEFERRABLE", "index_name": "test_add_constraint_used_index4", "init_deferred": "INITIALLY IMMEDIATE", "constraint_type": "UNIQUE"}], "identity": {"objname": "test_add_constraint_using_index", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_constraint_using_index ADD CONSTRAINT test_add_constraint_used_index4 UNIQUE USING INDEX test_add_constraint_used_index4 NOT DEFERRABLE INITIALLY IMMEDIATE +CREATE UNIQUE INDEX test_add_constraint_used_index5 ON test_add_constraint_using_index (id5); +NOTICE: deparsed json: {"fmt": "CREATE %{unique}s INDEX %{concurrently}s %{if_not_exists}s %{name}I ON %{table}D USING %{index_am}s %{definition}s %{with}s %{tablespace}s %{where_clause}s NULLS DISTINCT", "name": "test_add_constraint_used_index5", "with": {"fmt": "WITH", "present": false}, "table": {"objname": "test_add_constraint_using_index", "schemaname": "public"}, "unique": "UNIQUE", "index_am": "btree", "definition": "(id5 pg_catalog.int4_ops)", "tablespace": {"fmt": "TABLESPACE", "present": false}, "concurrently": "", "where_clause": {"fmt": "WHERE", "present": false}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE UNIQUE INDEX test_add_constraint_used_index5 ON public.test_add_constraint_using_index USING btree (id5 pg_catalog.int4_ops) NULLS DISTINCT +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index5 INITIALLY DEFERRED; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{constraint_type}s USING INDEX %{index_name}I %{deferrable}s %{init_deferred}s", "name": "test_add_constraint_used_index5", "type": "add constraint using index", "deferrable": "DEFERRABLE", "index_name": "test_add_constraint_used_index5", "init_deferred": "INITIALLY DEFERRED", "constraint_type": "UNIQUE"}], "identity": {"objname": "test_add_constraint_using_index", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_constraint_using_index ADD CONSTRAINT test_add_constraint_used_index5 UNIQUE USING INDEX test_add_constraint_used_index5 DEFERRABLE INITIALLY DEFERRED +CREATE UNIQUE INDEX test_add_constraint_used_index6 ON test_add_constraint_using_index (id6); +NOTICE: deparsed json: {"fmt": "CREATE %{unique}s INDEX %{concurrently}s %{if_not_exists}s %{name}I ON %{table}D USING %{index_am}s %{definition}s %{with}s %{tablespace}s %{where_clause}s NULLS DISTINCT", "name": "test_add_constraint_used_index6", "with": {"fmt": "WITH", "present": false}, "table": {"objname": "test_add_constraint_using_index", "schemaname": "public"}, "unique": "UNIQUE", "index_am": "btree", "definition": "(id6 pg_catalog.int4_ops)", "tablespace": {"fmt": "TABLESPACE", "present": false}, "concurrently": "", "where_clause": {"fmt": "WHERE", "present": false}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE UNIQUE INDEX test_add_constraint_used_index6 ON public.test_add_constraint_using_index USING btree (id6 pg_catalog.int4_ops) NULLS DISTINCT +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index6 INITIALLY IMMEDIATE; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{constraint_type}s USING INDEX %{index_name}I %{deferrable}s %{init_deferred}s", "name": "test_add_constraint_used_index6", "type": "add constraint using index", "deferrable": "NOT DEFERRABLE", "index_name": "test_add_constraint_used_index6", "init_deferred": "INITIALLY IMMEDIATE", "constraint_type": "UNIQUE"}], "identity": {"objname": "test_add_constraint_using_index", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_constraint_using_index ADD CONSTRAINT test_add_constraint_used_index6 UNIQUE USING INDEX test_add_constraint_used_index6 NOT DEFERRABLE INITIALLY IMMEDIATE +CREATE UNIQUE INDEX test_add_constraint_used_index7 ON test_add_constraint_using_index (id7); +NOTICE: deparsed json: {"fmt": "CREATE %{unique}s INDEX %{concurrently}s %{if_not_exists}s %{name}I ON %{table}D USING %{index_am}s %{definition}s %{with}s %{tablespace}s %{where_clause}s NULLS DISTINCT", "name": "test_add_constraint_used_index7", "with": {"fmt": "WITH", "present": false}, "table": {"objname": "test_add_constraint_using_index", "schemaname": "public"}, "unique": "UNIQUE", "index_am": "btree", "definition": "(id7 pg_catalog.int4_ops)", "tablespace": {"fmt": "TABLESPACE", "present": false}, "concurrently": "", "where_clause": {"fmt": "WHERE", "present": false}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE UNIQUE INDEX test_add_constraint_used_index7 ON public.test_add_constraint_using_index USING btree (id7 pg_catalog.int4_ops) NULLS DISTINCT +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index7 DEFERRABLE INITIALLY DEFERRED; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{constraint_type}s USING INDEX %{index_name}I %{deferrable}s %{init_deferred}s", "name": "test_add_constraint_used_index7", "type": "add constraint using index", "deferrable": "DEFERRABLE", "index_name": "test_add_constraint_used_index7", "init_deferred": "INITIALLY DEFERRED", "constraint_type": "UNIQUE"}], "identity": {"objname": "test_add_constraint_using_index", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_add_constraint_using_index ADD CONSTRAINT test_add_constraint_used_index7 UNIQUE USING INDEX test_add_constraint_used_index7 DEFERRABLE INITIALLY DEFERRED +-- ALTER CONSTRAINT constraint_name [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] +CREATE TABLE test_alter_constraint_referenced( + id1 int UNIQUE, + id2 int UNIQUE, + id3 int UNIQUE, + id4 int UNIQUE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_alter_constraint_referenced", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id1", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id3", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id4", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_alter_constraint_referenced_id1_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id1)"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_alter_constraint_referenced_id2_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id2)"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_alter_constraint_referenced_id3_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id3)"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_alter_constraint_referenced_id4_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id4)"}]} +NOTICE: re-formed command: CREATE TABLE public.test_alter_constraint_referenced (id1 pg_catalog.int4 STORAGE plain , id2 pg_catalog.int4 STORAGE plain , id3 pg_catalog.int4 STORAGE plain , id4 pg_catalog.int4 STORAGE plain , CONSTRAINT test_alter_constraint_referenced_id1_key UNIQUE (id1), CONSTRAINT test_alter_constraint_referenced_id2_key UNIQUE (id2), CONSTRAINT test_alter_constraint_referenced_id3_key UNIQUE (id3), CONSTRAINT test_alter_constraint_referenced_id4_key UNIQUE (id4)) +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE test_alter_constraint( + id1 int, + id2 int, + id3 int, + id4 int, + id5 int, + CONSTRAINT alter_cstr1 FOREIGN KEY (id1) REFERENCES test_alter_constraint_referenced (id1) DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT alter_cstr2 FOREIGN KEY (id2) REFERENCES test_alter_constraint_referenced (id2) NOT DEFERRABLE, + CONSTRAINT alter_cstr3 FOREIGN KEY (id3) REFERENCES test_alter_constraint_referenced (id3) DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT alter_cstr4 FOREIGN KEY (id4) REFERENCES test_alter_constraint_referenced (id4) DEFERRABLE INITIALLY IMMEDIATE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_alter_constraint", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id1", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id3", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id4", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id5", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_alter_constraint (id1 pg_catalog.int4 STORAGE plain , id2 pg_catalog.int4 STORAGE plain , id3 pg_catalog.int4 STORAGE plain , id4 pg_catalog.int4 STORAGE plain , id5 pg_catalog.int4 STORAGE plain ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "alter_cstr1", "type": "add constraint", "definition": "FOREIGN KEY (id1) REFERENCES public.test_alter_constraint_referenced(id1) DEFERRABLE INITIALLY DEFERRED"}, {"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "alter_cstr2", "type": "add constraint", "definition": "FOREIGN KEY (id2) REFERENCES public.test_alter_constraint_referenced(id2)"}, {"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "alter_cstr3", "type": "add constraint", "definition": "FOREIGN KEY (id3) REFERENCES public.test_alter_constraint_referenced(id3) DEFERRABLE INITIALLY DEFERRED"}, {"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "alter_cstr4", "type": "add constraint", "definition": "FOREIGN KEY (id4) REFERENCES public.test_alter_constraint_referenced(id4) DEFERRABLE"}], "identity": {"objname": "test_alter_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_constraint ADD CONSTRAINT alter_cstr1 FOREIGN KEY (id1) REFERENCES public.test_alter_constraint_referenced(id1) DEFERRABLE INITIALLY DEFERRED, ADD CONSTRAINT alter_cstr2 FOREIGN KEY (id2) REFERENCES public.test_alter_constraint_referenced(id2), ADD CONSTRAINT alter_cstr3 FOREIGN KEY (id3) REFERENCES public.test_alter_constraint_referenced(id3) DEFERRABLE INITIALLY DEFERRED, ADD CONSTRAINT alter_cstr4 FOREIGN KEY (id4) REFERENCES public.test_alter_constraint_referenced(id4) DEFERRABLE +ALTER TABLE test_alter_constraint ALTER CONSTRAINT alter_cstr1 NOT DEFERRABLE; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER CONSTRAINT %{name}I %{deferrable}s %{init_deferred}s", "name": "alter_cstr1", "type": "alter constraint", "deferrable": "NOT DEFERRABLE", "init_deferred": "INITIALLY IMMEDIATE"}], "identity": {"objname": "test_alter_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_constraint ALTER CONSTRAINT alter_cstr1 NOT DEFERRABLE INITIALLY IMMEDIATE +ALTER TABLE test_alter_constraint ALTER CONSTRAINT alter_cstr2 DEFERRABLE; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER CONSTRAINT %{name}I %{deferrable}s %{init_deferred}s", "name": "alter_cstr2", "type": "alter constraint", "deferrable": "DEFERRABLE", "init_deferred": "INITIALLY IMMEDIATE"}], "identity": {"objname": "test_alter_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_constraint ALTER CONSTRAINT alter_cstr2 DEFERRABLE INITIALLY IMMEDIATE +ALTER TABLE test_alter_constraint ALTER CONSTRAINT alter_cstr3 DEFERRABLE INITIALLY IMMEDIATE; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER CONSTRAINT %{name}I %{deferrable}s %{init_deferred}s", "name": "alter_cstr3", "type": "alter constraint", "deferrable": "DEFERRABLE", "init_deferred": "INITIALLY IMMEDIATE"}], "identity": {"objname": "test_alter_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_constraint ALTER CONSTRAINT alter_cstr3 DEFERRABLE INITIALLY IMMEDIATE +ALTER TABLE test_alter_constraint ALTER CONSTRAINT alter_cstr4 DEFERRABLE INITIALLY DEFERRED; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER CONSTRAINT %{name}I %{deferrable}s %{init_deferred}s", "name": "alter_cstr4", "type": "alter constraint", "deferrable": "DEFERRABLE", "init_deferred": "INITIALLY DEFERRED"}], "identity": {"objname": "test_alter_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_constraint ALTER CONSTRAINT alter_cstr4 DEFERRABLE INITIALLY DEFERRED +-- VALIDATE CONSTRAINT constraint_name +CREATE TABLE test_validate_constraint( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_validate_constraint", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_validate_constraint (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_validate_constraint ADD CONSTRAINT test_validate_constraint_cstr CHECK (length(name) < 10) NOT VALID; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "test_validate_constraint_cstr", "type": "add constraint", "definition": "CHECK ((pg_catalog.length((name)::pg_catalog.text) OPERATOR(pg_catalog.<) 10)) NOT VALID"}], "identity": {"objname": "test_validate_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_validate_constraint ADD CONSTRAINT test_validate_constraint_cstr CHECK ((pg_catalog.length((name)::pg_catalog.text) OPERATOR(pg_catalog.<) 10)) NOT VALID +ALTER TABLE test_validate_constraint VALIDATE CONSTRAINT test_validate_constraint_cstr; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "VALIDATE CONSTRAINT %{constraint}I", "type": "validate constraint", "constraint": "test_validate_constraint_cstr"}], "identity": {"objname": "test_validate_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_validate_constraint VALIDATE CONSTRAINT test_validate_constraint_cstr +-- DROP CONSTRAINT [ IF EXISTS ] constraint_name [ RESTRICT | CASCADE ] +CREATE TABLE test_drop_constraint( + LIKE orders, + CONSTRAINT test_drop_constraint_check CHECK (id < 100), + CONSTRAINT test_drop_constraint_uniq UNIQUE (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_drop_constraint", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_drop_constraint_check", "type": "constraint", "contype": "check", "definition": "CHECK ((id OPERATOR(pg_catalog.<) 100))"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_drop_constraint_uniq", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.test_drop_constraint (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , CONSTRAINT test_drop_constraint_check CHECK ((id OPERATOR(pg_catalog.<) 100)), CONSTRAINT test_drop_constraint_uniq UNIQUE (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE test_drop_constraint_reference( + id int REFERENCES test_drop_constraint (id), + name varchar, + CONSTRAINT test_drop_constraint_reference_cstr1 CHECK (length(name) < 10) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_drop_constraint_reference", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_drop_constraint_reference_cstr1", "type": "constraint", "contype": "check", "definition": "CHECK ((pg_catalog.length((name)::pg_catalog.text) OPERATOR(pg_catalog.<) 10))"}]} +NOTICE: re-formed command: CREATE TABLE public.test_drop_constraint_reference (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT test_drop_constraint_reference_cstr1 CHECK ((pg_catalog.length((name)::pg_catalog.text) OPERATOR(pg_catalog.<) 10))) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "test_drop_constraint_reference_id_fkey", "type": "add constraint", "definition": "FOREIGN KEY (id) REFERENCES public.test_drop_constraint(id)"}], "identity": {"objname": "test_drop_constraint_reference", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_constraint_reference ADD CONSTRAINT test_drop_constraint_reference_id_fkey FOREIGN KEY (id) REFERENCES public.test_drop_constraint(id) +ALTER TABLE test_drop_constraint_reference DROP CONSTRAINT test_drop_constraint_reference_cstr1; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "DROP CONSTRAINT %{if_exists}s %{constraint}I %{cascade}s", "type": "drop constraint", "cascade": "", "if_exists": "", "constraint": "test_drop_constraint_reference_cstr1"}], "identity": {"objname": "test_drop_constraint_reference", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_constraint_reference DROP CONSTRAINT test_drop_constraint_reference_cstr1 +ALTER TABLE test_drop_constraint DROP CONSTRAINT test_drop_constraint_check RESTRICT; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "DROP CONSTRAINT %{if_exists}s %{constraint}I %{cascade}s", "type": "drop constraint", "cascade": "", "if_exists": "", "constraint": "test_drop_constraint_check"}], "identity": {"objname": "test_drop_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_constraint DROP CONSTRAINT test_drop_constraint_check +ALTER TABLE test_drop_constraint DROP CONSTRAINT IF EXISTS test_drop_constraint_check RESTRICT; +NOTICE: constraint "test_drop_constraint_check" of relation "test_drop_constraint" does not exist, skipping +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "DROP CONSTRAINT %{if_exists}s %{constraint}I %{cascade}s", "type": "drop constraint", "cascade": "", "if_exists": "IF EXISTS", "constraint": "test_drop_constraint_check"}], "identity": {"objname": "test_drop_constraint", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_drop_constraint DROP CONSTRAINT IF EXISTS test_drop_constraint_check +-- TOFIX +-- ALTER TABLE test_drop_constraint DROP CONSTRAINT test_drop_constraint_uniq CASCADE; +-- TODO: This should be tested with TRIGGER related testing +-- DISABLE TRIGGER [ trigger_name | ALL | USER ] +-- ENABLE TRIGGER [ trigger_name | ALL | USER ] +-- ENABLE REPLICA TRIGGER trigger_name +-- ENABLE ALWAYS TRIGGER trigger_name +-- DISABLE RULE rewrite_rule_name +CREATE TABLE test_disable_rule( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_disable_rule", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_disable_rule (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +CREATE RULE sample_rule1 AS + ON UPDATE TO test_disable_rule + DO INSTEAD + SELECT * FROM test_disable_rule; +NOTICE: deparsed json: {"fmt": "CREATE RULE %{or_replace}s %{identity}I AS ON %{event}s TO %{table}D %{where_clause}s DO %{instead}s %{actions:; }s", "event": "UPDATE", "table": {"objname": "test_disable_rule", "schemaname": "public"}, "actions": ["SELECT test_disable_rule.id, test_disable_rule.name, test_disable_rule.description, test_disable_rule.price, test_disable_rule.quantity, test_disable_rule.purchase_date FROM public.test_disable_rule"], "instead": "INSTEAD", "identity": "sample_rule1", "or_replace": "", "where_clause": {"fmt": "WHERE %{clause}s", "clause": null, "present": false}} +NOTICE: re-formed command: CREATE RULE sample_rule1 AS ON UPDATE TO public.test_disable_rule DO INSTEAD SELECT test_disable_rule.id, test_disable_rule.name, test_disable_rule.description, test_disable_rule.price, test_disable_rule.quantity, test_disable_rule.purchase_date FROM public.test_disable_rule +ALTER TABLE test_disable_rule DISABLE RULE sample_rule1; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "DISABLE RULE %{rule}I", "rule": "sample_rule1", "type": "disable rule"}], "identity": {"objname": "test_disable_rule", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_disable_rule DISABLE RULE sample_rule1 +-- ENABLE RULE rewrite_rule_name +CREATE TABLE test_enable_rule( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_enable_rule", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_enable_rule (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +CREATE RULE sample_rule2 AS + ON UPDATE TO test_enable_rule + DO INSTEAD + SELECT * FROM test_enable_rule; +NOTICE: deparsed json: {"fmt": "CREATE RULE %{or_replace}s %{identity}I AS ON %{event}s TO %{table}D %{where_clause}s DO %{instead}s %{actions:; }s", "event": "UPDATE", "table": {"objname": "test_enable_rule", "schemaname": "public"}, "actions": ["SELECT test_enable_rule.id, test_enable_rule.name, test_enable_rule.description, test_enable_rule.price, test_enable_rule.quantity, test_enable_rule.purchase_date FROM public.test_enable_rule"], "instead": "INSTEAD", "identity": "sample_rule2", "or_replace": "", "where_clause": {"fmt": "WHERE %{clause}s", "clause": null, "present": false}} +NOTICE: re-formed command: CREATE RULE sample_rule2 AS ON UPDATE TO public.test_enable_rule DO INSTEAD SELECT test_enable_rule.id, test_enable_rule.name, test_enable_rule.description, test_enable_rule.price, test_enable_rule.quantity, test_enable_rule.purchase_date FROM public.test_enable_rule +ALTER TABLE test_enable_rule DISABLE RULE sample_rule2; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "DISABLE RULE %{rule}I", "rule": "sample_rule2", "type": "disable rule"}], "identity": {"objname": "test_enable_rule", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_enable_rule DISABLE RULE sample_rule2 +ALTER TABLE test_enable_rule ENABLE RULE sample_rule2; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ENABLE RULE %{rule}I", "rule": "sample_rule2", "type": "enable rule"}], "identity": {"objname": "test_enable_rule", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_enable_rule ENABLE RULE sample_rule2 +-- ENABLE REPLICA RULE rewrite_rule_name +CREATE TABLE test_enable_replica_rule( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_enable_replica_rule", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_enable_replica_rule (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +CREATE RULE sample_rule_enable_replica AS + ON UPDATE TO test_enable_replica_rule + DO INSTEAD + SELECT * FROM test_enable_replica_rule; +NOTICE: deparsed json: {"fmt": "CREATE RULE %{or_replace}s %{identity}I AS ON %{event}s TO %{table}D %{where_clause}s DO %{instead}s %{actions:; }s", "event": "UPDATE", "table": {"objname": "test_enable_replica_rule", "schemaname": "public"}, "actions": ["SELECT test_enable_replica_rule.id, test_enable_replica_rule.name, test_enable_replica_rule.description, test_enable_replica_rule.price, test_enable_replica_rule.quantity, test_enable_replica_rule.purchase_date FROM public.test_enable_replica_rule"], "instead": "INSTEAD", "identity": "sample_rule_enable_replica", "or_replace": "", "where_clause": {"fmt": "WHERE %{clause}s", "clause": null, "present": false}} +NOTICE: re-formed command: CREATE RULE sample_rule_enable_replica AS ON UPDATE TO public.test_enable_replica_rule DO INSTEAD SELECT test_enable_replica_rule.id, test_enable_replica_rule.name, test_enable_replica_rule.description, test_enable_replica_rule.price, test_enable_replica_rule.quantity, test_enable_replica_rule.purchase_date FROM public.test_enable_replica_rule +ALTER TABLE test_enable_replica_rule ENABLE REPLICA RULE sample_rule_enable_replica; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ENABLE REPLICA RULE %{rule}I", "rule": "sample_rule_enable_replica", "type": "enable replica rule"}], "identity": {"objname": "test_enable_replica_rule", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_enable_replica_rule ENABLE REPLICA RULE sample_rule_enable_replica +-- ENABLE ALWAYS RULE rewrite_rule_name +CREATE TABLE test_enable_always_rule( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_enable_always_rule", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_enable_always_rule (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +CREATE RULE sample_rule_enable_always AS + ON UPDATE TO test_enable_always_rule + DO INSTEAD + SELECT * FROM test_enable_always_rule; +NOTICE: deparsed json: {"fmt": "CREATE RULE %{or_replace}s %{identity}I AS ON %{event}s TO %{table}D %{where_clause}s DO %{instead}s %{actions:; }s", "event": "UPDATE", "table": {"objname": "test_enable_always_rule", "schemaname": "public"}, "actions": ["SELECT test_enable_always_rule.id, test_enable_always_rule.name, test_enable_always_rule.description, test_enable_always_rule.price, test_enable_always_rule.quantity, test_enable_always_rule.purchase_date FROM public.test_enable_always_rule"], "instead": "INSTEAD", "identity": "sample_rule_enable_always", "or_replace": "", "where_clause": {"fmt": "WHERE %{clause}s", "clause": null, "present": false}} +NOTICE: re-formed command: CREATE RULE sample_rule_enable_always AS ON UPDATE TO public.test_enable_always_rule DO INSTEAD SELECT test_enable_always_rule.id, test_enable_always_rule.name, test_enable_always_rule.description, test_enable_always_rule.price, test_enable_always_rule.quantity, test_enable_always_rule.purchase_date FROM public.test_enable_always_rule +ALTER TABLE test_enable_always_rule ENABLE REPLICA RULE sample_rule_enable_always; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ENABLE REPLICA RULE %{rule}I", "rule": "sample_rule_enable_always", "type": "enable replica rule"}], "identity": {"objname": "test_enable_always_rule", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_enable_always_rule ENABLE REPLICA RULE sample_rule_enable_always +-- DISABLE ROW LEVEL SECURITY +CREATE TABLE test_disable_row_security( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_disable_row_security", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_disable_row_security (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_disable_row_security DISABLE ROW LEVEL SECURITY; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "DISABLE ROW LEVEL SECURITY", "type": "disable row security"}], "identity": {"objname": "test_disable_row_security", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_disable_row_security DISABLE ROW LEVEL SECURITY +-- ENABLE ROW LEVEL SECURITY +CREATE TABLE test_enable_row_security( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_enable_row_security", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_enable_row_security (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_enable_row_security ENABLE ROW LEVEL SECURITY; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ENABLE ROW LEVEL SECURITY", "type": "enable row security"}], "identity": {"objname": "test_enable_row_security", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_enable_row_security ENABLE ROW LEVEL SECURITY +-- FORCE ROW LEVEL SECURITY +CREATE TABLE test_force_row_security( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_force_row_security", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_force_row_security (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_force_row_security FORCE ROW LEVEL SECURITY; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "FORCE ROW LEVEL SECURITY"}], "identity": {"objname": "test_force_row_security", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_force_row_security FORCE ROW LEVEL SECURITY +-- NO FORCE ROW LEVEL SECURITY +CREATE TABLE test_no_force_row_security( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_no_force_row_security", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_no_force_row_security (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_no_force_row_security NO FORCE ROW LEVEL SECURITY; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "NO FORCE ROW LEVEL SECURITY"}], "identity": {"objname": "test_no_force_row_security", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_no_force_row_security NO FORCE ROW LEVEL SECURITY +-- CLUSTER ON index_name +CREATE TABLE test_cluster( + LIKE orders, + PRIMARY KEY (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_cluster", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_cluster_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.test_cluster (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , CONSTRAINT test_cluster_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +ALTER TABLE test_cluster CLUSTER ON test_cluster_pkey; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "CLUSTER ON %{index}I", "type": "cluster on", "index": "test_cluster_pkey"}], "identity": {"objname": "test_cluster", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_cluster CLUSTER ON test_cluster_pkey +-- SET WITHOUT CLUSTER +CREATE TABLE test_without_cluster( + LIKE orders, + PRIMARY KEY (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_without_cluster", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_without_cluster_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.test_without_cluster (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , CONSTRAINT test_without_cluster_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +ALTER TABLE test_without_cluster CLUSTER ON test_without_cluster_pkey; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "CLUSTER ON %{index}I", "type": "cluster on", "index": "test_without_cluster_pkey"}], "identity": {"objname": "test_without_cluster", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_without_cluster CLUSTER ON test_without_cluster_pkey +ALTER TABLE test_without_cluster SET WITHOUT CLUSTER; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "SET WITHOUT CLUSTER", "type": "set without cluster"}], "identity": {"objname": "test_without_cluster", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_without_cluster SET WITHOUT CLUSTER +-- SET WITHOUT OIDS +CREATE TABLE test_set_without_oids( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_without_oids", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_without_oids (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_without_oids SET WITHOUT OIDS; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "SET WITHOUT OIDS", "type": "set without oids"}], "identity": {"objname": "test_set_without_oids", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_without_oids SET WITHOUT OIDS +-- SET ACCESS METHOD new_access_method +CREATE TABLE test_set_access_method( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_access_method", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_access_method (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_access_method SET ACCESS METHOD heap; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "SET ACCESS METHOD %{access_method}I", "type": "set access method", "access_method": "heap"}], "identity": {"objname": "test_set_access_method", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_access_method SET ACCESS METHOD heap +-- SET TABLESPACE new_tablespace +CREATE TABLE test_set_tablespace( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_tablespace", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_tablespace (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_tablespace SET TABLESPACE pg_default; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "SET TABLESPACE %{tablespace}I", "type": "set tablespace", "tablespace": "pg_default"}], "identity": {"objname": "test_set_tablespace", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_tablespace SET TABLESPACE pg_default +-- SET { LOGGED | UNLOGGED } +CREATE TABLE test_set_logged( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_logged", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_logged (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_logged SET LOGGED; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "SET LOGGED", "type": "set logged"}], "identity": {"objname": "test_set_logged", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_logged SET LOGGED +CREATE TABLE test_set_unlogged( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_unlogged", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_unlogged (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_unlogged SET UNLOGGED; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "SET UNLOGGED", "type": "set unlogged"}], "identity": {"objname": "test_set_unlogged", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_unlogged SET UNLOGGED +-- SET ( storage_parameter [= value] [, ... ] ) +CREATE TABLE test_set_storage_params1( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_storage_params1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_storage_params1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_storage_params1 SET (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "%{set_reset}s (%{options:, }s)", "options": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "autovacuum_vacuum_scale_factor"}, "value": "0.2"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_truncate"}, "value": "true"}], "set_reset": "SET"}], "identity": {"objname": "test_set_storage_params1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_storage_params1 SET (vacuum_index_cleanup = 'on', autovacuum_vacuum_scale_factor = '0.2', vacuum_truncate = 'true') +CREATE TABLE test_set_storage_params2( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_storage_params2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_storage_params2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_storage_params2 SET (vacuum_index_cleanup = ON); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "%{set_reset}s (%{options:, }s)", "options": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}], "set_reset": "SET"}], "identity": {"objname": "test_set_storage_params2", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_storage_params2 SET (vacuum_index_cleanup = 'on') +-- RESET ( storage_parameter [, ... ] ) +CREATE TABLE test_reset_storage_params1( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_reset_storage_params1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_reset_storage_params1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_storage_params1 SET (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "%{set_reset}s (%{options:, }s)", "options": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "autovacuum_vacuum_scale_factor"}, "value": "0.2"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_truncate"}, "value": "true"}], "set_reset": "SET"}], "identity": {"objname": "test_set_storage_params1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_storage_params1 SET (vacuum_index_cleanup = 'on', autovacuum_vacuum_scale_factor = '0.2', vacuum_truncate = 'true') +ALTER TABLE test_reset_storage_params1 RESET (vacuum_index_cleanup, autovacuum_vacuum_scale_factor, vacuum_truncate); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "%{set_reset}s (%{options:, }s)", "options": [{"fmt": "%{label}s", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}}, {"fmt": "%{label}s", "label": {"fmt": "%{label}I", "label": "autovacuum_vacuum_scale_factor"}}, {"fmt": "%{label}s", "label": {"fmt": "%{label}I", "label": "vacuum_truncate"}}], "set_reset": "RESET"}], "identity": {"objname": "test_reset_storage_params1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_reset_storage_params1 RESET (vacuum_index_cleanup, autovacuum_vacuum_scale_factor, vacuum_truncate) +CREATE TABLE test_reset_storage_params2( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_reset_storage_params2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_reset_storage_params2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_set_storage_params2 SET (vacuum_index_cleanup = ON); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "%{set_reset}s (%{options:, }s)", "options": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}], "set_reset": "SET"}], "identity": {"objname": "test_set_storage_params2", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_set_storage_params2 SET (vacuum_index_cleanup = 'on') +ALTER TABLE test_reset_storage_params2 RESET (vacuum_index_cleanup); +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "%{set_reset}s (%{options:, }s)", "options": [{"fmt": "%{label}s", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}}], "set_reset": "RESET"}], "identity": {"objname": "test_reset_storage_params2", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_reset_storage_params2 RESET (vacuum_index_cleanup) +-- INHERIT parent_table +CREATE TABLE test_inherit_parent( + parent_id int +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_inherit_parent", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "parent_id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_inherit_parent (parent_id pg_catalog.int4 STORAGE plain ) +CREATE TABLE test_inherit_child( + parent_id int, + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_inherit_child", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "parent_id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_inherit_child (parent_id pg_catalog.int4 STORAGE plain , id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_inherit_child INHERIT test_inherit_parent; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "INHERIT %{parent}D", "type": "inherit", "parent": {"objname": "test_inherit_parent", "schemaname": "public"}}], "identity": {"objname": "test_inherit_child", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_inherit_child INHERIT public.test_inherit_parent +-- NO INHERIT parent_table +CREATE TABLE test_no_inherit_parent( + parent_id int +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_no_inherit_parent", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "parent_id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_no_inherit_parent (parent_id pg_catalog.int4 STORAGE plain ) +CREATE TABLE test_no_inherit_child( + LIKE orders +) INHERITS (test_no_inherit_parent); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_no_inherit_child", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": [{"objname": "test_no_inherit_parent", "schemaname": "public"}]}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_no_inherit_child (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) INHERITS (public.test_no_inherit_parent) +ALTER TABLE test_no_inherit_child NO INHERIT test_no_inherit_parent; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "NO INHERIT %{parent}D", "type": "drop inherit", "parent": {"objname": "test_no_inherit_parent", "schemaname": "public"}}], "identity": {"objname": "test_no_inherit_child", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_no_inherit_child NO INHERIT public.test_no_inherit_parent +-- OF type_name +CREATE TYPE test_type_product_type AS ( + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE TYPE %{identity}D AS (%{columns:, }s)", "columns": [{"fmt": "%{name}I %{coltype}T %{compression}s %{collation}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE", "present": false}, "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}}, {"fmt": "%{name}I %{coltype}T %{compression}s %{collation}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}}], "identity": {"objname": "test_type_product_type", "schemaname": "public"}} +NOTICE: re-formed command: CREATE TYPE public.test_type_product_type AS (id pg_catalog.int4 , name pg_catalog."varchar" COLLATE pg_catalog."default") +CREATE TABLE test_type( + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_type", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_type (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +ALTER TABLE test_type OF test_type_product_type; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "OF %{type_of}T", "type": "add of", "type_of": {"typmod": "", "typarray": false, "typename": "test_type_product_type", "schemaname": "public"}}], "identity": {"objname": "test_type", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_type OF public.test_type_product_type +-- NOT OF +CREATE TABLE test_type_not_of OF test_type_product_type; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D OF %{of_type}T %{table_elements}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "of_type": {"typmod": "", "typarray": false, "typename": "test_type_product_type", "schemaname": "public"}, "identity": {"objname": "test_type_not_of", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}} +NOTICE: re-formed command: CREATE TABLE public.test_type_not_of OF public.test_type_product_type +ALTER TABLE test_type_not_of NOT OF; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "NOT OF", "type": "not of"}], "identity": {"objname": "test_type_not_of", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_type_not_of NOT OF +-- TODO: This should be tested with ROLE/USER related testing +-- OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER } +-- REPLICA IDENTITY { DEFAULT | USING INDEX index_name | FULL | NOTHING } +CREATE TABLE test_replica_identity1( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_replica_identity1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_replica_identity1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_replica_identity1 REPLICA IDENTITY DEFAULT; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "REPLICA IDENTITY %{ident}s", "type": "replica identity", "ident": "DEFAULT"}], "identity": {"objname": "test_replica_identity1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_replica_identity1 REPLICA IDENTITY DEFAULT +CREATE TABLE test_replica_identity2( + LIKE orders, + PRIMARY KEY (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_replica_identity2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_replica_identity2_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.test_replica_identity2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , CONSTRAINT test_replica_identity2_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +ALTER TABLE test_replica_identity2 REPLICA IDENTITY USING INDEX test_replica_identity2_pkey; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "REPLICA IDENTITY %{ident}s", "type": "replica identity", "ident": {"fmt": "USING INDEX %{index}I", "index": "test_replica_identity2_pkey"}}], "identity": {"objname": "test_replica_identity2", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_replica_identity2 REPLICA IDENTITY USING INDEX test_replica_identity2_pkey +CREATE TABLE test_replica_identity3( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_replica_identity3", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_replica_identity3 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_replica_identity3 REPLICA IDENTITY FULL; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "REPLICA IDENTITY %{ident}s", "type": "replica identity", "ident": "FULL"}], "identity": {"objname": "test_replica_identity3", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_replica_identity3 REPLICA IDENTITY FULL +CREATE TABLE test_replica_identity4( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_replica_identity4", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_replica_identity4 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_replica_identity4 REPLICA IDENTITY NOTHING; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "REPLICA IDENTITY %{ident}s", "type": "replica identity", "ident": "NOTHING"}], "identity": {"objname": "test_replica_identity4", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_replica_identity4 REPLICA IDENTITY NOTHING +-- RENAME [ COLUMN ] column_name TO new_column_name +CREATE TABLE test_alter_col_name( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_alter_col_name", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_alter_col_name (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_alter_col_name RENAME id TO new_id; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{if_exists}s %{identity}D RENAME COLUMN %{colname}I TO %{newname}I", "colname": "id", "newname": "new_id", "objtype": "TABLE", "identity": {"objname": "test_alter_col_name", "schemaname": "public"}, "if_exists": ""} +NOTICE: re-formed command: ALTER TABLE public.test_alter_col_name RENAME COLUMN id TO new_id +ALTER TABLE test_alter_col_name RENAME COLUMN name TO new_name; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{if_exists}s %{identity}D RENAME COLUMN %{colname}I TO %{newname}I", "colname": "name", "newname": "new_name", "objtype": "TABLE", "identity": {"objname": "test_alter_col_name", "schemaname": "public"}, "if_exists": ""} +NOTICE: re-formed command: ALTER TABLE public.test_alter_col_name RENAME COLUMN name TO new_name +-- RENAME CONSTRAINT constraint_name TO new_constraint_name +CREATE TABLE test_alter_constraint_name( + LIKE orders, + CONSTRAINT test_alter_constraint_name_old CHECK (id > 10) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_alter_constraint_name", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "test_alter_constraint_name_old", "type": "constraint", "contype": "check", "definition": "CHECK ((id OPERATOR(pg_catalog.>) 10))"}]} +NOTICE: re-formed command: CREATE TABLE public.test_alter_constraint_name (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain , CONSTRAINT test_alter_constraint_name_old CHECK ((id OPERATOR(pg_catalog.>) 10))) +ALTER TABLE test_alter_constraint_name RENAME CONSTRAINT test_alter_constraint_name_old TO test_alter_constraint_name_new; +NOTICE: deparsed json: {"fmt": "ALTER TABLE %{identity}D RENAME CONSTRAINT %{oldname}I TO %{newname}I", "newname": "test_alter_constraint_name_new", "oldname": "test_alter_constraint_name_old", "identity": {"objname": "test_alter_constraint_name", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.test_alter_constraint_name RENAME CONSTRAINT test_alter_constraint_name_old TO test_alter_constraint_name_new +-- RENAME TO new_name +CREATE TABLE test_rename_table( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_rename_table", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_rename_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +ALTER TABLE test_rename_table RENAME to new_test_rename_table; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{if_exists}s %{identity}D RENAME TO %{newname}I", "newname": "new_test_rename_table", "objtype": "TABLE", "identity": {"objname": "test_rename_table", "schemaname": "public"}, "if_exists": ""} +NOTICE: re-formed command: ALTER TABLE public.test_rename_table RENAME TO new_test_rename_table +-- SET SCHEMA new_schema +CREATE TABLE test_set_schema( + LIKE orders +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_set_schema", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_set_schema (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +CREATE SCHEMA new_test_schema; +NOTICE: deparsed json: {"fmt": "CREATE SCHEMA %{if_not_exists}s %{name}I %{authorization}s", "name": "new_test_schema", "authorization": {"fmt": "AUTHORIZATION %{authorization_role}I", "present": false, "authorization_role": null}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE SCHEMA new_test_schema +ALTER TABLE test_set_schema SET SCHEMA new_test_schema; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}s SET SCHEMA %{newschema}I", "objtype": "TABLE", "identity": "public.test_set_schema", "newschema": "new_test_schema"} +NOTICE: re-formed command: ALTER TABLE public.test_set_schema SET SCHEMA new_test_schema +-- ALTER TABLE ALL IN TABLESPACE name [ OWNED BY role_name [, ... ] ] +-- SET TABLESPACE new_tablespace [ NOWAIT ] +-- TOFIX: can not be caught by ddl_command_end event trigger. +-- Deparse of T_AlterTableMoveAllStmt is not supported, +-- TABLESPACE commands (global object commands) are also not supported. +-- ALTER TABLE ALL IN TABLESPACE pg_default SET TABLESPACE pg_default; +-- ALTER TABLE ALL IN TABLESPACE pg_default OWNED BY ddl_testing_role SET TABLESPACE pg_default; +-- ATTACH PARTITION partition_name { FOR VALUES partition_bound_spec | DEFAULT } +CREATE TABLE test_partition_attach_range( + LIKE orders +) PARTITION BY RANGE (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_partition_attach_range", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "RANGE (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_partition_attach_range (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) PARTITION BY RANGE (id) +CREATE TABLE test_partition_attach_range_p_1( + LIKE test_partition_attach_range +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_partition_attach_range_p_1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_partition_attach_range_p_1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +-- TOFIX +-- ALTER TABLE test_partition_attach_range ATTACH PARTITION test_partition_attach_range_p_1 DEFAULT; +CREATE TABLE test_partition_attach_range_p_2( + LIKE test_partition_attach_range +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_partition_attach_range_p_2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_partition_attach_range_p_2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +-- TOFIX +-- ALTER TABLE test_partition_attach_range ATTACH PARTITION test_partition_attach_range_p_2 FOR VALUES FROM (100) TO (200); +CREATE TABLE test_partition_attach_hash( + LIKE orders +) PARTITION BY HASH (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_partition_attach_hash", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "HASH (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_partition_attach_hash (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) PARTITION BY HASH (id) +CREATE TABLE test_partition_attach_hash_p( + LIKE test_partition_attach_hash +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_partition_attach_hash_p", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_partition_attach_hash_p (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +-- TOFIX +-- ALTER TABLE test_partition_attach_hash ATTACH PARTITION test_partition_attach_hash_p FOR VALUES WITH (MODULUS 10, REMAINDER 1); +CREATE TABLE test_partition_attach_list( + LIKE orders +) PARTITION BY LIST (name); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_partition_attach_list", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "LIST (name)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_partition_attach_list (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) PARTITION BY LIST (name) +CREATE TABLE test_partition_attach_list_p1( + LIKE test_partition_attach_list +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_partition_attach_list_p1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_partition_attach_list_p1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +CREATE TABLE test_partition_attach_list_p2( + LIKE test_partition_attach_list +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_partition_attach_list_p2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_partition_attach_list_p2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) +-- TOFIX +-- ALTER TABLE test_partition_attach_list ATTACH PARTITION test_partition_attach_list_p1 FOR VALUES IN ('key1'); +-- ALTER TABLE test_partition_attach_list ATTACH PARTITION test_partition_attach_list_p2 FOR VALUES IN ('key2', 'key3'); +-- DETACH PARTITION partition_name [ CONCURRENTLY | FINALIZE ] +CREATE TABLE test_detach_partition( + LIKE orders +) PARTITION BY RANGE (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_detach_partition", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "RANGE (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "description", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "price", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "quantity", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "purchase_date", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.test_detach_partition (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , description pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , price pg_catalog.float4 STORAGE plain , quantity pg_catalog.int4 STORAGE plain , purchase_date pg_catalog.date STORAGE plain ) PARTITION BY RANGE (id) +CREATE TABLE test_detach_partition_p1 PARTITION OF test_detach_partition FOR VALUES FROM (1) TO (100); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D PARTITION OF %{parent_identity}D %{table_elements}s %{partition_bound}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_detach_partition_p1", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}, "parent_identity": {"objname": "test_detach_partition", "schemaname": "public"}, "partition_bound": "FOR VALUES FROM (1) TO (100)"} +NOTICE: re-formed command: CREATE TABLE public.test_detach_partition_p1 PARTITION OF public.test_detach_partition FOR VALUES FROM (1) TO (100) +CREATE TABLE test_detach_partition_p2 PARTITION OF test_detach_partition FOR VALUES FROM (101) TO (200); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D PARTITION OF %{parent_identity}D %{table_elements}s %{partition_bound}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_detach_partition_p2", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}, "parent_identity": {"objname": "test_detach_partition", "schemaname": "public"}, "partition_bound": "FOR VALUES FROM (101) TO (200)"} +NOTICE: re-formed command: CREATE TABLE public.test_detach_partition_p2 PARTITION OF public.test_detach_partition FOR VALUES FROM (101) TO (200) +CREATE TABLE test_detach_partition_p3 PARTITION OF test_detach_partition FOR VALUES FROM (201) TO (300); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D PARTITION OF %{parent_identity}D %{table_elements}s %{partition_bound}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "test_detach_partition_p3", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}, "parent_identity": {"objname": "test_detach_partition", "schemaname": "public"}, "partition_bound": "FOR VALUES FROM (201) TO (300)"} +NOTICE: re-formed command: CREATE TABLE public.test_detach_partition_p3 PARTITION OF public.test_detach_partition FOR VALUES FROM (201) TO (300) +-- TOFIX +-- ALTER TABLE test_detach_partition DETACH PARTITION test_detach_partition_p1; +-- ALTER TABLE test_detach_partition DETACH PARTITION test_detach_partition_p2 CONCURRENTLY; +-- TOFIX: FINALIZE option is not testable +-- ALTER TABLE test_detach_partition DETACH PARTITION test_detach_partition_p3 FINALIZE; diff --git a/src/test/modules/test_ddl_deparse_regress/expected/constraints.out b/src/test/modules/test_ddl_deparse_regress/expected/constraints.out new file mode 100644 index 0000000..87931b1 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/expected/constraints.out @@ -0,0 +1,638 @@ +-- column constraint, index_parameters +-- [ CONSTRAINT constraint_name ] +-- { NOT NULL | +CREATE TABLE col_cstr_not_null( + id int CONSTRAINT id_constraint NOT NULL, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_not_null", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_not_null (id pg_catalog.int4 STORAGE plain NOT NULL , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +-- NULL | +CREATE TABLE col_cstr_null( + id int NULL, + name varchar CONSTRAINT name_constraint NOT NULL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_null", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_null (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" NOT NULL ) +-- CHECK ( expression ) [ NO INHERIT ] | +CREATE TABLE col_cstr_check( + id int CHECK (id > 10), + name varchar NOT NULL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_check", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_check_id_check", "type": "constraint", "contype": "check", "definition": "CHECK ((id OPERATOR(pg_catalog.>) 10))"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_check (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" NOT NULL , CONSTRAINT col_cstr_check_id_check CHECK ((id OPERATOR(pg_catalog.>) 10))) +CREATE TABLE col_cstr_check_no_inherit( + id int CHECK (id > 10) NO INHERIT, + name varchar NOT NULL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_check_no_inherit", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_check_no_inherit_id_check", "type": "constraint", "contype": "check", "definition": "CHECK ((id OPERATOR(pg_catalog.>) 10)) NO INHERIT"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_check_no_inherit (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" NOT NULL , CONSTRAINT col_cstr_check_no_inherit_id_check CHECK ((id OPERATOR(pg_catalog.>) 10)) NO INHERIT) +-- DEFAULT default_expr | +CREATE TABLE col_cstr_default( + id int NOT NULL, + name varchar DEFAULT 'foo' +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_default", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT %{default}s", "default": "'foo'::character varying"}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_default (id pg_catalog.int4 STORAGE plain NOT NULL , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" DEFAULT 'foo'::character varying ) +-- GENERATED ALWAYS AS ( generation_expr ) STORED | +CREATE TABLE col_cstr_generated_always_as( + id int NOT NULL, + id_generated int GENERATED ALWAYS AS ( id * 10 ) STORED +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_generated_always_as", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id_generated", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS (%{generation_expr}s) STORED", "generation_expr": "(id OPERATOR(pg_catalog.*) 10)"}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_generated_always_as (id pg_catalog.int4 STORAGE plain NOT NULL , id_generated pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS ((id OPERATOR(pg_catalog.*) 10)) STORED) +-- GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] | +CREATE TABLE col_cstr_generated_always_as_identity( + id int NOT NULL, + id_generated int GENERATED ALWAYS AS IDENTITY +); +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_generated_always_as_identity", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id_generated", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "ALWAYS"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_generated_always_as_identity (id pg_catalog.int4 STORAGE plain NOT NULL , id_generated pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) ) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE col_cstr_generated_by_default_as_identity_with_options( + id int NOT NULL, + id_generated int GENERATED BY DEFAULT AS IDENTITY ( INCREMENT BY 10 ) +); +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_generated_by_default_as_identity_with_options", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{identity_column}s %{generated_column}s", "name": "id_generated", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "identity_column": {"fmt": "%{identity_type}s ( %{seq_definition: }s )", "identity_type": {"fmt": "GENERATED %{option}s AS IDENTITY", "option": "BY DEFAULT"}, "seq_definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "10", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}]}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_generated_by_default_as_identity_with_options (id pg_catalog.int4 STORAGE plain NOT NULL , id_generated pg_catalog.int4 STORAGE plain GENERATED BY DEFAULT AS IDENTITY ( CACHE 1 NO CYCLE INCREMENT BY 10 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 ) ) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- UNIQUE [ NULLS [ NOT ] DISTINCT ] | +CREATE TABLE col_cstr_unique( + id int NOT NULL, + name varchar UNIQUE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_unique", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_unique_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (name)"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_unique (id pg_catalog.int4 STORAGE plain NOT NULL , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT col_cstr_unique_name_key UNIQUE (name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE col_cstr_unique_nulls_distinct( + id int NOT NULL, + name varchar UNIQUE NULLS DISTINCT +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_unique_nulls_distinct", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_unique_nulls_distinct_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (name)"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_unique_nulls_distinct (id pg_catalog.int4 STORAGE plain NOT NULL , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT col_cstr_unique_nulls_distinct_name_key UNIQUE (name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE col_cstr_unique_nulls_not_distinct( + id int NOT NULL, + name varchar UNIQUE NULLS NOT DISTINCT +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_unique_nulls_not_distinct", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_unique_nulls_not_distinct_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE NULLS NOT DISTINCT (name)"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_unique_nulls_not_distinct (id pg_catalog.int4 STORAGE plain NOT NULL , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT col_cstr_unique_nulls_not_distinct_name_key UNIQUE NULLS NOT DISTINCT (name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- PRIMARY KEY | +CREATE TABLE col_cstr_primary_key( + id int PRIMARY KEY, + name varchar UNIQUE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_primary_key", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_primary_key_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (name)"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_primary_key_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_primary_key (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT col_cstr_primary_key_name_key UNIQUE (name), CONSTRAINT col_cstr_primary_key_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +-- REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] +-- [ ON DELETE referential_action ] [ ON UPDATE referential_action ] } +CREATE TABLE col_cstr_reference_table_default( + id int REFERENCES col_cstr_primary_key, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_default", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_default (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_default_id_fkey", "type": "add constraint", "definition": "FOREIGN KEY (id) REFERENCES public.col_cstr_primary_key(id)"}], "identity": {"objname": "col_cstr_reference_table_default", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_default ADD CONSTRAINT col_cstr_reference_table_default_id_fkey FOREIGN KEY (id) REFERENCES public.col_cstr_primary_key(id) +CREATE TABLE col_cstr_reference_table_column( + id int, + name varchar REFERENCES col_cstr_primary_key (name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name)"}], "identity": {"objname": "col_cstr_reference_table_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column ADD CONSTRAINT col_cstr_reference_table_column_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) +-- [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] +-- skip testing MATCH PARTIAL, which is treated as a syntax error with message +-- ERROR: MATCH PARTIAL not yet implemented +CREATE TABLE col_cstr_reference_table_column_match_full( + id int, + name varchar REFERENCES col_cstr_primary_key (name) MATCH FULL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_match_full", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_match_full (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_match_full_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) MATCH FULL"}], "identity": {"objname": "col_cstr_reference_table_column_match_full", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_match_full ADD CONSTRAINT col_cstr_reference_table_column_match_full_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) MATCH FULL +CREATE TABLE col_cstr_reference_table_column_match_simple( + id int, + name varchar REFERENCES col_cstr_primary_key (name) MATCH SIMPLE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_match_simple", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_match_simple (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_match_simple_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name)"}], "identity": {"objname": "col_cstr_reference_table_column_match_simple", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_match_simple ADD CONSTRAINT col_cstr_reference_table_column_match_simple_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) +-- [ ON DELETE referential_action ] +CREATE TABLE col_cstr_reference_table_column_on_delete_no_action( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE NO ACTION +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_delete_no_action", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_delete_no_action (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_delete_no_action_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name)"}], "identity": {"objname": "col_cstr_reference_table_column_on_delete_no_action", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_delete_no_action ADD CONSTRAINT col_cstr_reference_table_column_on_delete_no_action_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) +CREATE TABLE col_cstr_reference_table_column_on_delete_restrict( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE RESTRICT +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_delete_restrict", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_delete_restrict (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_delete_restrict_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE RESTRICT"}], "identity": {"objname": "col_cstr_reference_table_column_on_delete_restrict", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_delete_restrict ADD CONSTRAINT col_cstr_reference_table_column_on_delete_restrict_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE RESTRICT +CREATE TABLE col_cstr_reference_table_column_on_delete_cascade( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE CASCADE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_delete_cascade", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_delete_cascade (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_delete_cascade_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE CASCADE"}], "identity": {"objname": "col_cstr_reference_table_column_on_delete_cascade", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_delete_cascade ADD CONSTRAINT col_cstr_reference_table_column_on_delete_cascade_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE CASCADE +CREATE TABLE col_cstr_reference_table_column_on_delete_set_null( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET NULL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_delete_set_null", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_delete_set_null (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_delete_set_null_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET NULL"}], "identity": {"objname": "col_cstr_reference_table_column_on_delete_set_null", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_delete_set_null ADD CONSTRAINT col_cstr_reference_table_column_on_delete_set_null_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET NULL +CREATE TABLE col_cstr_reference_table_column_on_delete_set_null_with_column( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET NULL (name), + foo varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET NULL (foo) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_delete_set_null_with_column", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "foo", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_delete_set_null_with_column (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , foo pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_delete_set_null_wi_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET NULL (name)"}, {"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_delete_set_null_wit_foo_fkey", "type": "add constraint", "definition": "FOREIGN KEY (foo) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET NULL (foo)"}], "identity": {"objname": "col_cstr_reference_table_column_on_delete_set_null_with_column", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_delete_set_null_with_column ADD CONSTRAINT col_cstr_reference_table_column_on_delete_set_null_wi_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET NULL (name), ADD CONSTRAINT col_cstr_reference_table_column_on_delete_set_null_wit_foo_fkey FOREIGN KEY (foo) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET NULL (foo) +CREATE TABLE col_cstr_reference_table_column_on_delete_set_default( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET DEFAULT +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_delete_set_default", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_delete_set_default (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_delete_set_default_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET DEFAULT"}], "identity": {"objname": "col_cstr_reference_table_column_on_delete_set_default", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_delete_set_default ADD CONSTRAINT col_cstr_reference_table_column_on_delete_set_default_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET DEFAULT +CREATE TABLE col_cstr_reference_table_column_on_delete_set_default_with_col( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET DEFAULT (name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_delete_set_default_with_col", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_delete_set_default_with_col (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_delete_set_defaul_name_fkey1", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET DEFAULT (name)"}], "identity": {"objname": "col_cstr_reference_table_column_on_delete_set_default_with_col", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_delete_set_default_with_col ADD CONSTRAINT col_cstr_reference_table_column_on_delete_set_defaul_name_fkey1 FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON DELETE SET DEFAULT (name) +-- [ ON UPDATE referential_action ] +CREATE TABLE col_cstr_reference_table_column_on_update_no_action( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE NO ACTION +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_update_no_action", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_update_no_action (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_update_no_action_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name)"}], "identity": {"objname": "col_cstr_reference_table_column_on_update_no_action", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_update_no_action ADD CONSTRAINT col_cstr_reference_table_column_on_update_no_action_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) +CREATE TABLE col_cstr_reference_table_column_on_update_restrict( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE RESTRICT +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_update_restrict", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_update_restrict (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_update_restrict_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON UPDATE RESTRICT"}], "identity": {"objname": "col_cstr_reference_table_column_on_update_restrict", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_update_restrict ADD CONSTRAINT col_cstr_reference_table_column_on_update_restrict_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON UPDATE RESTRICT +CREATE TABLE col_cstr_reference_table_column_on_update_cascade( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE CASCADE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_update_cascade", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_update_cascade (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_update_cascade_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON UPDATE CASCADE"}], "identity": {"objname": "col_cstr_reference_table_column_on_update_cascade", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_update_cascade ADD CONSTRAINT col_cstr_reference_table_column_on_update_cascade_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON UPDATE CASCADE +CREATE TABLE col_cstr_reference_table_column_on_update_set_null( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE SET NULL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_update_set_null", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_update_set_null (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_update_set_null_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON UPDATE SET NULL"}], "identity": {"objname": "col_cstr_reference_table_column_on_update_set_null", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_update_set_null ADD CONSTRAINT col_cstr_reference_table_column_on_update_set_null_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON UPDATE SET NULL +CREATE TABLE col_cstr_reference_table_column_on_update_set_default( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE SET DEFAULT +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_on_update_set_default", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_on_update_set_default (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_on_update_set_default_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON UPDATE SET DEFAULT"}], "identity": {"objname": "col_cstr_reference_table_column_on_update_set_default", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_on_update_set_default ADD CONSTRAINT col_cstr_reference_table_column_on_update_set_default_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) ON UPDATE SET DEFAULT +-- complex combinations +CREATE TABLE col_cstr_reference_table_column_complex_combination1( + id int, + name varchar REFERENCES col_cstr_primary_key (name) MATCH FULL ON DELETE NO ACTION ON UPDATE NO ACTION +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_complex_combination1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_complex_combination1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_complex_combination1_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) MATCH FULL"}], "identity": {"objname": "col_cstr_reference_table_column_complex_combination1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_complex_combination1 ADD CONSTRAINT col_cstr_reference_table_column_complex_combination1_name_fkey FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) MATCH FULL +CREATE TABLE col_cstr_reference_table_column_complex_combination2( + id int REFERENCES col_cstr_primary_key MATCH FULL ON DELETE SET DEFAULT ON UPDATE SET NULL, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_reference_table_column_complex_combination2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_reference_table_column_complex_combination2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_reference_table_column_complex_combination2_id_fkey", "type": "add constraint", "definition": "FOREIGN KEY (id) REFERENCES public.col_cstr_primary_key(id) MATCH FULL ON UPDATE SET NULL ON DELETE SET DEFAULT"}], "identity": {"objname": "col_cstr_reference_table_column_complex_combination2", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_reference_table_column_complex_combination2 ADD CONSTRAINT col_cstr_reference_table_column_complex_combination2_id_fkey FOREIGN KEY (id) REFERENCES public.col_cstr_primary_key(id) MATCH FULL ON UPDATE SET NULL ON DELETE SET DEFAULT +-- [ DEFERRABLE | NOT DEFERRABLE ] +CREATE TABLE col_cstr_deferable( + id int, + name varchar UNIQUE DEFERRABLE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_deferable", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_deferable_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (name) DEFERRABLE"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_deferable (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT col_cstr_deferable_name_key UNIQUE (name) DEFERRABLE) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE col_cstr_not_deferable( + id int PRIMARY KEY NOT DEFERRABLE, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_not_deferable", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_not_deferable_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_not_deferable (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT col_cstr_not_deferable_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] +CREATE TABLE col_cstr_initially_deferred( + id int PRIMARY KEY INITIALLY DEFERRED, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_initially_deferred", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_initially_deferred_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id) DEFERRABLE INITIALLY DEFERRED"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_initially_deferred (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT col_cstr_initially_deferred_pkey PRIMARY KEY (id) DEFERRABLE INITIALLY DEFERRED) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE col_cstr_initially_immediate( + id int, + name varchar UNIQUE INITIALLY IMMEDIATE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_initially_immediate", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "col_cstr_initially_immediate_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (name)"}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_initially_immediate (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT col_cstr_initially_immediate_name_key UNIQUE (name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- complex combination +CREATE TABLE col_cstr_complex_combination( + id int, + name varchar CONSTRAINT name_constraint REFERENCES col_cstr_primary_key (name) MATCH FULL ON DELETE SET DEFAULT ON UPDATE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "col_cstr_complex_combination", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.col_cstr_complex_combination (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "name_constraint", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) MATCH FULL ON UPDATE SET NULL ON DELETE SET DEFAULT"}], "identity": {"objname": "col_cstr_complex_combination", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.col_cstr_complex_combination ADD CONSTRAINT name_constraint FOREIGN KEY (name) REFERENCES public.col_cstr_primary_key(name) MATCH FULL ON UPDATE SET NULL ON DELETE SET DEFAULT +-- part 4: table constraints +-- [ CONSTRAINT constraint_name ] +-- { CHECK ( expression ) [ NO INHERIT ] | +CREATE TABLE tbl_cstr_check_1( + CONSTRAINT id_constraint CHECK (id > 10), + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_check_1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "id_constraint", "type": "constraint", "contype": "check", "definition": "CHECK ((id OPERATOR(pg_catalog.>) 10))"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_check_1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT id_constraint CHECK ((id OPERATOR(pg_catalog.>) 10))) +CREATE TABLE tbl_cstr_check_2( + id int, + name varchar, + CONSTRAINT table_check CHECK (id > 10) NO INHERIT +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_check_2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "table_check", "type": "constraint", "contype": "check", "definition": "CHECK ((id OPERATOR(pg_catalog.>) 10)) NO INHERIT"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_check_2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT table_check CHECK ((id OPERATOR(pg_catalog.>) 10)) NO INHERIT) +CREATE TABLE tbl_cstr_check_no_inherit( + id int, + name varchar, + CHECK (id > 10) NO INHERIT +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_check_no_inherit", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_check_no_inherit_id_check", "type": "constraint", "contype": "check", "definition": "CHECK ((id OPERATOR(pg_catalog.>) 10)) NO INHERIT"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_check_no_inherit (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_check_no_inherit_id_check CHECK ((id OPERATOR(pg_catalog.>) 10)) NO INHERIT) +-- UNIQUE [ NULLS [ NOT ] DISTINCT ] ( column_name [, ... ] ) [ INCLUDE ( column_name [, ...]) ] | +CREATE TABLE tbl_cstr_unique( + id int, + name varchar, + UNIQUE (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_unique", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_unique_id_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_unique (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_unique_id_key UNIQUE (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_unique_multicols( + id int, + name varchar, + UNIQUE (id, name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_unique_multicols", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_unique_multicols_id_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id, name)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_unique_multicols (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_unique_multicols_id_name_key UNIQUE (id, name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_unique_nulls_distinct( + id int, + name varchar, + UNIQUE NULLS DISTINCT (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_unique_nulls_distinct", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_unique_nulls_distinct_id_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_unique_nulls_distinct (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_unique_nulls_distinct_id_key UNIQUE (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_unique_nulls_not_distinct( + id int, + name varchar, + UNIQUE NULLS NOT DISTINCT (id, name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_unique_nulls_not_distinct", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_unique_nulls_not_distinct_id_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE NULLS NOT DISTINCT (id, name)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_unique_nulls_not_distinct (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_unique_nulls_not_distinct_id_name_key UNIQUE NULLS NOT DISTINCT (id, name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_unique_nulls_distinct_include( + id int, + name varchar, + UNIQUE NULLS DISTINCT (id) INCLUDE (name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_unique_nulls_distinct_include", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_unique_nulls_distinct_include_id_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id) INCLUDE (name)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_unique_nulls_distinct_include (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_unique_nulls_distinct_include_id_name_key UNIQUE (id) INCLUDE (name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_unique_nulls_distinct_include_multi( + id int, + name varchar, + info varchar, + UNIQUE NULLS DISTINCT (id) INCLUDE (name, info) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_unique_nulls_distinct_include_multi", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "info", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_unique_nulls_distinct_include_multi_id_name_info_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id) INCLUDE (name, info)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_unique_nulls_distinct_include_multi (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , info pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_unique_nulls_distinct_include_multi_id_name_info_key UNIQUE (id) INCLUDE (name, info)) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- PRIMARY KEY ( column_name [, ... ] ) [ INCLUDE ( column_name [, ...]) ] | +CREATE TABLE tbl_cstr_primary_key( + id int, + name varchar, + PRIMARY KEY (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_primary_key", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_primary_key_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_primary_key (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_primary_key_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_primary_key_multicols( + id int, + name varchar, + PRIMARY KEY (id, name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_primary_key_multicols", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_primary_key_multicols_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id, name)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_primary_key_multicols (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_primary_key_multicols_pkey PRIMARY KEY (id, name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_primary_key_include( + id int, + name varchar, + PRIMARY KEY (id) INCLUDE (name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_primary_key_include", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_primary_key_include_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id) INCLUDE (name)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_primary_key_include (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_primary_key_include_pkey PRIMARY KEY (id) INCLUDE (name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_primary_key_include_multicols( + id int, + name varchar, + info varchar, + PRIMARY KEY (id) INCLUDE (name, info) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_primary_key_include_multicols", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "info", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_primary_key_include_multicols_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id) INCLUDE (name, info)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_primary_key_include_multicols (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , info pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_primary_key_include_multicols_pkey PRIMARY KEY (id) INCLUDE (name, info)) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- EXCLUDE [ USING index_method ] ( exclude_element WITH operator [, ... ] ) index_parameters [ WHERE ( predicate ) ] | +CREATE TABLE tbl_cstr_exclude( + id int, + name varchar, + EXCLUDE (name WITH =) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_name_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (name WITH OPERATOR(pg_catalog.=))"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_name_excl EXCLUDE USING btree (name WITH OPERATOR(pg_catalog.=))) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_exclude_multi( + id int, + name varchar, + EXCLUDE ((id*10) with =, name WITH =) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_multi", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_multi_expr_name_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (((id OPERATOR(pg_catalog.*) 10)) WITH OPERATOR(pg_catalog.=), name WITH OPERATOR(pg_catalog.=))"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_multi (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_multi_expr_name_excl EXCLUDE USING btree (((id OPERATOR(pg_catalog.*) 10)) WITH OPERATOR(pg_catalog.=), name WITH OPERATOR(pg_catalog.=))) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_exclude_index_method( + id int, + name varchar, + EXCLUDE USING btree ((id*10) with =, name WITH =) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_index_method", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_index_method_expr_name_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (((id OPERATOR(pg_catalog.*) 10)) WITH OPERATOR(pg_catalog.=), name WITH OPERATOR(pg_catalog.=))"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_index_method (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_index_method_expr_name_excl EXCLUDE USING btree (((id OPERATOR(pg_catalog.*) 10)) WITH OPERATOR(pg_catalog.=), name WITH OPERATOR(pg_catalog.=))) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- [ INCLUDE ( column_name [, ... ] ) ] +CREATE TABLE tbl_cstr_exclude_with_index_params_include_1( + id int, + name varchar, + EXCLUDE (id WITH =) INCLUDE (name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_with_index_params_include_1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_with_index_params_include_1_id_name_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) INCLUDE (name)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_with_index_params_include_1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_with_index_params_include_1_id_name_excl EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) INCLUDE (name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_exclude_with_index_params_include_2( + id int, + name varchar, + EXCLUDE (id WITH =) INCLUDE (id, name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_with_index_params_include_2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_with_index_params_include_2_id_id1_name_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) INCLUDE (id, name)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_with_index_params_include_2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_with_index_params_include_2_id_id1_name_excl EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) INCLUDE (id, name)) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- [ WITH ( storage_parameter [= value] [, ... ] ) ] +CREATE TABLE tbl_cstr_exclude_with_index_params_storage_1( + id int, + name varchar, + EXCLUDE (id WITH =) WITH (fillfactor = 20) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_with_index_params_storage_1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_with_index_params_storage_1_id_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) WITH (fillfactor='20')"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_with_index_params_storage_1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_with_index_params_storage_1_id_excl EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) WITH (fillfactor='20')) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_exclude_with_index_params_storage_2( + id int, + name varchar, + EXCLUDE (id WITH =) WITH (fillfactor = 20, deduplicate_items = false) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_with_index_params_storage_2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_with_index_params_storage_2_id_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) WITH (fillfactor='20', deduplicate_items='false')"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_with_index_params_storage_2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_with_index_params_storage_2_id_excl EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) WITH (fillfactor='20', deduplicate_items='false')) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- [ USING INDEX TABLESPACE tablespace_name ] +CREATE TABLE tbl_cstr_exclude_with_index_params_tablespace( + id int, + name varchar, + EXCLUDE (id WITH =) USING INDEX TABLESPACE pg_default +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_with_index_params_tablespace", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_with_index_params_tablespace_id_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=))"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_with_index_params_tablespace (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_with_index_params_tablespace_id_excl EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=))) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- index_parameters complex combination +CREATE TABLE tbl_cstr_exclude_with_index_params_complex( + id int, + name varchar, + EXCLUDE (id WITH =) INCLUDE (id, name) WITH (fillfactor = 20, deduplicate_items = false) USING INDEX TABLESPACE pg_default +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_with_index_params_complex", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_with_index_params_complex_id_id1_name_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) INCLUDE (id, name) WITH (fillfactor='20', deduplicate_items='false')"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_with_index_params_complex (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_with_index_params_complex_id_id1_name_excl EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) INCLUDE (id, name) WITH (fillfactor='20', deduplicate_items='false')) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- [ WHERE ( predicate ) ] +CREATE TABLE tbl_cstr_exclude_with_predicate( + id int, + name varchar, + EXCLUDE (id WITH =) WHERE (name<>'foo') +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_with_predicate", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_with_predicate_id_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) WHERE (((name)::pg_catalog.text OPERATOR(pg_catalog.<>) 'foo'::pg_catalog.text))"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_with_predicate (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_with_predicate_id_excl EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=)) WHERE (((name)::pg_catalog.text OPERATOR(pg_catalog.<>) 'foo'::pg_catalog.text))) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- complex combination for table constraint clauses +CREATE TABLE tbl_cstr_exclude_complex_combination( + id int, + name varchar, + EXCLUDE USING btree (id WITH =, name WITH =) INCLUDE (id, name) WITH (fillfactor = 20, deduplicate_items = false) USING INDEX TABLESPACE pg_default WHERE (name<>'foo') +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_exclude_complex_combination", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_exclude_complex_combination_id_name_id1_name1_excl", "type": "constraint", "contype": "exclusion", "definition": "EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=), name WITH OPERATOR(pg_catalog.=)) INCLUDE (id, name) WITH (fillfactor='20', deduplicate_items='false') WHERE (((name)::pg_catalog.text OPERATOR(pg_catalog.<>) 'foo'::pg_catalog.text))"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_exclude_complex_combination (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_exclude_complex_combination_id_name_id1_name1_excl EXCLUDE USING btree (id WITH OPERATOR(pg_catalog.=), name WITH OPERATOR(pg_catalog.=)) INCLUDE (id, name) WITH (fillfactor='20', deduplicate_items='false') WHERE (((name)::pg_catalog.text OPERATOR(pg_catalog.<>) 'foo'::pg_catalog.text))) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ] +-- [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE referential_action ] [ ON UPDATE referential_action ] } +CREATE TABLE tbl_cstr_foreign_table( + id int PRIMARY KEY, + name varchar UNIQUE, + UNIQUE (id, name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_foreign_table", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_foreign_table_id_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id, name)"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_foreign_table_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (name)"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_foreign_table_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_foreign_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_foreign_table_id_name_key UNIQUE (id, name), CONSTRAINT tbl_cstr_foreign_table_name_key UNIQUE (name), CONSTRAINT tbl_cstr_foreign_table_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_foreign_key_simple_1( + id int, + name varchar, + FOREIGN KEY (id) REFERENCES tbl_cstr_foreign_table +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_foreign_key_simple_1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_foreign_key_simple_1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_foreign_key_simple_1_id_fkey", "type": "add constraint", "definition": "FOREIGN KEY (id) REFERENCES public.tbl_cstr_foreign_table(id)"}], "identity": {"objname": "tbl_cstr_foreign_key_simple_1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.tbl_cstr_foreign_key_simple_1 ADD CONSTRAINT tbl_cstr_foreign_key_simple_1_id_fkey FOREIGN KEY (id) REFERENCES public.tbl_cstr_foreign_table(id) +CREATE TABLE tbl_cstr_foreign_key_simple_2( + id int, + name varchar, + FOREIGN KEY (id) REFERENCES tbl_cstr_foreign_table(id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_foreign_key_simple_2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_foreign_key_simple_2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_foreign_key_simple_2_id_fkey", "type": "add constraint", "definition": "FOREIGN KEY (id) REFERENCES public.tbl_cstr_foreign_table(id)"}], "identity": {"objname": "tbl_cstr_foreign_key_simple_2", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.tbl_cstr_foreign_key_simple_2 ADD CONSTRAINT tbl_cstr_foreign_key_simple_2_id_fkey FOREIGN KEY (id) REFERENCES public.tbl_cstr_foreign_table(id) +CREATE TABLE tbl_cstr_foreign_key_multiple_keys( + id int, + name varchar, + FOREIGN KEY (id, name) REFERENCES tbl_cstr_foreign_table (id, name) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_foreign_key_multiple_keys", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_foreign_key_multiple_keys (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_foreign_key_multiple_keys_id_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (id, name) REFERENCES public.tbl_cstr_foreign_table(id, name)"}], "identity": {"objname": "tbl_cstr_foreign_key_multiple_keys", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.tbl_cstr_foreign_key_multiple_keys ADD CONSTRAINT tbl_cstr_foreign_key_multiple_keys_id_name_fkey FOREIGN KEY (id, name) REFERENCES public.tbl_cstr_foreign_table(id, name) +-- some combinations from REFERENCES clause, which is already tested in part 3 +CREATE TABLE tbl_cstr_reference_table_complex_combination1( + id int, + name varchar, + FOREIGN KEY (name) REFERENCES tbl_cstr_foreign_table (name) MATCH SIMPLE ON DELETE CASCADE ON UPDATE SET NULL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_reference_table_complex_combination1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_reference_table_complex_combination1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_reference_table_complex_combination1_name_fkey", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.tbl_cstr_foreign_table(name) ON UPDATE SET NULL ON DELETE CASCADE"}], "identity": {"objname": "tbl_cstr_reference_table_complex_combination1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.tbl_cstr_reference_table_complex_combination1 ADD CONSTRAINT tbl_cstr_reference_table_complex_combination1_name_fkey FOREIGN KEY (name) REFERENCES public.tbl_cstr_foreign_table(name) ON UPDATE SET NULL ON DELETE CASCADE +CREATE TABLE tbl_cstr_reference_table_complex_combination2( + id int, + name varchar, + CONSTRAINT tbl_cstr FOREIGN KEY (id, name) REFERENCES tbl_cstr_foreign_table (id, name) ON DELETE SET NULL (id, name) ON UPDATE SET DEFAULT +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_reference_table_complex_combination2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_reference_table_complex_combination2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr", "type": "add constraint", "definition": "FOREIGN KEY (id, name) REFERENCES public.tbl_cstr_foreign_table(id, name) ON UPDATE SET DEFAULT ON DELETE SET NULL (id, name)"}], "identity": {"objname": "tbl_cstr_reference_table_complex_combination2", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.tbl_cstr_reference_table_complex_combination2 ADD CONSTRAINT tbl_cstr FOREIGN KEY (id, name) REFERENCES public.tbl_cstr_foreign_table(id, name) ON UPDATE SET DEFAULT ON DELETE SET NULL (id, name) +-- [ DEFERRABLE | NOT DEFERRABLE ] +CREATE TABLE tbl_cstr_reference_table_column_deferable( + id int, + name varchar, + UNIQUE (id, name) DEFERRABLE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_reference_table_column_deferable", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_reference_table_column_deferable_id_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id, name) DEFERRABLE"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_reference_table_column_deferable (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_reference_table_column_deferable_id_name_key UNIQUE (id, name) DEFERRABLE) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_reference_table_column_not_deferable( + id int, + name varchar, + PRIMARY KEY (id) NOT DEFERRABLE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_reference_table_column_not_deferable", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_reference_table_column_not_deferable_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_reference_table_column_not_deferable (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_reference_table_column_not_deferable_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] +CREATE TABLE tbl_cstr_reference_table_column_initially_deferred( + id int, + name varchar, + UNIQUE (id, name) INITIALLY DEFERRED +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_reference_table_column_initially_deferred", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_reference_table_column_initially_deferred_id_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (id, name) DEFERRABLE INITIALLY DEFERRED"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_reference_table_column_initially_deferred (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_reference_table_column_initially_deferred_id_name_key UNIQUE (id, name) DEFERRABLE INITIALLY DEFERRED) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE tbl_cstr_reference_table_column_initially_immediate( + id int, + name varchar, + PRIMARY KEY (id) INITIALLY IMMEDIATE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_reference_table_column_initially_immediate", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr_reference_table_column_initially_immediate_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_reference_table_column_initially_immediate (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr_reference_table_column_initially_immediate_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- complex combinations +CREATE TABLE tbl_cstr_reference_table_column_complex_combination1( + id int, + name varchar, + CONSTRAINT tbl_cstr FOREIGN KEY (name) REFERENCES tbl_cstr_foreign_table (name) MATCH FULL ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_reference_table_column_complex_combination1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_reference_table_column_complex_combination1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr", "type": "add constraint", "definition": "FOREIGN KEY (name) REFERENCES public.tbl_cstr_foreign_table(name) MATCH FULL DEFERRABLE INITIALLY DEFERRED"}], "identity": {"objname": "tbl_cstr_reference_table_column_complex_combination1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.tbl_cstr_reference_table_column_complex_combination1 ADD CONSTRAINT tbl_cstr FOREIGN KEY (name) REFERENCES public.tbl_cstr_foreign_table(name) MATCH FULL DEFERRABLE INITIALLY DEFERRED +CREATE TABLE tbl_cstr_reference_table_column_complex_combination2( + id int, + name varchar, + CONSTRAINT tbl_cstr PRIMARY KEY (id, name) NOT DEFERRABLE INITIALLY IMMEDIATE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "tbl_cstr_reference_table_column_complex_combination2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "tbl_cstr", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id, name)"}]} +NOTICE: re-formed command: CREATE TABLE public.tbl_cstr_reference_table_column_complex_combination2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT tbl_cstr PRIMARY KEY (id, name)) +NOTICE: deparsed json: +NOTICE: re-formed command: diff --git a/src/test/modules/test_ddl_deparse_regress/expected/create_extension.out b/src/test/modules/test_ddl_deparse_regress/expected/create_extension.out new file mode 100644 index 0000000..06ccc62 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/expected/create_extension.out @@ -0,0 +1,6 @@ +--- +--- CREATE_EXTENSION +--- +CREATE EXTENSION pg_stat_statements; +NOTICE: deparsed json: {"fmt": "CREATE EXTENSION %{if_not_exists}s %{name}I %{options: }s", "name": "pg_stat_statements", "options": [{"fmt": "SCHEMA %{schema}I", "type": "schema", "schema": "public"}], "if_not_exists": ""} +NOTICE: re-formed command: CREATE EXTENSION pg_stat_statements SCHEMA public diff --git a/src/test/modules/test_ddl_deparse_regress/expected/create_schema.out b/src/test/modules/test_ddl_deparse_regress/expected/create_schema.out new file mode 100644 index 0000000..ea6e86a --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/expected/create_schema.out @@ -0,0 +1,22 @@ +-- +-- CREATE_SCHEMA +-- +CREATE SCHEMA foo; +NOTICE: deparsed json: {"fmt": "CREATE SCHEMA %{if_not_exists}s %{name}I %{authorization}s", "name": "foo", "authorization": {"fmt": "AUTHORIZATION %{authorization_role}I", "present": false, "authorization_role": null}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE SCHEMA foo +CREATE SCHEMA IF NOT EXISTS bar; +NOTICE: deparsed json: {"fmt": "CREATE SCHEMA %{if_not_exists}s %{name}I %{authorization}s", "name": "bar", "authorization": {"fmt": "AUTHORIZATION %{authorization_role}I", "present": false, "authorization_role": null}, "if_not_exists": "IF NOT EXISTS"} +NOTICE: re-formed command: CREATE SCHEMA IF NOT EXISTS bar +CREATE SCHEMA baz; +NOTICE: deparsed json: {"fmt": "CREATE SCHEMA %{if_not_exists}s %{name}I %{authorization}s", "name": "baz", "authorization": {"fmt": "AUTHORIZATION %{authorization_role}I", "present": false, "authorization_role": null}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE SCHEMA baz +-- Will not be created, and will not be handled by the +-- event trigger +CREATE SCHEMA IF NOT EXISTS baz; +NOTICE: schema "baz" already exists, skipping +CREATE SCHEMA element_test + CREATE TABLE foo (id int) +NOTICE: deparsed json: {"fmt": "CREATE SCHEMA %{if_not_exists}s %{name}I %{authorization}s", "name": "element_test", "authorization": {"fmt": "AUTHORIZATION %{authorization_role}I", "present": false, "authorization_role": null}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE SCHEMA element_test +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "foo", "schemaname": "element_test"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE element_test.foo (id pg_catalog.int4 STORAGE plain ) diff --git a/src/test/modules/test_ddl_deparse_regress/expected/create_table.out b/src/test/modules/test_ddl_deparse_regress/expected/create_table.out new file mode 100644 index 0000000..bb21f09 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/expected/create_table.out @@ -0,0 +1,599 @@ +-- part 1: shared prefixes +-- [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] +CREATE TABLE part1_simple_table( + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part1_simple_table", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part1_simple_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TEMPORARY TABLE part1_temp_table0( + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part1_temp_table0", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part1_temp_table0 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TEMP TABLE part1_temp_table( + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part1_temp_table", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part1_temp_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +-- GLOBAL TEMP TATBLE is deprecated, expect warning message and create local temp table +CREATE GLOBAL TEMP TABLE part1_global_temp_table( + id int, + name varchar +); +WARNING: GLOBAL is deprecated in temporary table creation +LINE 1: CREATE GLOBAL TEMP TABLE part1_global_temp_table( + ^ +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part1_global_temp_table", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part1_global_temp_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE LOCAL TEMP TABLE part1_local_temp_table( + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part1_local_temp_table", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part1_local_temp_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE UNLOGGED TABLE part1_unlogged_table( + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part1_unlogged_table", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "UNLOGGED", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE UNLOGGED TABLE public.part1_unlogged_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +-- [ IF NOT EXISTS ] +CREATE TABLE IF NOT EXISTS part1_simple_table( + id int, + name varchar +); +NOTICE: relation "part1_simple_table" already exists, skipping +CREATE TABLE IF NOT EXISTS part1_local_temp_table_not_exists( + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part1_local_temp_table_not_exists", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "IF NOT EXISTS", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE IF NOT EXISTS public.part1_local_temp_table_not_exists (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +-- part 2: shared suffixes +-- [ PARTITION BY { RANGE | LIST | HASH } ( { column_name | ( expression ) } [ COLLATE collation ] [ opclass ] [, ... ] ) ] +CREATE TABLE part2_partition_by_range_simple( + id int, + name varchar +) PARTITION BY RANGE (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_partition_by_range_simple", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "RANGE (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_partition_by_range_simple (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY RANGE (id) +CREATE TABLE part2_partition_by_list_simple( + id int, + name varchar +) PARTITION BY LIST (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_partition_by_list_simple", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "LIST (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_partition_by_list_simple (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY LIST (id) +CREATE TABLE part2_partition_by_hash_simple( + id int, + name varchar +) PARTITION BY HASH (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_partition_by_hash_simple", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "HASH (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_partition_by_hash_simple (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY HASH (id) +CREATE TABLE part2_partition_with_expression( + id int, + name varchar +) PARTITION BY RANGE ((id * 190), name); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_partition_with_expression", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "RANGE (((id OPERATOR(pg_catalog.*) 190)), name)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_partition_with_expression (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY RANGE (((id OPERATOR(pg_catalog.*) 190)), name) +CREATE TABLE part2_partition_with_collation( + id int, + name varchar +) PARTITION BY LIST (name COLLATE "fr_FR"); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_partition_with_collation", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "LIST (name COLLATE pg_catalog.\"fr_FR\")"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_partition_with_collation (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY LIST (name COLLATE pg_catalog."fr_FR") +CREATE TABLE part2_partition_with_opclass( + id int, + name varchar +) PARTITION BY HASH (id int4_ops, name varchar_ops); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_partition_with_opclass", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "HASH (id, name pg_catalog.varchar_ops)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_partition_with_opclass (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY HASH (id, name pg_catalog.varchar_ops) +CREATE TABLE part2_partition_with_collation_opclass( + id int, + name varchar +) PARTITION BY RANGE ((id * 10) int4_ops, name COLLATE "fr_FR" varchar_ops); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_partition_with_collation_opclass", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "RANGE (((id OPERATOR(pg_catalog.*) 10)), name COLLATE pg_catalog.\"fr_FR\" pg_catalog.varchar_ops)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_partition_with_collation_opclass (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY RANGE (((id OPERATOR(pg_catalog.*) 10)), name COLLATE pg_catalog."fr_FR" pg_catalog.varchar_ops) +-- [ USING method ] +-- default method +CREATE TABLE part2_using_default_access_method( + id int, + name varchar +) USING heap; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_using_default_access_method", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "access_method": "heap"}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_using_default_access_method (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) USING heap +-- [ WITH ( storage_parameter [= value] [, ... ] ) | WITHOUT OIDS ] +CREATE TABLE part2_without_oids( + id int, + name varchar +) WITHOUT OIDS; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_without_oids", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_without_oids (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part2_with_one_storage_param( + id int, + name varchar +) WITH (fillfactor = 20); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_with_one_storage_param", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH (%{with:, }s)", "with": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "fillfactor"}, "value": "20"}]}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_with_one_storage_param (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) WITH (fillfactor = '20') +CREATE TABLE part2_with_multiple_storage_params( + id int, + name varchar +) WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_with_multiple_storage_params", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH (%{with:, }s)", "with": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "autovacuum_vacuum_scale_factor"}, "value": "0.2"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_truncate"}, "value": "true"}]}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_with_multiple_storage_params (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) WITH (vacuum_index_cleanup = 'on', autovacuum_vacuum_scale_factor = '0.2', vacuum_truncate = 'true') +-- [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] +CREATE TEMP TABLE part2_on_commit_preserve_rows( + id int, + name varchar +) ON COMMIT PRESERVE ROWS; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_on_commit_preserve_rows", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "on_commit_value": "PRESERVE ROWS"}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part2_on_commit_preserve_rows (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) ON COMMIT PRESERVE ROWS +CREATE TEMP TABLE part2_on_commit_delete_rows( + id int, + name varchar +) ON COMMIT DELETE ROWS; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_on_commit_delete_rows", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "on_commit_value": "DELETE ROWS"}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part2_on_commit_delete_rows (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) ON COMMIT DELETE ROWS +CREATE TEMPORARY TABLE part2_on_commit_drop( + id int, + name varchar +) ON COMMIT DROP; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_on_commit_drop", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "on_commit_value": "DROP"}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part2_on_commit_drop (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) ON COMMIT DROP +-- [ TABLESPACE tablespace_name ] +CREATE TABLE part2_tablespace_pg_default( + id int, + name varchar +) TABLESPACE pg_default; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_tablespace_pg_default", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "tablespace": "pg_default"}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_tablespace_pg_default (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) TABLESPACE pg_default +-- some complex combinations from the components above +CREATE TEMPORARY TABLE part2_combination_1( + id int, + name varchar +) PARTITION BY RANGE (id) ON COMMIT PRESERVE ROWS; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_combination_1", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "on_commit_value": "PRESERVE ROWS"}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "RANGE (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part2_combination_1 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY RANGE (id) ON COMMIT PRESERVE ROWS +CREATE LOCAL TEMP TABLE part2_combination_2( + id int, + name varchar +) USING heap WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) ON COMMIT PRESERVE ROWS TABLESPACE pg_default; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_combination_2", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "on_commit_value": "PRESERVE ROWS"}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "tablespace": "pg_default"}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH (%{with:, }s)", "with": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "autovacuum_vacuum_scale_factor"}, "value": "0.2"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_truncate"}, "value": "true"}]}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "access_method": "heap"}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part2_combination_2 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) USING heap WITH (vacuum_index_cleanup = 'on', autovacuum_vacuum_scale_factor = '0.2', vacuum_truncate = 'true') ON COMMIT PRESERVE ROWS TABLESPACE pg_default +CREATE TABLE part2_combination_3( + id int, + name varchar +) USING heap WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) TABLESPACE pg_default; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part2_combination_3", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "tablespace": "pg_default"}, "persistence": "", "with_clause": {"fmt": "WITH (%{with:, }s)", "with": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "autovacuum_vacuum_scale_factor"}, "value": "0.2"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_truncate"}, "value": "true"}]}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "access_method": "heap"}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part2_combination_3 (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) USING heap WITH (vacuum_index_cleanup = 'on', autovacuum_vacuum_scale_factor = '0.2', vacuum_truncate = 'true') TABLESPACE pg_default +-- part 5: LIKE source_table [ like_option ... ] +CREATE TABLE part5_source_table( + id int, + name varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_source_table", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_source_table (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_source_table2( + id2 int, + name2 varchar +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_source_table2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_source_table2 (id2 pg_catalog.int4 STORAGE plain , name2 pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_like_simple( + LIKE part5_source_table +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_like_simple", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_like_simple (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +-- { INCLUDING | EXCLUDING } { COMMENTS | COMPRESSION | CONSTRAINTS | DEFAULTS | GENERATED | IDENTITY | INDEXES | STATISTICS | STORAGE | ALL } +CREATE TABLE part5_including_all( + LIKE part5_source_table INCLUDING ALL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_including_all", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_including_all (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_including_comments( + LIKE part5_source_table INCLUDING COMMENTS +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_including_comments", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_including_comments (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_including_compression( + LIKE part5_source_table INCLUDING COMPRESSION +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_including_compression", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_including_compression (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_including_defaults( + LIKE part5_source_table INCLUDING DEFAULTS +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_including_defaults", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_including_defaults (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_including_generated( + LIKE part5_source_table INCLUDING GENERATED +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_including_generated", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_including_generated (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_including_identity( + LIKE part5_source_table INCLUDING IDENTITY +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_including_identity", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_including_identity (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_including_indexes( + LIKE part5_source_table INCLUDING INDEXES +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_including_indexes", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_including_indexes (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_including_statistics( + LIKE part5_source_table INCLUDING STATISTICS +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_including_statistics", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_including_statistics (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_including_storage( + LIKE part5_source_table INCLUDING STORAGE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_including_storage", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_including_storage (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_excluding_all( + LIKE part5_source_table EXCLUDING ALL +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_excluding_all", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_excluding_all (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_excluding_comments( + LIKE part5_source_table EXCLUDING COMMENTS +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_excluding_comments", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_excluding_comments (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_excluding_compression( + LIKE part5_source_table EXCLUDING COMPRESSION +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_excluding_compression", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_excluding_compression (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_excluding_defaults( + LIKE part5_source_table EXCLUDING DEFAULTS +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_excluding_defaults", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_excluding_defaults (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_excluding_generated( + LIKE part5_source_table EXCLUDING GENERATED +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_excluding_generated", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_excluding_generated (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_excluding_identity( + LIKE part5_source_table EXCLUDING IDENTITY +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_excluding_identity", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_excluding_identity (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_excluding_indexes( + LIKE part5_source_table EXCLUDING INDEXES +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_excluding_indexes", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_excluding_indexes (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_excluding_statistics( + LIKE part5_source_table EXCLUDING STATISTICS +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_excluding_statistics", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_excluding_statistics (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_excluding_storage( + LIKE part5_source_table EXCLUDING STORAGE +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_excluding_storage", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part5_excluding_storage (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) +CREATE TABLE part5_like_list( + LIKE part5_source_table, + info text, + LIKE part5_source_table2 INCLUDING ALL, + CONSTRAINT primary_key_constraint PRIMARY KEY (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part5_like_list", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "info", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "primary_key_constraint", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.part5_like_list (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , info pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , id2 pg_catalog.int4 STORAGE plain , name2 pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT primary_key_constraint PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +-- part 6: partition specification +-- PARTITION OF parent_table { FOR VALUES partition_bound_spec | DEFAULT } +CREATE TABLE part6_parent_table_range( + id int, + name varchar +) PARTITION BY RANGE (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part6_parent_table_range", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "RANGE (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part6_parent_table_range (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY RANGE (id) +CREATE TABLE part6_parent_table_list( + id int, + name varchar +) PARTITION BY LIST (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part6_parent_table_list", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "LIST (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part6_parent_table_list (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY LIST (id) +CREATE TABLE part6_parent_table_hash( + id int, + name varchar +) PARTITION BY HASH (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part6_parent_table_hash", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "HASH (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part6_parent_table_hash (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) PARTITION BY HASH (id) +CREATE TABLE part6_partition_default PARTITION OF part6_parent_table_range DEFAULT; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D PARTITION OF %{parent_identity}D %{table_elements}s %{partition_bound}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part6_partition_default", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}, "parent_identity": {"objname": "part6_parent_table_range", "schemaname": "public"}, "partition_bound": "DEFAULT"} +NOTICE: re-formed command: CREATE TABLE public.part6_partition_default PARTITION OF public.part6_parent_table_range DEFAULT +-- FROM ( { partition_bound_expr | MINVALUE | MAXVALUE } [, ...] ) +-- TO ( { partition_bound_expr | MINVALUE | MAXVALUE } [, ...] ) | +CREATE TABLE part6_partition_spec_range1 PARTITION OF part6_parent_table_range +FOR VALUES FROM (MINVALUE) TO (2); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D PARTITION OF %{parent_identity}D %{table_elements}s %{partition_bound}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part6_partition_spec_range1", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}, "parent_identity": {"objname": "part6_parent_table_range", "schemaname": "public"}, "partition_bound": "FOR VALUES FROM (MINVALUE) TO (2)"} +NOTICE: re-formed command: CREATE TABLE public.part6_partition_spec_range1 PARTITION OF public.part6_parent_table_range FOR VALUES FROM (MINVALUE) TO (2) +CREATE TABLE part6_partition_spec_range2 PARTITION OF part6_parent_table_range +FOR VALUES FROM (3) TO (MAXVALUE); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D PARTITION OF %{parent_identity}D %{table_elements}s %{partition_bound}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part6_partition_spec_range2", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}, "parent_identity": {"objname": "part6_parent_table_range", "schemaname": "public"}, "partition_bound": "FOR VALUES FROM (3) TO (MAXVALUE)"} +NOTICE: re-formed command: CREATE TABLE public.part6_partition_spec_range2 PARTITION OF public.part6_parent_table_range FOR VALUES FROM (3) TO (MAXVALUE) +-- IN ( partition_bound_expr [, ...] ) | +CREATE TABLE part6_partition_spec_list PARTITION OF part6_parent_table_list +FOR VALUES IN (1, (1+2), (4+5)); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D PARTITION OF %{parent_identity}D %{table_elements}s %{partition_bound}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part6_partition_spec_list", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}, "parent_identity": {"objname": "part6_parent_table_list", "schemaname": "public"}, "partition_bound": "FOR VALUES IN (1, 3, 9)"} +NOTICE: re-formed command: CREATE TABLE public.part6_partition_spec_list PARTITION OF public.part6_parent_table_list FOR VALUES IN (1, 3, 9) +-- WITH ( MODULUS numeric_literal, REMAINDER numeric_literal ) +CREATE TABLE part6_partition_spec_hash PARTITION OF part6_parent_table_hash +FOR VALUES WITH (MODULUS 10, REMAINDER 2); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D PARTITION OF %{parent_identity}D %{table_elements}s %{partition_bound}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part6_partition_spec_hash", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}, "parent_identity": {"objname": "part6_parent_table_hash", "schemaname": "public"}, "partition_bound": "FOR VALUES WITH (modulus 10, remainder 2)"} +NOTICE: re-formed command: CREATE TABLE public.part6_partition_spec_hash PARTITION OF public.part6_parent_table_hash FOR VALUES WITH (modulus 10, remainder 2) +-- part7: create table +-- all data types +CREATE TABLE part7_source_table( + src_id int +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part7_source_table", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "src_id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part7_source_table (src_id pg_catalog.int4 STORAGE plain ) +CREATE TABLE part7_data_types( + var1 int8, + var2 serial8, + var3 bit, + var4 bit[5], + var5 varbit, + var6 varbit[5], + var7 bool, + var8 box, + var9 bytea, + var10 char, + var11 char[8], + var12 varchar, + var13 varchar[5], + var14 cidr, + var15 circle, + var16 date, + var17 double precision, + var18 inet, + var19 int, + var20 int4, + var21 interval, + var22 json, + var23 jsonb, + var24 line, + var25 lseg, + var26 macaddr, + var27 money, + var28 decimal, + var29 decimal(3,1), + var30 path, + var31 pg_lsn, + var32 pg_snapshot, + var33 point, + var34 polygon, + var35 float4, + var36 int2, + var37 serial2, + var38 serial4, + var39 text, + var40 time, + var41 time(3), + var42 timetz, + var43 timetz(3), + var44 timestamp, + var45 timestamp(3), + var46 timestamptz, + var47 timestamptz(3), + var48 tsquery, + var49 tsvector, + var50 txid_snapshot, + var51 uuid, + var52 xml +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s SEQUENCE %{if_not_exists}s %{identity}D %{definition: }s", "identity": {"objname": "part7_data_types_var2_seq", "schemaname": "public"}, "definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "9223372036854775807", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}, {"fmt": "AS %{seqtype}T", "seqtype": {"typmod": "", "typarray": false, "typename": "int8", "schemaname": "pg_catalog"}}], "persistence": "", "if_not_exists": ""} +NOTICE: re-formed command: CREATE SEQUENCE public.part7_data_types_var2_seq CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 RESTART 1 AS pg_catalog.int8 +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s SEQUENCE %{if_not_exists}s %{identity}D %{definition: }s", "identity": {"objname": "part7_data_types_var37_seq", "schemaname": "public"}, "definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "32767", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}, {"fmt": "AS %{seqtype}T", "seqtype": {"typmod": "", "typarray": false, "typename": "int2", "schemaname": "pg_catalog"}}], "persistence": "", "if_not_exists": ""} +NOTICE: re-formed command: CREATE SEQUENCE public.part7_data_types_var37_seq CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 32767 START WITH 1 RESTART 1 AS pg_catalog.int2 +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s SEQUENCE %{if_not_exists}s %{identity}D %{definition: }s", "identity": {"objname": "part7_data_types_var38_seq", "schemaname": "public"}, "definition": [{"fmt": "CACHE %{value}s", "value": "1", "clause": "cache"}, {"no": "NO", "fmt": "%{no}s CYCLE", "clause": "cycle"}, {"fmt": "INCREMENT BY %{value}s", "value": "1", "clause": "seqincrement"}, {"fmt": "MINVALUE %{value}s", "value": "1", "clause": "minvalue"}, {"fmt": "MAXVALUE %{value}s", "value": "2147483647", "clause": "maxvalue"}, {"fmt": "START WITH %{value}s", "value": "1", "clause": "start"}, {"fmt": "RESTART %{value}s", "value": "1", "clause": "restart"}, {"fmt": "AS %{seqtype}T", "seqtype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}}], "persistence": "", "if_not_exists": ""} +NOTICE: re-formed command: CREATE SEQUENCE public.part7_data_types_var38_seq CACHE 1 NO CYCLE INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 RESTART 1 AS pg_catalog.int4 +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part7_data_types", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var1", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int8", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int8", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT %{default}s", "default": "pg_catalog.nextval('public.part7_data_types_var2_seq'::pg_catalog.regclass)"}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var3", "type": "column", "coltype": {"typmod": "(1)", "typarray": false, "typename": "bit", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var4", "type": "column", "coltype": {"typmod": "(1)", "typarray": true, "typename": "bit", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var5", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varbit", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var6", "type": "column", "coltype": {"typmod": "", "typarray": true, "typename": "varbit", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var7", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "bool", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var8", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "box", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var9", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "bytea", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var10", "type": "column", "coltype": {"typmod": "(1)", "typarray": false, "typename": "bpchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var11", "type": "column", "coltype": {"typmod": "(1)", "typarray": true, "typename": "bpchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var12", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var13", "type": "column", "coltype": {"typmod": "", "typarray": true, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var14", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "cidr", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "main", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var15", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "circle", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var16", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "date", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var17", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float8", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var18", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "inet", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "main", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var19", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var20", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var21", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "INTERVAL", "schemaname": ""}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var22", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "json", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var23", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "jsonb", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var24", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "line", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var25", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "lseg", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var26", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "macaddr", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var27", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "money", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var28", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "numeric", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "main", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var29", "type": "column", "coltype": {"typmod": "(3,1)", "typarray": false, "typename": "numeric", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "main", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var30", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "path", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var31", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "pg_lsn", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var32", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "pg_snapshot", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var33", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "point", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var34", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "polygon", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var35", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var36", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int2", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var37", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int2", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT %{default}s", "default": "pg_catalog.nextval('public.part7_data_types_var37_seq'::pg_catalog.regclass)"}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var38", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT %{default}s", "default": "pg_catalog.nextval('public.part7_data_types_var38_seq'::pg_catalog.regclass)"}, "not_null": "NOT NULL", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var39", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var40", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "TIME", "schemaname": ""}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var41", "type": "column", "coltype": {"typmod": "(3) without time zone", "typarray": false, "typename": "TIME", "schemaname": ""}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var42", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "TIME WITH TIME ZONE", "schemaname": ""}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var43", "type": "column", "coltype": {"typmod": "(3) with time zone", "typarray": false, "typename": "TIME", "schemaname": ""}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var44", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "TIMESTAMP", "schemaname": ""}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var45", "type": "column", "coltype": {"typmod": "(3) without time zone", "typarray": false, "typename": "TIMESTAMP", "schemaname": ""}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var46", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "TIMESTAMP WITH TIME ZONE", "schemaname": ""}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var47", "type": "column", "coltype": {"typmod": "(3) with time zone", "typarray": false, "typename": "TIMESTAMP", "schemaname": ""}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var48", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "tsquery", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var49", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "tsvector", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var50", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "txid_snapshot", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var51", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "uuid", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "var52", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "xml", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part7_data_types (var1 pg_catalog.int8 STORAGE plain , var2 pg_catalog.int8 STORAGE plain NOT NULL DEFAULT pg_catalog.nextval('public.part7_data_types_var2_seq'::pg_catalog.regclass) , var3 pg_catalog."bit"(1) STORAGE extended , var4 pg_catalog."bit"(1)[] STORAGE extended , var5 pg_catalog.varbit STORAGE extended , var6 pg_catalog.varbit[] STORAGE extended , var7 pg_catalog.bool STORAGE plain , var8 pg_catalog.box STORAGE plain , var9 pg_catalog.bytea STORAGE extended , var10 pg_catalog.bpchar(1) STORAGE extended COLLATE pg_catalog."default" , var11 pg_catalog.bpchar(1)[] STORAGE extended COLLATE pg_catalog."default" , var12 pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , var13 pg_catalog."varchar"[] STORAGE extended COLLATE pg_catalog."default" , var14 pg_catalog.cidr STORAGE main , var15 pg_catalog.circle STORAGE plain , var16 pg_catalog.date STORAGE plain , var17 pg_catalog.float8 STORAGE plain , var18 pg_catalog.inet STORAGE main , var19 pg_catalog.int4 STORAGE plain , var20 pg_catalog.int4 STORAGE plain , var21 INTERVAL STORAGE plain , var22 pg_catalog.json STORAGE extended , var23 pg_catalog.jsonb STORAGE extended , var24 pg_catalog.line STORAGE plain , var25 pg_catalog.lseg STORAGE plain , var26 pg_catalog.macaddr STORAGE plain , var27 pg_catalog.money STORAGE plain , var28 pg_catalog."numeric" STORAGE main , var29 pg_catalog."numeric"(3,1) STORAGE main , var30 pg_catalog.path STORAGE extended , var31 pg_catalog.pg_lsn STORAGE plain , var32 pg_catalog.pg_snapshot STORAGE extended , var33 pg_catalog.point STORAGE plain , var34 pg_catalog.polygon STORAGE extended , var35 pg_catalog.float4 STORAGE plain , var36 pg_catalog.int2 STORAGE plain , var37 pg_catalog.int2 STORAGE plain NOT NULL DEFAULT pg_catalog.nextval('public.part7_data_types_var37_seq'::pg_catalog.regclass) , var38 pg_catalog.int4 STORAGE plain NOT NULL DEFAULT pg_catalog.nextval('public.part7_data_types_var38_seq'::pg_catalog.regclass) , var39 pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , var40 TIME STORAGE plain , var41 TIME(3) without time zone STORAGE plain , var42 TIME WITH TIME ZONE STORAGE plain , var43 TIME(3) with time zone STORAGE plain , var44 TIMESTAMP STORAGE plain , var45 TIMESTAMP(3) without time zone STORAGE plain , var46 TIMESTAMP WITH TIME ZONE STORAGE plain , var47 TIMESTAMP(3) with time zone STORAGE plain , var48 pg_catalog.tsquery STORAGE plain , var49 pg_catalog.tsvector STORAGE extended , var50 pg_catalog.txid_snapshot STORAGE extended , var51 pg_catalog.uuid STORAGE plain , var52 pg_catalog.xml STORAGE extended ) +NOTICE: deparsed json: {"fmt": "ALTER SEQUENCE %{identity}D %{definition: }s", "identity": {"objname": "part7_data_types_var2_seq", "schemaname": "public"}, "definition": [{"fmt": "OWNED BY %{owner}D", "owner": {"objname": "part7_data_types", "attrname": "var2", "schemaname": "public"}, "clause": "owned"}]} +NOTICE: re-formed command: ALTER SEQUENCE public.part7_data_types_var2_seq OWNED BY public.part7_data_types.var2 +NOTICE: deparsed json: {"fmt": "ALTER SEQUENCE %{identity}D %{definition: }s", "identity": {"objname": "part7_data_types_var37_seq", "schemaname": "public"}, "definition": [{"fmt": "OWNED BY %{owner}D", "owner": {"objname": "part7_data_types", "attrname": "var37", "schemaname": "public"}, "clause": "owned"}]} +NOTICE: re-formed command: ALTER SEQUENCE public.part7_data_types_var37_seq OWNED BY public.part7_data_types.var37 +NOTICE: deparsed json: {"fmt": "ALTER SEQUENCE %{identity}D %{definition: }s", "identity": {"objname": "part7_data_types_var38_seq", "schemaname": "public"}, "definition": [{"fmt": "OWNED BY %{owner}D", "owner": {"objname": "part7_data_types", "attrname": "var38", "schemaname": "public"}, "clause": "owned"}]} +NOTICE: re-formed command: ALTER SEQUENCE public.part7_data_types_var38_seq OWNED BY public.part7_data_types.var38 +CREATE TABLE part7_compression_collate( + str1 varchar COMPRESSION "pglz", + str2 varchar COLLATE "fr_FR" +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part7_compression_collate", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "str1", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "compression_method": "pglz"}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "str2", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "fr_FR", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part7_compression_collate (str1 pg_catalog."varchar" STORAGE extended COMPRESSION pglz COLLATE pg_catalog."default" , str2 pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."fr_FR" ) +CREATE TABLE part7_inherits_parent( + id int, + name varchar +) +INHERITS (part7_data_types, part7_compression_collate); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part7_inherits_parent", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": [{"objname": "part7_data_types", "schemaname": "public"}, {"objname": "part7_compression_collate", "schemaname": "public"}]}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part7_inherits_parent (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" ) INHERITS (public.part7_data_types, public.part7_compression_collate) +CREATE TABLE part7_combine_all_clauses( + id varchar(5) COMPRESSION "pglz" COLLATE "fr_FR" CONSTRAINT id_constraint DEFAULT 'foo', + PRIMARY KEY (id), + LIKE part7_source_table, + name varchar +) +INHERITS (part7_data_types, part7_compression_collate) +USING heap +WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) +TABLESPACE pg_default; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part7_combine_all_clauses", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": [{"objname": "part7_data_types", "schemaname": "public"}, {"objname": "part7_compression_collate", "schemaname": "public"}]}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "tablespace": "pg_default"}, "persistence": "", "with_clause": {"fmt": "WITH (%{with:, }s)", "with": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "autovacuum_vacuum_scale_factor"}, "value": "0.2"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_truncate"}, "value": "true"}]}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "access_method": "heap"}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "(5)", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT %{default}s", "default": "'foo'::character varying"}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "fr_FR", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "compression_method": "pglz"}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "src_id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "part7_combine_all_clauses_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.part7_combine_all_clauses (id pg_catalog."varchar"(5) STORAGE extended COMPRESSION pglz COLLATE pg_catalog."fr_FR" DEFAULT 'foo'::character varying , src_id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT part7_combine_all_clauses_pkey PRIMARY KEY (id)) INHERITS (public.part7_data_types, public.part7_compression_collate) USING heap WITH (vacuum_index_cleanup = 'on', autovacuum_vacuum_scale_factor = '0.2', vacuum_truncate = 'true') TABLESPACE pg_default +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TEMP TABLE part7_combine_all_clauses_temp( + id varchar(5) COMPRESSION "pglz" COLLATE "fr_FR" CONSTRAINT id_constraint DEFAULT 'foo', + PRIMARY KEY (id), + LIKE part7_source_table, + name varchar +) +INHERITS (part7_data_types, part7_compression_collate) +USING heap +WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) +ON COMMIT DELETE ROWS +TABLESPACE pg_default; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part7_combine_all_clauses_temp", "schemaname": "pg_temp"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": [{"objname": "part7_data_types", "schemaname": "public"}, {"objname": "part7_compression_collate", "schemaname": "public"}]}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "on_commit_value": "DELETE ROWS"}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "tablespace": "pg_default"}, "persistence": "TEMPORARY", "with_clause": {"fmt": "WITH (%{with:, }s)", "with": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "autovacuum_vacuum_scale_factor"}, "value": "0.2"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_truncate"}, "value": "true"}]}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "access_method": "heap"}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "(5)", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT %{default}s", "default": "'foo'::character varying"}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "fr_FR", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "compression_method": "pglz"}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "src_id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "part7_combine_all_clauses_temp_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TEMPORARY TABLE pg_temp.part7_combine_all_clauses_temp (id pg_catalog."varchar"(5) STORAGE extended COMPRESSION pglz COLLATE pg_catalog."fr_FR" DEFAULT 'foo'::character varying , src_id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT part7_combine_all_clauses_temp_pkey PRIMARY KEY (id)) INHERITS (public.part7_data_types, public.part7_compression_collate) USING heap WITH (vacuum_index_cleanup = 'on', autovacuum_vacuum_scale_factor = '0.2', vacuum_truncate = 'true') ON COMMIT DELETE ROWS TABLESPACE pg_default +NOTICE: deparsed json: +NOTICE: re-formed command: +-- part8: create typed table +CREATE TYPE part8_people_type AS ( + id int, + name varchar, + height float4, + weight float4 +); +NOTICE: deparsed json: {"fmt": "CREATE TYPE %{identity}D AS (%{columns:, }s)", "columns": [{"fmt": "%{name}I %{coltype}T %{compression}s %{collation}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE", "present": false}, "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}}, {"fmt": "%{name}I %{coltype}T %{compression}s %{collation}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}}, {"fmt": "%{name}I %{coltype}T %{compression}s %{collation}s", "name": "height", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE", "present": false}, "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}}, {"fmt": "%{name}I %{coltype}T %{compression}s %{collation}s", "name": "weight", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "collation": {"fmt": "COLLATE", "present": false}, "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}}], "identity": {"objname": "part8_people_type", "schemaname": "public"}} +NOTICE: re-formed command: CREATE TYPE public.part8_people_type AS (id pg_catalog.int4 , name pg_catalog."varchar" COLLATE pg_catalog."default", height pg_catalog.float4 , weight pg_catalog.float4 ) +CREATE TABLE part8_create_typed_table OF part8_people_type; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D OF %{of_type}T %{table_elements}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "of_type": {"typmod": "", "typarray": false, "typename": "part8_people_type", "schemaname": "public"}, "identity": {"objname": "part8_create_typed_table", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "", "present": false}} +NOTICE: re-formed command: CREATE TABLE public.part8_create_typed_table OF public.part8_people_type +CREATE TABLE part8_create_typed_table_simple OF part8_people_type( + weight, + PRIMARY KEY (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D OF %{of_type}T %{table_elements}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "of_type": {"typmod": "", "typarray": false, "typename": "part8_people_type", "schemaname": "public"}, "identity": {"objname": "part8_create_typed_table_simple", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "(%{elements:, }s)", "elements": [{"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "part8_create_typed_table_simple_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]}} +NOTICE: re-formed command: CREATE TABLE public.part8_create_typed_table_simple OF public.part8_people_type (CONSTRAINT part8_create_typed_table_simple_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET NOT NULL", "type": "set not null", "column": "id"}], "identity": {"objname": "part8_create_typed_table_simple", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.part8_create_typed_table_simple ALTER COLUMN id SET NOT NULL +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE part8_create_typed_table_with_options_constaints OF part8_people_type( + weight WITH OPTIONS NOT NULL, + name UNIQUE, + PRIMARY KEY (id) +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D OF %{of_type}T %{table_elements}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "of_type": {"typmod": "", "typarray": false, "typename": "part8_people_type", "schemaname": "public"}, "identity": {"objname": "part8_create_typed_table_with_options_constaints", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": {"fmt": "(%{elements:, }s)", "elements": [{"fmt": "%{name}I WITH OPTIONS %{not_null}s %{default}s", "name": "weight", "type": "column", "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "part8_create_typed_table_with_options_constaints_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (name)"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "part8_create_typed_table_with_options_constaints_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]}} +NOTICE: re-formed command: CREATE TABLE public.part8_create_typed_table_with_options_constaints OF public.part8_people_type (weight WITH OPTIONS NOT NULL , CONSTRAINT part8_create_typed_table_with_options_constaints_name_key UNIQUE (name), CONSTRAINT part8_create_typed_table_with_options_constaints_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET NOT NULL", "type": "set not null", "column": "id"}], "identity": {"objname": "part8_create_typed_table_with_options_constaints", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.part8_create_typed_table_with_options_constaints ALTER COLUMN id SET NOT NULL +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE part8_create_typed_table_complex_combinations OF part8_people_type( + weight WITH OPTIONS NOT NULL, + name UNIQUE, + PRIMARY KEY (id) +) +USING heap +WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) +TABLESPACE pg_default; +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D OF %{of_type}T %{table_elements}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "of_type": {"typmod": "", "typarray": false, "typename": "part8_people_type", "schemaname": "public"}, "identity": {"objname": "part8_create_typed_table_complex_combinations", "schemaname": "public"}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "tablespace": "pg_default"}, "persistence": "", "with_clause": {"fmt": "WITH (%{with:, }s)", "with": [{"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_index_cleanup"}, "value": "on"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "autovacuum_vacuum_scale_factor"}, "value": "0.2"}, {"fmt": "%{label}s = %{value}L", "label": {"fmt": "%{label}I", "label": "vacuum_truncate"}, "value": "true"}]}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "access_method": "heap"}, "if_not_exists": "", "table_elements": {"fmt": "(%{elements:, }s)", "elements": [{"fmt": "%{name}I WITH OPTIONS %{not_null}s %{default}s", "name": "weight", "type": "column", "default": {"fmt": "DEFAULT", "present": false}, "not_null": "NOT NULL"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "part8_create_typed_table_complex_combinations_name_key", "type": "constraint", "contype": "unique", "definition": "UNIQUE (name)"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "part8_create_typed_table_complex_combinations_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]}} +NOTICE: re-formed command: CREATE TABLE public.part8_create_typed_table_complex_combinations OF public.part8_people_type (weight WITH OPTIONS NOT NULL , CONSTRAINT part8_create_typed_table_complex_combinations_name_key UNIQUE (name), CONSTRAINT part8_create_typed_table_complex_combinations_pkey PRIMARY KEY (id)) USING heap WITH (vacuum_index_cleanup = 'on', autovacuum_vacuum_scale_factor = '0.2', vacuum_truncate = 'true') TABLESPACE pg_default +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET NOT NULL", "type": "set not null", "column": "id"}], "identity": {"objname": "part8_create_typed_table_complex_combinations", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.part8_create_typed_table_complex_combinations ALTER COLUMN id SET NOT NULL +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +-- part9: create table as a partition of parent table, FOR VALUES clause is tested in part 6 +CREATE TABLE part9_parent_table_range( + id int, + name varchar, + height float4, + weight float4 +) PARTITION BY RANGE (height); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part9_parent_table_range", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "RANGE (height)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "height", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "weight", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part9_parent_table_range (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , height pg_catalog.float4 STORAGE plain , weight pg_catalog.float4 STORAGE plain ) PARTITION BY RANGE (height) +CREATE TABLE part9_parent_table_list( + id int, + name varchar, + height float4, + weight float4 +) PARTITION BY LIST (name); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part9_parent_table_list", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "LIST (name)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "height", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "weight", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part9_parent_table_list (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , height pg_catalog.float4 STORAGE plain , weight pg_catalog.float4 STORAGE plain ) PARTITION BY LIST (name) +CREATE TABLE part9_parent_table_hash( + id int, + name varchar, + height float4, + weight float4 +) PARTITION BY HASH (id); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "part9_parent_table_hash", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "definition": "HASH (id)"}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "varchar", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "height", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "weight", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "float4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}]} +NOTICE: re-formed command: CREATE TABLE public.part9_parent_table_hash (id pg_catalog.int4 STORAGE plain , name pg_catalog."varchar" STORAGE extended COLLATE pg_catalog."default" , height pg_catalog.float4 STORAGE plain , weight pg_catalog.float4 STORAGE plain ) PARTITION BY HASH (id) +-- TOFIX +-- CREATE TABLE part9_partition_with_options_constraintscd +-- PARTITION OF part9_parent_table_range ( +-- id PRIMARY KEY, +-- name WITH OPTIONS NOT NULL, +-- weight, +-- CHECK (height > 0) +-- ) +-- FOR VALUES FROM (MINVALUE) TO (2); +-- TOFIX +-- CREATE TABLE part9_partition_with_options_constraints_default +-- PARTITION OF part9_parent_table_range ( +-- id PRIMARY KEY, +-- name WITH OPTIONS NOT NULL, +-- CHECK (height > 0) +-- ) DEFAULT; +-- TOFIX +-- CREATE TABLE part9_partition_complex_combinations +-- PARTITION OF part9_parent_table_range ( +-- id PRIMARY KEY, +-- name WITH OPTIONS NOT NULL, +-- CHECK (height > 0) +-- ) +-- FOR VALUES FROM (3) TO (10) +-- USING heap +-- WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) +-- TABLESPACE pg_default; +-- copied from old create_table.sql +-- Test TableLikeClause is handled properly +CREATE TABLE ctlt1 (a text CHECK (length(a) > 2) PRIMARY KEY, b text); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "ctlt1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "a", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "b", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "ctlt1_a_check", "type": "constraint", "contype": "check", "definition": "CHECK ((pg_catalog.length(a) OPERATOR(pg_catalog.>) 2))"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "ctlt1_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (a)"}]} +NOTICE: re-formed command: CREATE TABLE public.ctlt1 (a pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , b pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT ctlt1_a_check CHECK ((pg_catalog.length(a) OPERATOR(pg_catalog.>) 2)), CONSTRAINT ctlt1_pkey PRIMARY KEY (a)) +NOTICE: deparsed json: +NOTICE: re-formed command: +ALTER TABLE ctlt1 ALTER COLUMN a SET STORAGE MAIN; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET STORAGE %{storage}s", "type": "set storage", "column": "a", "storage": "main"}], "identity": {"objname": "ctlt1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.ctlt1 ALTER COLUMN a SET STORAGE main +ALTER TABLE ctlt1 ALTER COLUMN b SET STORAGE EXTERNAL; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I SET STORAGE %{storage}s", "type": "set storage", "column": "b", "storage": "external"}], "identity": {"objname": "ctlt1", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.ctlt1 ALTER COLUMN b SET STORAGE external +CREATE TABLE ctlt1_like (LIKE ctlt1 INCLUDING ALL); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "ctlt1_like", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "a", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "main", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "b", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "external", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "ctlt1_a_check", "type": "constraint", "contype": "check", "definition": "CHECK ((pg_catalog.length(a) OPERATOR(pg_catalog.>) 2))"}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "ctlt1_like_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (a)"}]} +NOTICE: re-formed command: CREATE TABLE public.ctlt1_like (a pg_catalog.text STORAGE main COLLATE pg_catalog."default" , b pg_catalog.text STORAGE external COLLATE pg_catalog."default" , CONSTRAINT ctlt1_a_check CHECK ((pg_catalog.length(a) OPERATOR(pg_catalog.>) 2)), CONSTRAINT ctlt1_like_pkey PRIMARY KEY (a)) +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: +NOTICE: re-formed command: +-- Test foreign key constraint is handled in a following ALTER TABLE ADD CONSTRAINT FOREIGN KEY REFERENCES subcommand +CREATE TABLE product (id int PRIMARY KEY, name text); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "product", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "name", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "text", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE %{name}D", "name": {"objname": "default", "schemaname": "pg_catalog"}}, "colstorage": "extended", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "product_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (id)"}]} +NOTICE: re-formed command: CREATE TABLE public.product (id pg_catalog.int4 STORAGE plain , name pg_catalog.text STORAGE extended COLLATE pg_catalog."default" , CONSTRAINT product_pkey PRIMARY KEY (id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +CREATE TABLE orders2 (order_id int PRIMARY KEY, product_id int +REFERENCES product (id)); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "orders2", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "order_id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "product_id", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "CONSTRAINT %{name}I %{definition}s", "name": "orders2_pkey", "type": "constraint", "contype": "primary key", "definition": "PRIMARY KEY (order_id)"}]} +NOTICE: re-formed command: CREATE TABLE public.orders2 (order_id pg_catalog.int4 STORAGE plain , product_id pg_catalog.int4 STORAGE plain , CONSTRAINT orders2_pkey PRIMARY KEY (order_id)) +NOTICE: deparsed json: +NOTICE: re-formed command: +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ADD CONSTRAINT %{name}I %{definition}s", "name": "orders2_product_id_fkey", "type": "add constraint", "definition": "FOREIGN KEY (product_id) REFERENCES public.product(id)"}], "identity": {"objname": "orders2", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.orders2 ADD CONSTRAINT orders2_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product(id) +-- Test CREATE and ALTER inherited table +CREATE TABLE gtest30 ( +a int, +b int GENERATED ALWAYS AS (a * 2) STORED +); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D (%{table_elements:, }s) %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "gtest30", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": null, "present": false}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": "", "table_elements": [{"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "a", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS", "present": false}}, {"fmt": "%{name}I %{coltype}T STORAGE %{colstorage}s %{compression}s %{collation}s %{not_null}s %{default}s %{generated_column}s", "name": "b", "type": "column", "coltype": {"typmod": "", "typarray": false, "typename": "int4", "schemaname": "pg_catalog"}, "default": {"fmt": "DEFAULT", "present": false}, "not_null": "", "collation": {"fmt": "COLLATE", "present": false}, "colstorage": "plain", "compression": {"fmt": "COMPRESSION %{compression_method}I", "present": false, "compression_method": null}, "generated_column": {"fmt": "GENERATED ALWAYS AS (%{generation_expr}s) STORED", "generation_expr": "(a OPERATOR(pg_catalog.*) 2)"}}]} +NOTICE: re-formed command: CREATE TABLE public.gtest30 (a pg_catalog.int4 STORAGE plain , b pg_catalog.int4 STORAGE plain GENERATED ALWAYS AS ((a OPERATOR(pg_catalog.*) 2)) STORED) +CREATE TABLE gtest30_1 () INHERITS (gtest30); +NOTICE: deparsed json: {"fmt": "CREATE %{persistence}s TABLE %{if_not_exists}s %{identity}D () %{inherits}s %{partition_by}s %{access_method}s %{with_clause}s %{on_commit}s %{tablespace}s", "identity": {"objname": "gtest30_1", "schemaname": "public"}, "inherits": {"fmt": "INHERITS (%{parents:, }D)", "parents": [{"objname": "gtest30", "schemaname": "public"}]}, "on_commit": {"fmt": "ON COMMIT %{on_commit_value}s", "present": false, "on_commit_value": null}, "tablespace": {"fmt": "TABLESPACE %{tablespace}I", "present": false, "tablespace": null}, "persistence": "", "with_clause": {"fmt": "WITH", "present": false}, "partition_by": {"fmt": "PARTITION BY %{definition}s", "present": false, "definition": null}, "access_method": {"fmt": "USING %{access_method}I", "present": false, "access_method": null}, "if_not_exists": ""} +NOTICE: re-formed command: CREATE TABLE public.gtest30_1 () INHERITS (public.gtest30) +ALTER TABLE gtest30 ALTER COLUMN b DROP EXPRESSION; +NOTICE: deparsed json: {"fmt": "ALTER %{objtype}s %{identity}D %{subcmds:, }s", "objtype": "TABLE", "subcmds": [{"fmt": "ALTER COLUMN %{column}I DROP EXPRESSION %{if_exists}s", "type": "drop expression", "column": "b", "if_exists": ""}], "identity": {"objname": "gtest30", "schemaname": "public"}} +NOTICE: re-formed command: ALTER TABLE public.gtest30 ALTER COLUMN b DROP EXPRESSION diff --git a/src/test/modules/test_ddl_deparse_regress/expected/test_ddl_deparse.out b/src/test/modules/test_ddl_deparse_regress/expected/test_ddl_deparse.out new file mode 100644 index 0000000..ab041b5 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/expected/test_ddl_deparse.out @@ -0,0 +1,20 @@ +CREATE ROLE ddl_testing_role SUPERUSER; +SET ROLE ddl_testing_role; +CREATE EXTENSION test_ddl_deparse_regress; +CREATE OR REPLACE FUNCTION test_ddl_deparse() + RETURNS event_trigger LANGUAGE plpgsql AS +$$ +DECLARE + r record; + deparsed_json text; +BEGIN + FOR r IN SELECT * FROM pg_event_trigger_ddl_commands() + LOOP + deparsed_json = pg_catalog.ddl_deparse_to_json(r.command); + RAISE NOTICE 'deparsed json: %', deparsed_json; + RAISE NOTICE 're-formed command: %', pg_catalog.ddl_deparse_expand_command(deparsed_json); + END LOOP; +END; +$$; +CREATE EVENT TRIGGER test_ddl_deparse +ON ddl_command_end EXECUTE PROCEDURE test_ddl_deparse(); diff --git a/src/test/modules/test_ddl_deparse_regress/meson.build b/src/test/modules/test_ddl_deparse_regress/meson.build new file mode 100644 index 0000000..b2f4e1c --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/meson.build @@ -0,0 +1,45 @@ +# FIXME: prevent install during main install, but not during test :/ + +test_ddl_deparse_regress_sources = files( + 'test_ddl_deparse_regress.c', +) + +if host_system == 'windows' + test_ddl_deparse_regress_sources += rc_lib_gen.process(win32ver_rc, extra_args: [ + '--NAME', 'test_ddl_deparse_regress', + '--FILEDESC', 'test_ddl_deparse_regress - regression testing for DDL deparsing',]) +endif + +test_ddl_deparse_regress = shared_module('test_ddl_deparse_regress', + test_ddl_deparse_regress_sources, + kwargs: pg_mod_args, +) +testprep_targets += test_ddl_deparse_regress + +install_data( + 'test_ddl_deparse_regress.control', + 'test_ddl_deparse_regress--1.0.sql', + kwargs: contrib_data_args, +) + +tests += { + 'name': 'test_ddl_deparse_regress', + 'sd': meson.current_source_dir(), + 'bd': meson.current_build_dir(), + 'regress': { + 'sql': [ + 'test_ddl_deparse', + 'create_extension', + 'create_schema', + 'aggregate', + 'create_table', + 'constraints', + 'alter_table' + ], + }, + 'tap': { + 'tests': [ + 't/001_compare_dumped_results.pl', + ], + }, +} diff --git a/src/test/modules/test_ddl_deparse_regress/sql/aggregate.sql b/src/test/modules/test_ddl_deparse_regress/sql/aggregate.sql new file mode 100644 index 0000000..561b4e1 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/sql/aggregate.sql @@ -0,0 +1,7 @@ +CREATE AGGREGATE newavg(int4) ( + sfunc = int4_avg_accum, stype = _int8, + finalfunc = int8_avg, + initcond1 = '{0,0}' +); + +DROP AGGREGATE newavg(int4); diff --git a/src/test/modules/test_ddl_deparse_regress/sql/alter_table.sql b/src/test/modules/test_ddl_deparse_regress/sql/alter_table.sql new file mode 100644 index 0000000..2761a2e --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/sql/alter_table.sql @@ -0,0 +1,524 @@ +-- parent table defintion +CREATE TABLE orders( + id int, + name varchar, + description text, + price float4, + quantity int, + purchase_date date +); + +-- ALTER TABLE [ IF EXISTS ] [ ONLY ] name [ * ] +-- action [, ... ] +CREATE TABLE parent_table( + LIKE orders +); +CREATE TABLE test_only () INHERITS (parent_table); +ALTER TABLE test_only ADD col1 int; +ALTER TABLE IF EXISTS fake_table ADD col2 int; + +-- ALTER TABLE IF EXISTS ONLY parent_table ADD PRIMARY KEY (id); +ALTER TABLE IF EXISTS parent_table * ADD CHECK (id > 10); + +-- ADD [ COLUMN ] [ IF NOT EXISTS ] column_name data_type [ COLLATE collation ] [ column_constraint [ ... ] ] +CREATE TABLE test_add_column( + LIKE orders +); +ALTER TABLE test_add_column ADD col1 int; +ALTER TABLE test_add_column ADD COLUMN col2 int; +ALTER TABLE test_add_column ADD COLUMN IF NOT EXISTS col2 varchar; +ALTER TABLE test_add_column ADD col3 varchar COLLATE "fr_FR"; +ALTER TABLE test_add_column ADD col4 int CHECK (col4 > 100) UNIQUE; +ALTER TABLE test_add_column ADD COLUMN IF NOT EXISTS col5 text COLLATE "es_ES" DEFAULT 'foo' NOT NULL; + +-- DROP [ COLUMN ] [ IF EXISTS ] column_name [ RESTRICT | CASCADE ] +CREATE TABLE test_drop_column( + LIKE orders, + UNIQUE (id), + UNIQUE (name) +); +CREATE TABLE foreign_table( + id int REFERENCES test_drop_column (id), + name varchar REFERENCES test_drop_column (name) +); +ALTER TABLE test_drop_column DROP price; +ALTER TABLE test_drop_column DROP COLUMN quantity; + +ALTER TABLE test_drop_column DROP IF EXISTS description RESTRICT; +-- TOFIX +-- ALTER TABLE test_drop_column DROP IF EXISTS name CASCADE; + +-- ALTER [ COLUMN ] column_name [ SET DATA ] TYPE data_type [ COLLATE collation ] [ USING expression ] +CREATE TABLE test_alter_type( + LIKE orders +); +ALTER TABLE test_alter_type ALTER price TYPE int; +ALTER TABLE test_alter_type ALTER COLUMN purchase_date TYPE text COLLATE "fr_FR"; +ALTER TABLE test_alter_type ALTER COLUMN quantity SET DATA TYPE float4; +ALTER TABLE test_alter_type ALTER name TYPE int USING id::integer; + + +-- ALTER [ COLUMN ] column_name SET DEFAULT expression +CREATE TABLE test_alter_set_default( + LIKE orders +); +ALTER TABLE test_alter_set_default ALTER price SET DEFAULT 100; +ALTER TABLE test_alter_set_default ALTER COLUMN quantity SET DEFAULT 10; + +-- ALTER [ COLUMN ] column_name DROP DEFAULT +CREATE TABLE test_drop_default( + LIKE orders, + default_price float4 DEFAULT 10.0, + default_name varchar DEFAULT 'foo' +); +ALTER TABLE test_drop_default ALTER default_price DROP DEFAULT; +ALTER TABLE test_drop_default ALTER COLUMN default_name DROP DEFAULT; + +-- ALTER [ COLUMN ] column_name { SET | DROP } NOT NULL +CREATE TABLE test_set_not_null( + LIKE orders, + size int NOT NULL +); +ALTER TABLE test_set_not_null ALTER COLUMN id SET NOT NULL; +ALTER TABLE test_set_not_null ALTER size DROP NOT NULL; + +-- ALTER [ COLUMN ] column_name DROP EXPRESSION [ IF EXISTS ] +CREATE TABLE test_drop_expression( + LIKE orders, + new_id int GENERATED ALWAYS AS ( 3 * ID ) STORED +); +ALTER TABLE test_drop_expression ALTER new_id DROP EXPRESSION; +ALTER TABLE test_drop_expression ALTER id DROP EXPRESSION IF EXISTS; + +-- ALTER [ COLUMN ] column_name ADD GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] +CREATE TABLE test_add_generated( + LIKE orders, + col1 int NOT NULL, + col2 int NOT NULL, + col3 int NOT NULL +); +ALTER TABLE test_add_generated ALTER col1 ADD GENERATED ALWAYS AS IDENTITY; +ALTER TABLE test_add_generated ALTER COLUMN col2 ADD GENERATED BY DEFAULT AS IDENTITY; +ALTER TABLE test_add_generated ALTER col3 ADD GENERATED BY DEFAULT AS IDENTITY ( INCREMENT BY 10 ); + +-- ALTER [ COLUMN ] column_name { SET GENERATED { ALWAYS | BY DEFAULT } | SET sequence_option | RESTART [ [ WITH ] restart ] } [...] +CREATE TABLE test_set_generated( + id1 int GENERATED BY DEFAULT AS IDENTITY, + id2 int GENERATED ALWAYS AS IDENTITY, + id3 int GENERATED ALWAYS AS IDENTITY, + id4 int GENERATED ALWAYS AS IDENTITY, + id5 int GENERATED ALWAYS AS IDENTITY, + id6 int GENERATED ALWAYS AS IDENTITY, + id7 int GENERATED ALWAYS AS IDENTITY +); +ALTER TABLE test_set_generated ALTER id1 SET GENERATED ALWAYS; +ALTER TABLE test_set_generated ALTER id2 SET GENERATED BY DEFAULT; +ALTER TABLE test_set_generated ALTER id3 SET INCREMENT BY 10; +ALTER TABLE test_set_generated ALTER id4 RESTART; +ALTER TABLE test_set_generated ALTER id5 RESTART WITH 101; +ALTER TABLE test_set_generated ALTER id6 RESTART WITH 201; +ALTER TABLE test_set_generated ALTER COLUMN id7 SET GENERATED BY DEFAULT SET INCREMENT BY 100 RESTART WITH 301; + +-- ALTER [ COLUMN ] column_name DROP IDENTITY [ IF EXISTS ] +CREATE TABLE test_drop_identity( + id int, + id_generated int GENERATED ALWAYS AS IDENTITY +); +ALTER TABLE test_drop_identity ALTER id_generated DROP IDENTITY; +ALTER TABLE test_drop_identity ALTER id DROP IDENTITY IF EXISTS; + +-- ALTER [ COLUMN ] column_name SET STATISTICS integer +CREATE TABLE test_set_statistics( + LIKE orders +); +ALTER TABLE test_set_statistics ALTER id SET STATISTICS 1; + +-- ALTER [ COLUMN ] column_name SET ( attribute_option = value [, ... ] ) +CREATE TABLE test_set_attribute( + LIKE orders +); +ALTER TABLE test_set_attribute ALTER name SET (n_distinct = 102); +ALTER TABLE test_set_attribute ALTER id SET (n_distinct_inherited = 99, n_distinct = 9); + +-- ALTER [ COLUMN ] column_name RESET ( attribute_option [, ... ] ) +CREATE TABLE test_reset_attribute( + LIKE orders +); +ALTER TABLE test_reset_attribute ALTER name RESET (n_distinct); +ALTER TABLE test_reset_attribute ALTER id RESET (n_distinct, n_distinct_inherited); + +-- ALTER [ COLUMN ] column_name SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN } +CREATE TABLE test_set_storage( + LIKE orders, + product_name text +); +ALTER TABLE test_set_storage ALTER id SET STORAGE PLAIN; +ALTER TABLE test_set_storage ALTER name SET STORAGE EXTERNAL; +ALTER TABLE test_set_storage ALTER description SET STORAGE EXTENDED; +ALTER TABLE test_set_storage ALTER product_name SET STORAGE MAIN; + +-- ALTER [ COLUMN ] column_name SET COMPRESSION compression_method +CREATE TABLE test_set_compression( + LIKE orders +); +ALTER TABLE test_set_compression ALTER name SET COMPRESSION "lz4"; +ALTER TABLE test_set_compression ALTER COLUMN description SET COMPRESSION "lz4"; + +-- ADD table_constraint [ NOT VALID ] +CREATE TABLE test_add_table_constraint( + LIKE orders +); +ALTER TABLE test_add_table_constraint ADD PRIMARY KEY (id); +ALTER TABLE test_add_table_constraint ADD CONSTRAINT max_name_len CHECK (length(name) < 4) NOT VALID; +ALTER TABLE test_add_table_constraint ADD CHECK (id < 10); + +-- ADD table_constraint_using_index +CREATE TABLE test_add_constraint_using_index( + id1 int, + id2 int, + id3 int, + id4 int, + id5 int, + id6 int, + id7 int +); +CREATE UNIQUE INDEX test_add_constraint_used_index1 ON test_add_constraint_using_index (id1); +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index1; +CREATE UNIQUE INDEX test_add_constraint_used_index2 ON test_add_constraint_using_index (id2); +--TOFIX +-- ALTER TABLE test_add_constraint_using_index ADD CONSTRAINT primary_constraint_using_index PRIMARY KEY USING INDEX test_add_constraint_used_index2; +CREATE UNIQUE INDEX test_add_constraint_used_index3 ON test_add_constraint_using_index (id3); +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index3 DEFERRABLE; +CREATE UNIQUE INDEX test_add_constraint_used_index4 ON test_add_constraint_using_index (id4); +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index4 NOT DEFERRABLE; +CREATE UNIQUE INDEX test_add_constraint_used_index5 ON test_add_constraint_using_index (id5); +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index5 INITIALLY DEFERRED; +CREATE UNIQUE INDEX test_add_constraint_used_index6 ON test_add_constraint_using_index (id6); +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index6 INITIALLY IMMEDIATE; +CREATE UNIQUE INDEX test_add_constraint_used_index7 ON test_add_constraint_using_index (id7); +ALTER TABLE test_add_constraint_using_index ADD UNIQUE USING INDEX test_add_constraint_used_index7 DEFERRABLE INITIALLY DEFERRED; + +-- ALTER CONSTRAINT constraint_name [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] +CREATE TABLE test_alter_constraint_referenced( + id1 int UNIQUE, + id2 int UNIQUE, + id3 int UNIQUE, + id4 int UNIQUE +); +CREATE TABLE test_alter_constraint( + id1 int, + id2 int, + id3 int, + id4 int, + id5 int, + CONSTRAINT alter_cstr1 FOREIGN KEY (id1) REFERENCES test_alter_constraint_referenced (id1) DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT alter_cstr2 FOREIGN KEY (id2) REFERENCES test_alter_constraint_referenced (id2) NOT DEFERRABLE, + CONSTRAINT alter_cstr3 FOREIGN KEY (id3) REFERENCES test_alter_constraint_referenced (id3) DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT alter_cstr4 FOREIGN KEY (id4) REFERENCES test_alter_constraint_referenced (id4) DEFERRABLE INITIALLY IMMEDIATE +); +ALTER TABLE test_alter_constraint ALTER CONSTRAINT alter_cstr1 NOT DEFERRABLE; +ALTER TABLE test_alter_constraint ALTER CONSTRAINT alter_cstr2 DEFERRABLE; +ALTER TABLE test_alter_constraint ALTER CONSTRAINT alter_cstr3 DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE test_alter_constraint ALTER CONSTRAINT alter_cstr4 DEFERRABLE INITIALLY DEFERRED; + +-- VALIDATE CONSTRAINT constraint_name +CREATE TABLE test_validate_constraint( + LIKE orders +); +ALTER TABLE test_validate_constraint ADD CONSTRAINT test_validate_constraint_cstr CHECK (length(name) < 10) NOT VALID; +ALTER TABLE test_validate_constraint VALIDATE CONSTRAINT test_validate_constraint_cstr; + +-- DROP CONSTRAINT [ IF EXISTS ] constraint_name [ RESTRICT | CASCADE ] +CREATE TABLE test_drop_constraint( + LIKE orders, + CONSTRAINT test_drop_constraint_check CHECK (id < 100), + CONSTRAINT test_drop_constraint_uniq UNIQUE (id) +); +CREATE TABLE test_drop_constraint_reference( + id int REFERENCES test_drop_constraint (id), + name varchar, + CONSTRAINT test_drop_constraint_reference_cstr1 CHECK (length(name) < 10) +); +ALTER TABLE test_drop_constraint_reference DROP CONSTRAINT test_drop_constraint_reference_cstr1; +ALTER TABLE test_drop_constraint DROP CONSTRAINT test_drop_constraint_check RESTRICT; +ALTER TABLE test_drop_constraint DROP CONSTRAINT IF EXISTS test_drop_constraint_check RESTRICT; +-- TOFIX +-- ALTER TABLE test_drop_constraint DROP CONSTRAINT test_drop_constraint_uniq CASCADE; + +-- TODO: This should be tested with TRIGGER related testing +-- DISABLE TRIGGER [ trigger_name | ALL | USER ] +-- ENABLE TRIGGER [ trigger_name | ALL | USER ] +-- ENABLE REPLICA TRIGGER trigger_name +-- ENABLE ALWAYS TRIGGER trigger_name + +-- DISABLE RULE rewrite_rule_name +CREATE TABLE test_disable_rule( + LIKE orders +); +CREATE RULE sample_rule1 AS + ON UPDATE TO test_disable_rule + DO INSTEAD + SELECT * FROM test_disable_rule; +ALTER TABLE test_disable_rule DISABLE RULE sample_rule1; + +-- ENABLE RULE rewrite_rule_name +CREATE TABLE test_enable_rule( + LIKE orders +); +CREATE RULE sample_rule2 AS + ON UPDATE TO test_enable_rule + DO INSTEAD + SELECT * FROM test_enable_rule; +ALTER TABLE test_enable_rule DISABLE RULE sample_rule2; +ALTER TABLE test_enable_rule ENABLE RULE sample_rule2; + +-- ENABLE REPLICA RULE rewrite_rule_name +CREATE TABLE test_enable_replica_rule( + LIKE orders +); +CREATE RULE sample_rule_enable_replica AS + ON UPDATE TO test_enable_replica_rule + DO INSTEAD + SELECT * FROM test_enable_replica_rule; +ALTER TABLE test_enable_replica_rule ENABLE REPLICA RULE sample_rule_enable_replica; + +-- ENABLE ALWAYS RULE rewrite_rule_name +CREATE TABLE test_enable_always_rule( + LIKE orders +); +CREATE RULE sample_rule_enable_always AS + ON UPDATE TO test_enable_always_rule + DO INSTEAD + SELECT * FROM test_enable_always_rule; +ALTER TABLE test_enable_always_rule ENABLE REPLICA RULE sample_rule_enable_always; + +-- DISABLE ROW LEVEL SECURITY +CREATE TABLE test_disable_row_security( + LIKE orders +); +ALTER TABLE test_disable_row_security DISABLE ROW LEVEL SECURITY; + +-- ENABLE ROW LEVEL SECURITY +CREATE TABLE test_enable_row_security( + LIKE orders +); +ALTER TABLE test_enable_row_security ENABLE ROW LEVEL SECURITY; + +-- FORCE ROW LEVEL SECURITY +CREATE TABLE test_force_row_security( + LIKE orders +); +ALTER TABLE test_force_row_security FORCE ROW LEVEL SECURITY; + +-- NO FORCE ROW LEVEL SECURITY +CREATE TABLE test_no_force_row_security( + LIKE orders +); +ALTER TABLE test_no_force_row_security NO FORCE ROW LEVEL SECURITY; + +-- CLUSTER ON index_name +CREATE TABLE test_cluster( + LIKE orders, + PRIMARY KEY (id) +); +ALTER TABLE test_cluster CLUSTER ON test_cluster_pkey; + +-- SET WITHOUT CLUSTER +CREATE TABLE test_without_cluster( + LIKE orders, + PRIMARY KEY (id) +); +ALTER TABLE test_without_cluster CLUSTER ON test_without_cluster_pkey; +ALTER TABLE test_without_cluster SET WITHOUT CLUSTER; + +-- SET WITHOUT OIDS +CREATE TABLE test_set_without_oids( + LIKE orders +); +ALTER TABLE test_set_without_oids SET WITHOUT OIDS; + +-- SET ACCESS METHOD new_access_method +CREATE TABLE test_set_access_method( + LIKE orders +); +ALTER TABLE test_set_access_method SET ACCESS METHOD heap; + +-- SET TABLESPACE new_tablespace +CREATE TABLE test_set_tablespace( + LIKE orders +); +ALTER TABLE test_set_tablespace SET TABLESPACE pg_default; + +-- SET { LOGGED | UNLOGGED } +CREATE TABLE test_set_logged( + LIKE orders +); +ALTER TABLE test_set_logged SET LOGGED; +CREATE TABLE test_set_unlogged( + LIKE orders +); +ALTER TABLE test_set_unlogged SET UNLOGGED; + +-- SET ( storage_parameter [= value] [, ... ] ) +CREATE TABLE test_set_storage_params1( + LIKE orders +); +ALTER TABLE test_set_storage_params1 SET (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true); +CREATE TABLE test_set_storage_params2( + LIKE orders +); +ALTER TABLE test_set_storage_params2 SET (vacuum_index_cleanup = ON); + +-- RESET ( storage_parameter [, ... ] ) +CREATE TABLE test_reset_storage_params1( + LIKE orders +); +ALTER TABLE test_set_storage_params1 SET (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true); +ALTER TABLE test_reset_storage_params1 RESET (vacuum_index_cleanup, autovacuum_vacuum_scale_factor, vacuum_truncate); +CREATE TABLE test_reset_storage_params2( + LIKE orders +); +ALTER TABLE test_set_storage_params2 SET (vacuum_index_cleanup = ON); +ALTER TABLE test_reset_storage_params2 RESET (vacuum_index_cleanup); + +-- INHERIT parent_table +CREATE TABLE test_inherit_parent( + parent_id int +); +CREATE TABLE test_inherit_child( + parent_id int, + LIKE orders +); +ALTER TABLE test_inherit_child INHERIT test_inherit_parent; + +-- NO INHERIT parent_table +CREATE TABLE test_no_inherit_parent( + parent_id int +); +CREATE TABLE test_no_inherit_child( + LIKE orders +) INHERITS (test_no_inherit_parent); +ALTER TABLE test_no_inherit_child NO INHERIT test_no_inherit_parent; + +-- OF type_name +CREATE TYPE test_type_product_type AS ( + id int, + name varchar +); +CREATE TABLE test_type( + id int, + name varchar +); +ALTER TABLE test_type OF test_type_product_type; + +-- NOT OF +CREATE TABLE test_type_not_of OF test_type_product_type; +ALTER TABLE test_type_not_of NOT OF; + +-- TODO: This should be tested with ROLE/USER related testing +-- OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER } + +-- REPLICA IDENTITY { DEFAULT | USING INDEX index_name | FULL | NOTHING } +CREATE TABLE test_replica_identity1( + LIKE orders +); +ALTER TABLE test_replica_identity1 REPLICA IDENTITY DEFAULT; +CREATE TABLE test_replica_identity2( + LIKE orders, + PRIMARY KEY (id) +); +ALTER TABLE test_replica_identity2 REPLICA IDENTITY USING INDEX test_replica_identity2_pkey; +CREATE TABLE test_replica_identity3( + LIKE orders +); +ALTER TABLE test_replica_identity3 REPLICA IDENTITY FULL; +CREATE TABLE test_replica_identity4( + LIKE orders +); +ALTER TABLE test_replica_identity4 REPLICA IDENTITY NOTHING; + +-- RENAME [ COLUMN ] column_name TO new_column_name +CREATE TABLE test_alter_col_name( + LIKE orders +); +ALTER TABLE test_alter_col_name RENAME id TO new_id; +ALTER TABLE test_alter_col_name RENAME COLUMN name TO new_name; + +-- RENAME CONSTRAINT constraint_name TO new_constraint_name +CREATE TABLE test_alter_constraint_name( + LIKE orders, + CONSTRAINT test_alter_constraint_name_old CHECK (id > 10) +); +ALTER TABLE test_alter_constraint_name RENAME CONSTRAINT test_alter_constraint_name_old TO test_alter_constraint_name_new; + +-- RENAME TO new_name +CREATE TABLE test_rename_table( + LIKE orders +); +ALTER TABLE test_rename_table RENAME to new_test_rename_table; + +-- SET SCHEMA new_schema +CREATE TABLE test_set_schema( + LIKE orders +); +CREATE SCHEMA new_test_schema; +ALTER TABLE test_set_schema SET SCHEMA new_test_schema; + +-- ALTER TABLE ALL IN TABLESPACE name [ OWNED BY role_name [, ... ] ] +-- SET TABLESPACE new_tablespace [ NOWAIT ] +-- TOFIX: can not be caught by ddl_command_end event trigger. +-- Deparse of T_AlterTableMoveAllStmt is not supported, +-- TABLESPACE commands (global object commands) are also not supported. +-- ALTER TABLE ALL IN TABLESPACE pg_default SET TABLESPACE pg_default; +-- ALTER TABLE ALL IN TABLESPACE pg_default OWNED BY ddl_testing_role SET TABLESPACE pg_default; + +-- ATTACH PARTITION partition_name { FOR VALUES partition_bound_spec | DEFAULT } +CREATE TABLE test_partition_attach_range( + LIKE orders +) PARTITION BY RANGE (id); +CREATE TABLE test_partition_attach_range_p_1( + LIKE test_partition_attach_range +); +-- TOFIX +-- ALTER TABLE test_partition_attach_range ATTACH PARTITION test_partition_attach_range_p_1 DEFAULT; + +CREATE TABLE test_partition_attach_range_p_2( + LIKE test_partition_attach_range +); +-- TOFIX +-- ALTER TABLE test_partition_attach_range ATTACH PARTITION test_partition_attach_range_p_2 FOR VALUES FROM (100) TO (200); +CREATE TABLE test_partition_attach_hash( + LIKE orders +) PARTITION BY HASH (id); +CREATE TABLE test_partition_attach_hash_p( + LIKE test_partition_attach_hash +); +-- TOFIX +-- ALTER TABLE test_partition_attach_hash ATTACH PARTITION test_partition_attach_hash_p FOR VALUES WITH (MODULUS 10, REMAINDER 1); +CREATE TABLE test_partition_attach_list( + LIKE orders +) PARTITION BY LIST (name); +CREATE TABLE test_partition_attach_list_p1( + LIKE test_partition_attach_list +); +CREATE TABLE test_partition_attach_list_p2( + LIKE test_partition_attach_list +); +-- TOFIX +-- ALTER TABLE test_partition_attach_list ATTACH PARTITION test_partition_attach_list_p1 FOR VALUES IN ('key1'); +-- ALTER TABLE test_partition_attach_list ATTACH PARTITION test_partition_attach_list_p2 FOR VALUES IN ('key2', 'key3'); + +-- DETACH PARTITION partition_name [ CONCURRENTLY | FINALIZE ] +CREATE TABLE test_detach_partition( + LIKE orders +) PARTITION BY RANGE (id); +CREATE TABLE test_detach_partition_p1 PARTITION OF test_detach_partition FOR VALUES FROM (1) TO (100); +CREATE TABLE test_detach_partition_p2 PARTITION OF test_detach_partition FOR VALUES FROM (101) TO (200); +CREATE TABLE test_detach_partition_p3 PARTITION OF test_detach_partition FOR VALUES FROM (201) TO (300); +-- TOFIX +-- ALTER TABLE test_detach_partition DETACH PARTITION test_detach_partition_p1; +-- ALTER TABLE test_detach_partition DETACH PARTITION test_detach_partition_p2 CONCURRENTLY; +-- TOFIX: FINALIZE option is not testable +-- ALTER TABLE test_detach_partition DETACH PARTITION test_detach_partition_p3 FINALIZE; + + diff --git a/src/test/modules/test_ddl_deparse_regress/sql/constraints.sql b/src/test/modules/test_ddl_deparse_regress/sql/constraints.sql new file mode 100644 index 0000000..e2d43fa --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/sql/constraints.sql @@ -0,0 +1,385 @@ +-- column constraint, index_parameters + +-- [ CONSTRAINT constraint_name ] +-- { NOT NULL | +CREATE TABLE col_cstr_not_null( + id int CONSTRAINT id_constraint NOT NULL, + name varchar +); + +-- NULL | +CREATE TABLE col_cstr_null( + id int NULL, + name varchar CONSTRAINT name_constraint NOT NULL +); + +-- CHECK ( expression ) [ NO INHERIT ] | +CREATE TABLE col_cstr_check( + id int CHECK (id > 10), + name varchar NOT NULL +); +CREATE TABLE col_cstr_check_no_inherit( + id int CHECK (id > 10) NO INHERIT, + name varchar NOT NULL +); + +-- DEFAULT default_expr | +CREATE TABLE col_cstr_default( + id int NOT NULL, + name varchar DEFAULT 'foo' +); + +-- GENERATED ALWAYS AS ( generation_expr ) STORED | +CREATE TABLE col_cstr_generated_always_as( + id int NOT NULL, + id_generated int GENERATED ALWAYS AS ( id * 10 ) STORED +); + +-- GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] | +CREATE TABLE col_cstr_generated_always_as_identity( + id int NOT NULL, + id_generated int GENERATED ALWAYS AS IDENTITY +); +CREATE TABLE col_cstr_generated_by_default_as_identity_with_options( + id int NOT NULL, + id_generated int GENERATED BY DEFAULT AS IDENTITY ( INCREMENT BY 10 ) +); + +-- UNIQUE [ NULLS [ NOT ] DISTINCT ] | +CREATE TABLE col_cstr_unique( + id int NOT NULL, + name varchar UNIQUE +); +CREATE TABLE col_cstr_unique_nulls_distinct( + id int NOT NULL, + name varchar UNIQUE NULLS DISTINCT +); +CREATE TABLE col_cstr_unique_nulls_not_distinct( + id int NOT NULL, + name varchar UNIQUE NULLS NOT DISTINCT +); + +-- PRIMARY KEY | +CREATE TABLE col_cstr_primary_key( + id int PRIMARY KEY, + name varchar UNIQUE +); + +-- REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] +-- [ ON DELETE referential_action ] [ ON UPDATE referential_action ] } +CREATE TABLE col_cstr_reference_table_default( + id int REFERENCES col_cstr_primary_key, + name varchar +); +CREATE TABLE col_cstr_reference_table_column( + id int, + name varchar REFERENCES col_cstr_primary_key (name) +); +-- [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] +-- skip testing MATCH PARTIAL, which is treated as a syntax error with message +-- ERROR: MATCH PARTIAL not yet implemented +CREATE TABLE col_cstr_reference_table_column_match_full( + id int, + name varchar REFERENCES col_cstr_primary_key (name) MATCH FULL +); +CREATE TABLE col_cstr_reference_table_column_match_simple( + id int, + name varchar REFERENCES col_cstr_primary_key (name) MATCH SIMPLE +); + +-- [ ON DELETE referential_action ] +CREATE TABLE col_cstr_reference_table_column_on_delete_no_action( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE NO ACTION +); +CREATE TABLE col_cstr_reference_table_column_on_delete_restrict( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE RESTRICT +); +CREATE TABLE col_cstr_reference_table_column_on_delete_cascade( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE CASCADE +); +CREATE TABLE col_cstr_reference_table_column_on_delete_set_null( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET NULL +); +CREATE TABLE col_cstr_reference_table_column_on_delete_set_null_with_column( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET NULL (name), + foo varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET NULL (foo) +); +CREATE TABLE col_cstr_reference_table_column_on_delete_set_default( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET DEFAULT +); +CREATE TABLE col_cstr_reference_table_column_on_delete_set_default_with_col( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON DELETE SET DEFAULT (name) +); + +-- [ ON UPDATE referential_action ] +CREATE TABLE col_cstr_reference_table_column_on_update_no_action( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE NO ACTION +); +CREATE TABLE col_cstr_reference_table_column_on_update_restrict( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE RESTRICT +); +CREATE TABLE col_cstr_reference_table_column_on_update_cascade( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE CASCADE +); +CREATE TABLE col_cstr_reference_table_column_on_update_set_null( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE SET NULL +); +CREATE TABLE col_cstr_reference_table_column_on_update_set_default( + id int, + name varchar REFERENCES col_cstr_primary_key (name) ON UPDATE SET DEFAULT +); +-- complex combinations +CREATE TABLE col_cstr_reference_table_column_complex_combination1( + id int, + name varchar REFERENCES col_cstr_primary_key (name) MATCH FULL ON DELETE NO ACTION ON UPDATE NO ACTION +); +CREATE TABLE col_cstr_reference_table_column_complex_combination2( + id int REFERENCES col_cstr_primary_key MATCH FULL ON DELETE SET DEFAULT ON UPDATE SET NULL, + name varchar +); + +-- [ DEFERRABLE | NOT DEFERRABLE ] +CREATE TABLE col_cstr_deferable( + id int, + name varchar UNIQUE DEFERRABLE +); +CREATE TABLE col_cstr_not_deferable( + id int PRIMARY KEY NOT DEFERRABLE, + name varchar +); + +-- [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] +CREATE TABLE col_cstr_initially_deferred( + id int PRIMARY KEY INITIALLY DEFERRED, + name varchar +); +CREATE TABLE col_cstr_initially_immediate( + id int, + name varchar UNIQUE INITIALLY IMMEDIATE +); + +-- complex combination +CREATE TABLE col_cstr_complex_combination( + id int, + name varchar CONSTRAINT name_constraint REFERENCES col_cstr_primary_key (name) MATCH FULL ON DELETE SET DEFAULT ON UPDATE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE +); + +-- part 4: table constraints +-- [ CONSTRAINT constraint_name ] +-- { CHECK ( expression ) [ NO INHERIT ] | +CREATE TABLE tbl_cstr_check_1( + CONSTRAINT id_constraint CHECK (id > 10), + id int, + name varchar +); +CREATE TABLE tbl_cstr_check_2( + id int, + name varchar, + CONSTRAINT table_check CHECK (id > 10) NO INHERIT +); +CREATE TABLE tbl_cstr_check_no_inherit( + id int, + name varchar, + CHECK (id > 10) NO INHERIT +); + +-- UNIQUE [ NULLS [ NOT ] DISTINCT ] ( column_name [, ... ] ) [ INCLUDE ( column_name [, ...]) ] | +CREATE TABLE tbl_cstr_unique( + id int, + name varchar, + UNIQUE (id) +); +CREATE TABLE tbl_cstr_unique_multicols( + id int, + name varchar, + UNIQUE (id, name) +); +CREATE TABLE tbl_cstr_unique_nulls_distinct( + id int, + name varchar, + UNIQUE NULLS DISTINCT (id) +); +CREATE TABLE tbl_cstr_unique_nulls_not_distinct( + id int, + name varchar, + UNIQUE NULLS NOT DISTINCT (id, name) +); +CREATE TABLE tbl_cstr_unique_nulls_distinct_include( + id int, + name varchar, + UNIQUE NULLS DISTINCT (id) INCLUDE (name) +); +CREATE TABLE tbl_cstr_unique_nulls_distinct_include_multi( + id int, + name varchar, + info varchar, + UNIQUE NULLS DISTINCT (id) INCLUDE (name, info) +); + +-- PRIMARY KEY ( column_name [, ... ] ) [ INCLUDE ( column_name [, ...]) ] | +CREATE TABLE tbl_cstr_primary_key( + id int, + name varchar, + PRIMARY KEY (id) +); +CREATE TABLE tbl_cstr_primary_key_multicols( + id int, + name varchar, + PRIMARY KEY (id, name) +); +CREATE TABLE tbl_cstr_primary_key_include( + id int, + name varchar, + PRIMARY KEY (id) INCLUDE (name) +); +CREATE TABLE tbl_cstr_primary_key_include_multicols( + id int, + name varchar, + info varchar, + PRIMARY KEY (id) INCLUDE (name, info) +); + +-- EXCLUDE [ USING index_method ] ( exclude_element WITH operator [, ... ] ) index_parameters [ WHERE ( predicate ) ] | +CREATE TABLE tbl_cstr_exclude( + id int, + name varchar, + EXCLUDE (name WITH =) +); +CREATE TABLE tbl_cstr_exclude_multi( + id int, + name varchar, + EXCLUDE ((id*10) with =, name WITH =) +); +CREATE TABLE tbl_cstr_exclude_index_method( + id int, + name varchar, + EXCLUDE USING btree ((id*10) with =, name WITH =) +); +-- [ INCLUDE ( column_name [, ... ] ) ] +CREATE TABLE tbl_cstr_exclude_with_index_params_include_1( + id int, + name varchar, + EXCLUDE (id WITH =) INCLUDE (name) +); +CREATE TABLE tbl_cstr_exclude_with_index_params_include_2( + id int, + name varchar, + EXCLUDE (id WITH =) INCLUDE (id, name) +); +-- [ WITH ( storage_parameter [= value] [, ... ] ) ] +CREATE TABLE tbl_cstr_exclude_with_index_params_storage_1( + id int, + name varchar, + EXCLUDE (id WITH =) WITH (fillfactor = 20) +); +CREATE TABLE tbl_cstr_exclude_with_index_params_storage_2( + id int, + name varchar, + EXCLUDE (id WITH =) WITH (fillfactor = 20, deduplicate_items = false) +); +-- [ USING INDEX TABLESPACE tablespace_name ] +CREATE TABLE tbl_cstr_exclude_with_index_params_tablespace( + id int, + name varchar, + EXCLUDE (id WITH =) USING INDEX TABLESPACE pg_default +); +-- index_parameters complex combination +CREATE TABLE tbl_cstr_exclude_with_index_params_complex( + id int, + name varchar, + EXCLUDE (id WITH =) INCLUDE (id, name) WITH (fillfactor = 20, deduplicate_items = false) USING INDEX TABLESPACE pg_default +); +-- [ WHERE ( predicate ) ] +CREATE TABLE tbl_cstr_exclude_with_predicate( + id int, + name varchar, + EXCLUDE (id WITH =) WHERE (name<>'foo') +); +-- complex combination for table constraint clauses +CREATE TABLE tbl_cstr_exclude_complex_combination( + id int, + name varchar, + EXCLUDE USING btree (id WITH =, name WITH =) INCLUDE (id, name) WITH (fillfactor = 20, deduplicate_items = false) USING INDEX TABLESPACE pg_default WHERE (name<>'foo') +); + +-- FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ] +-- [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE referential_action ] [ ON UPDATE referential_action ] } +CREATE TABLE tbl_cstr_foreign_table( + id int PRIMARY KEY, + name varchar UNIQUE, + UNIQUE (id, name) +); +CREATE TABLE tbl_cstr_foreign_key_simple_1( + id int, + name varchar, + FOREIGN KEY (id) REFERENCES tbl_cstr_foreign_table +); +CREATE TABLE tbl_cstr_foreign_key_simple_2( + id int, + name varchar, + FOREIGN KEY (id) REFERENCES tbl_cstr_foreign_table(id) +); +CREATE TABLE tbl_cstr_foreign_key_multiple_keys( + id int, + name varchar, + FOREIGN KEY (id, name) REFERENCES tbl_cstr_foreign_table (id, name) +); + +-- some combinations from REFERENCES clause, which is already tested in part 3 +CREATE TABLE tbl_cstr_reference_table_complex_combination1( + id int, + name varchar, + FOREIGN KEY (name) REFERENCES tbl_cstr_foreign_table (name) MATCH SIMPLE ON DELETE CASCADE ON UPDATE SET NULL +); +CREATE TABLE tbl_cstr_reference_table_complex_combination2( + id int, + name varchar, + CONSTRAINT tbl_cstr FOREIGN KEY (id, name) REFERENCES tbl_cstr_foreign_table (id, name) ON DELETE SET NULL (id, name) ON UPDATE SET DEFAULT +); + +-- [ DEFERRABLE | NOT DEFERRABLE ] +CREATE TABLE tbl_cstr_reference_table_column_deferable( + id int, + name varchar, + UNIQUE (id, name) DEFERRABLE +); +CREATE TABLE tbl_cstr_reference_table_column_not_deferable( + id int, + name varchar, + PRIMARY KEY (id) NOT DEFERRABLE +); + +-- [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] +CREATE TABLE tbl_cstr_reference_table_column_initially_deferred( + id int, + name varchar, + UNIQUE (id, name) INITIALLY DEFERRED +); +CREATE TABLE tbl_cstr_reference_table_column_initially_immediate( + id int, + name varchar, + PRIMARY KEY (id) INITIALLY IMMEDIATE +); + +-- complex combinations +CREATE TABLE tbl_cstr_reference_table_column_complex_combination1( + id int, + name varchar, + CONSTRAINT tbl_cstr FOREIGN KEY (name) REFERENCES tbl_cstr_foreign_table (name) MATCH FULL ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +); +CREATE TABLE tbl_cstr_reference_table_column_complex_combination2( + id int, + name varchar, + CONSTRAINT tbl_cstr PRIMARY KEY (id, name) NOT DEFERRABLE INITIALLY IMMEDIATE +); diff --git a/src/test/modules/test_ddl_deparse_regress/sql/create_extension.sql b/src/test/modules/test_ddl_deparse_regress/sql/create_extension.sql new file mode 100644 index 0000000..d23e7fd --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/sql/create_extension.sql @@ -0,0 +1,5 @@ +--- +--- CREATE_EXTENSION +--- + +CREATE EXTENSION pg_stat_statements; diff --git a/src/test/modules/test_ddl_deparse_regress/sql/create_schema.sql b/src/test/modules/test_ddl_deparse_regress/sql/create_schema.sql new file mode 100644 index 0000000..10b13f0 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/sql/create_schema.sql @@ -0,0 +1,16 @@ +-- +-- CREATE_SCHEMA +-- + +CREATE SCHEMA foo; + +CREATE SCHEMA IF NOT EXISTS bar; + +CREATE SCHEMA baz; + +-- Will not be created, and will not be handled by the +-- event trigger +CREATE SCHEMA IF NOT EXISTS baz; + +CREATE SCHEMA element_test + CREATE TABLE foo (id int) diff --git a/src/test/modules/test_ddl_deparse_regress/sql/create_table.sql b/src/test/modules/test_ddl_deparse_regress/sql/create_table.sql new file mode 100644 index 0000000..a51776d --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/sql/create_table.sql @@ -0,0 +1,417 @@ +-- part 1: shared prefixes +-- [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] +CREATE TABLE part1_simple_table( + id int, + name varchar +); +CREATE TEMPORARY TABLE part1_temp_table0( + id int, + name varchar +); +CREATE TEMP TABLE part1_temp_table( + id int, + name varchar +); +-- GLOBAL TEMP TATBLE is deprecated, expect warning message and create local temp table +CREATE GLOBAL TEMP TABLE part1_global_temp_table( + id int, + name varchar +); +CREATE LOCAL TEMP TABLE part1_local_temp_table( + id int, + name varchar +); +CREATE UNLOGGED TABLE part1_unlogged_table( + id int, + name varchar +); +-- [ IF NOT EXISTS ] +CREATE TABLE IF NOT EXISTS part1_simple_table( + id int, + name varchar +); +CREATE TABLE IF NOT EXISTS part1_local_temp_table_not_exists( + id int, + name varchar +); + +-- part 2: shared suffixes +-- [ PARTITION BY { RANGE | LIST | HASH } ( { column_name | ( expression ) } [ COLLATE collation ] [ opclass ] [, ... ] ) ] +CREATE TABLE part2_partition_by_range_simple( + id int, + name varchar +) PARTITION BY RANGE (id); +CREATE TABLE part2_partition_by_list_simple( + id int, + name varchar +) PARTITION BY LIST (id); +CREATE TABLE part2_partition_by_hash_simple( + id int, + name varchar +) PARTITION BY HASH (id); +CREATE TABLE part2_partition_with_expression( + id int, + name varchar +) PARTITION BY RANGE ((id * 190), name); +CREATE TABLE part2_partition_with_collation( + id int, + name varchar +) PARTITION BY LIST (name COLLATE "fr_FR"); +CREATE TABLE part2_partition_with_opclass( + id int, + name varchar +) PARTITION BY HASH (id int4_ops, name varchar_ops); +CREATE TABLE part2_partition_with_collation_opclass( + id int, + name varchar +) PARTITION BY RANGE ((id * 10) int4_ops, name COLLATE "fr_FR" varchar_ops); + +-- [ USING method ] +-- default method +CREATE TABLE part2_using_default_access_method( + id int, + name varchar +) USING heap; + +-- [ WITH ( storage_parameter [= value] [, ... ] ) | WITHOUT OIDS ] +CREATE TABLE part2_without_oids( + id int, + name varchar +) WITHOUT OIDS; +CREATE TABLE part2_with_one_storage_param( + id int, + name varchar +) WITH (fillfactor = 20); +CREATE TABLE part2_with_multiple_storage_params( + id int, + name varchar +) WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true); + +-- [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] +CREATE TEMP TABLE part2_on_commit_preserve_rows( + id int, + name varchar +) ON COMMIT PRESERVE ROWS; +CREATE TEMP TABLE part2_on_commit_delete_rows( + id int, + name varchar +) ON COMMIT DELETE ROWS; +CREATE TEMPORARY TABLE part2_on_commit_drop( + id int, + name varchar +) ON COMMIT DROP; + +-- [ TABLESPACE tablespace_name ] +CREATE TABLE part2_tablespace_pg_default( + id int, + name varchar +) TABLESPACE pg_default; + +-- some complex combinations from the components above +CREATE TEMPORARY TABLE part2_combination_1( + id int, + name varchar +) PARTITION BY RANGE (id) ON COMMIT PRESERVE ROWS; + +CREATE LOCAL TEMP TABLE part2_combination_2( + id int, + name varchar +) USING heap WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) ON COMMIT PRESERVE ROWS TABLESPACE pg_default; + +CREATE TABLE part2_combination_3( + id int, + name varchar +) USING heap WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) TABLESPACE pg_default; + + +-- part 5: LIKE source_table [ like_option ... ] +CREATE TABLE part5_source_table( + id int, + name varchar +); +CREATE TABLE part5_source_table2( + id2 int, + name2 varchar +); +CREATE TABLE part5_like_simple( + LIKE part5_source_table +); +-- { INCLUDING | EXCLUDING } { COMMENTS | COMPRESSION | CONSTRAINTS | DEFAULTS | GENERATED | IDENTITY | INDEXES | STATISTICS | STORAGE | ALL } +CREATE TABLE part5_including_all( + LIKE part5_source_table INCLUDING ALL +); +CREATE TABLE part5_including_comments( + LIKE part5_source_table INCLUDING COMMENTS +); +CREATE TABLE part5_including_compression( + LIKE part5_source_table INCLUDING COMPRESSION +); +CREATE TABLE part5_including_defaults( + LIKE part5_source_table INCLUDING DEFAULTS +); +CREATE TABLE part5_including_generated( + LIKE part5_source_table INCLUDING GENERATED +); +CREATE TABLE part5_including_identity( + LIKE part5_source_table INCLUDING IDENTITY +); +CREATE TABLE part5_including_indexes( + LIKE part5_source_table INCLUDING INDEXES +); +CREATE TABLE part5_including_statistics( + LIKE part5_source_table INCLUDING STATISTICS +); +CREATE TABLE part5_including_storage( + LIKE part5_source_table INCLUDING STORAGE +); +CREATE TABLE part5_excluding_all( + LIKE part5_source_table EXCLUDING ALL +); +CREATE TABLE part5_excluding_comments( + LIKE part5_source_table EXCLUDING COMMENTS +); +CREATE TABLE part5_excluding_compression( + LIKE part5_source_table EXCLUDING COMPRESSION +); +CREATE TABLE part5_excluding_defaults( + LIKE part5_source_table EXCLUDING DEFAULTS +); +CREATE TABLE part5_excluding_generated( + LIKE part5_source_table EXCLUDING GENERATED +); +CREATE TABLE part5_excluding_identity( + LIKE part5_source_table EXCLUDING IDENTITY +); +CREATE TABLE part5_excluding_indexes( + LIKE part5_source_table EXCLUDING INDEXES +); +CREATE TABLE part5_excluding_statistics( + LIKE part5_source_table EXCLUDING STATISTICS +); +CREATE TABLE part5_excluding_storage( + LIKE part5_source_table EXCLUDING STORAGE +); +CREATE TABLE part5_like_list( + LIKE part5_source_table, + info text, + LIKE part5_source_table2 INCLUDING ALL, + CONSTRAINT primary_key_constraint PRIMARY KEY (id) +); + +-- part 6: partition specification +-- PARTITION OF parent_table { FOR VALUES partition_bound_spec | DEFAULT } +CREATE TABLE part6_parent_table_range( + id int, + name varchar +) PARTITION BY RANGE (id); +CREATE TABLE part6_parent_table_list( + id int, + name varchar +) PARTITION BY LIST (id); +CREATE TABLE part6_parent_table_hash( + id int, + name varchar +) PARTITION BY HASH (id); +CREATE TABLE part6_partition_default PARTITION OF part6_parent_table_range DEFAULT; +-- FROM ( { partition_bound_expr | MINVALUE | MAXVALUE } [, ...] ) +-- TO ( { partition_bound_expr | MINVALUE | MAXVALUE } [, ...] ) | +CREATE TABLE part6_partition_spec_range1 PARTITION OF part6_parent_table_range +FOR VALUES FROM (MINVALUE) TO (2); +CREATE TABLE part6_partition_spec_range2 PARTITION OF part6_parent_table_range +FOR VALUES FROM (3) TO (MAXVALUE); +-- IN ( partition_bound_expr [, ...] ) | +CREATE TABLE part6_partition_spec_list PARTITION OF part6_parent_table_list +FOR VALUES IN (1, (1+2), (4+5)); +-- WITH ( MODULUS numeric_literal, REMAINDER numeric_literal ) +CREATE TABLE part6_partition_spec_hash PARTITION OF part6_parent_table_hash +FOR VALUES WITH (MODULUS 10, REMAINDER 2); + + +-- part7: create table +-- all data types +CREATE TABLE part7_source_table( + src_id int +); +CREATE TABLE part7_data_types( + var1 int8, + var2 serial8, + var3 bit, + var4 bit[5], + var5 varbit, + var6 varbit[5], + var7 bool, + var8 box, + var9 bytea, + var10 char, + var11 char[8], + var12 varchar, + var13 varchar[5], + var14 cidr, + var15 circle, + var16 date, + var17 double precision, + var18 inet, + var19 int, + var20 int4, + var21 interval, + var22 json, + var23 jsonb, + var24 line, + var25 lseg, + var26 macaddr, + var27 money, + var28 decimal, + var29 decimal(3,1), + var30 path, + var31 pg_lsn, + var32 pg_snapshot, + var33 point, + var34 polygon, + var35 float4, + var36 int2, + var37 serial2, + var38 serial4, + var39 text, + var40 time, + var41 time(3), + var42 timetz, + var43 timetz(3), + var44 timestamp, + var45 timestamp(3), + var46 timestamptz, + var47 timestamptz(3), + var48 tsquery, + var49 tsvector, + var50 txid_snapshot, + var51 uuid, + var52 xml +); +CREATE TABLE part7_compression_collate( + str1 varchar COMPRESSION "pglz", + str2 varchar COLLATE "fr_FR" +); +CREATE TABLE part7_inherits_parent( + id int, + name varchar +) +INHERITS (part7_data_types, part7_compression_collate); + +CREATE TABLE part7_combine_all_clauses( + id varchar(5) COMPRESSION "pglz" COLLATE "fr_FR" CONSTRAINT id_constraint DEFAULT 'foo', + PRIMARY KEY (id), + LIKE part7_source_table, + name varchar +) +INHERITS (part7_data_types, part7_compression_collate) +USING heap +WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) +TABLESPACE pg_default; + +CREATE TEMP TABLE part7_combine_all_clauses_temp( + id varchar(5) COMPRESSION "pglz" COLLATE "fr_FR" CONSTRAINT id_constraint DEFAULT 'foo', + PRIMARY KEY (id), + LIKE part7_source_table, + name varchar +) +INHERITS (part7_data_types, part7_compression_collate) +USING heap +WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) +ON COMMIT DELETE ROWS +TABLESPACE pg_default; + +-- part8: create typed table +CREATE TYPE part8_people_type AS ( + id int, + name varchar, + height float4, + weight float4 +); +CREATE TABLE part8_create_typed_table OF part8_people_type; +CREATE TABLE part8_create_typed_table_simple OF part8_people_type( + weight, + PRIMARY KEY (id) +); +CREATE TABLE part8_create_typed_table_with_options_constaints OF part8_people_type( + weight WITH OPTIONS NOT NULL, + name UNIQUE, + PRIMARY KEY (id) +); + +CREATE TABLE part8_create_typed_table_complex_combinations OF part8_people_type( + weight WITH OPTIONS NOT NULL, + name UNIQUE, + PRIMARY KEY (id) +) +USING heap +WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) +TABLESPACE pg_default; + +-- part9: create table as a partition of parent table, FOR VALUES clause is tested in part 6 +CREATE TABLE part9_parent_table_range( + id int, + name varchar, + height float4, + weight float4 +) PARTITION BY RANGE (height); +CREATE TABLE part9_parent_table_list( + id int, + name varchar, + height float4, + weight float4 +) PARTITION BY LIST (name); +CREATE TABLE part9_parent_table_hash( + id int, + name varchar, + height float4, + weight float4 +) PARTITION BY HASH (id); + +-- TOFIX +-- CREATE TABLE part9_partition_with_options_constraintscd +-- PARTITION OF part9_parent_table_range ( +-- id PRIMARY KEY, +-- name WITH OPTIONS NOT NULL, +-- weight, +-- CHECK (height > 0) +-- ) +-- FOR VALUES FROM (MINVALUE) TO (2); + +-- TOFIX +-- CREATE TABLE part9_partition_with_options_constraints_default +-- PARTITION OF part9_parent_table_range ( +-- id PRIMARY KEY, +-- name WITH OPTIONS NOT NULL, +-- CHECK (height > 0) +-- ) DEFAULT; + +-- TOFIX +-- CREATE TABLE part9_partition_complex_combinations +-- PARTITION OF part9_parent_table_range ( +-- id PRIMARY KEY, +-- name WITH OPTIONS NOT NULL, +-- CHECK (height > 0) +-- ) +-- FOR VALUES FROM (3) TO (10) +-- USING heap +-- WITH (vacuum_index_cleanup = ON, autovacuum_vacuum_scale_factor = 0.2, vacuum_truncate = true) +-- TABLESPACE pg_default; + +-- copied from old create_table.sql +-- Test TableLikeClause is handled properly +CREATE TABLE ctlt1 (a text CHECK (length(a) > 2) PRIMARY KEY, b text); +ALTER TABLE ctlt1 ALTER COLUMN a SET STORAGE MAIN; +ALTER TABLE ctlt1 ALTER COLUMN b SET STORAGE EXTERNAL; +CREATE TABLE ctlt1_like (LIKE ctlt1 INCLUDING ALL); + +-- Test foreign key constraint is handled in a following ALTER TABLE ADD CONSTRAINT FOREIGN KEY REFERENCES subcommand +CREATE TABLE product (id int PRIMARY KEY, name text); +CREATE TABLE orders2 (order_id int PRIMARY KEY, product_id int +REFERENCES product (id)); + +-- Test CREATE and ALTER inherited table +CREATE TABLE gtest30 ( +a int, +b int GENERATED ALWAYS AS (a * 2) STORED +); +CREATE TABLE gtest30_1 () INHERITS (gtest30); +ALTER TABLE gtest30 ALTER COLUMN b DROP EXPRESSION; diff --git a/src/test/modules/test_ddl_deparse_regress/sql/test_ddl_deparse.sql b/src/test/modules/test_ddl_deparse_regress/sql/test_ddl_deparse.sql new file mode 100644 index 0000000..070cee8 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/sql/test_ddl_deparse.sql @@ -0,0 +1,23 @@ +CREATE ROLE ddl_testing_role SUPERUSER; +SET ROLE ddl_testing_role; + +CREATE EXTENSION test_ddl_deparse_regress; + +CREATE OR REPLACE FUNCTION test_ddl_deparse() + RETURNS event_trigger LANGUAGE plpgsql AS +$$ +DECLARE + r record; + deparsed_json text; +BEGIN + FOR r IN SELECT * FROM pg_event_trigger_ddl_commands() + LOOP + deparsed_json = pg_catalog.ddl_deparse_to_json(r.command); + RAISE NOTICE 'deparsed json: %', deparsed_json; + RAISE NOTICE 're-formed command: %', pg_catalog.ddl_deparse_expand_command(deparsed_json); + END LOOP; +END; +$$; + +CREATE EVENT TRIGGER test_ddl_deparse +ON ddl_command_end EXECUTE PROCEDURE test_ddl_deparse(); diff --git a/src/test/modules/test_ddl_deparse_regress/t/001_compare_dumped_results.pl b/src/test/modules/test_ddl_deparse_regress/t/001_compare_dumped_results.pl new file mode 100644 index 0000000..c511b5b --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/t/001_compare_dumped_results.pl @@ -0,0 +1,211 @@ +use strict; +use warnings; +use Env; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; +use Test::More; +use File::Basename; + +sub execute_test_case { + my $test_name = $_[0]; + my $pub_node = $_[1]; + my $sub_node = $_[2]; + my $dbname = $_[3]; + my $user = $_[4]; + my $outputdir = $PostgreSQL::Test::Utils::tmp_check; + + # set up deparse testing resources + create_deparse_testing_resources_on_pub_node($pub_node, $dbname, $user); + + my $test_file = "./sql/${test_name}.sql"; + my $content = do{local(@ARGV,$/)=$test_file;<>}; + my $pub_node_error = ''; + $pub_node -> psql($dbname, $content, + stderr => \$pub_node_error, + extra_params => ["-U", "${user}"]); + # check execution of test SQL commands + ok($pub_node_error eq '', "execute test SQL commands from ".$test_name) or diag("Failure from " + .$test_file.": ".$pub_node_error); + + # retrieve reformed SQL commands on pub node, write to file + my $ddl_sql = ''; + $pub_node -> psql($dbname,q( + select ddl_deparse_expand_command(ddl) || ';' from deparsed_ddls ORDER BY id ASC), + stdout => \$ddl_sql, + extra_params => ["-U", "${user}"]); + mkdir ${outputdir}."/ddl", 0755; + my $ddl_output_file = ${outputdir}."/ddl/${test_name}.sql"; + open(FH, '>', $ddl_output_file) or die $!; + print FH $ddl_sql; + close(FH); + + # execute reformed SQL commands on sub node + my $sub_node_error = ''; + $sub_node -> psql($dbname, $ddl_sql, + stderr => \$sub_node_error, + extra_params => ["-U", "${user}"]); + # check execution of reformed DDL commands + ok($sub_node_error eq '', "replay reformed DDL commands from ".$test_name) or diag("Failure from " + .$ddl_output_file.": ".$sub_node_error); + + # clean up deparse testing resources + clean_deparse_testing_resources_on_pub_node($pub_node, $dbname); + # dump from pub node and sub node + mkdir ${outputdir}."/dumps", 0755; + my $pub_dump = ${outputdir}."/dumps/${test_name}_pub.dump"; + my $sub_dump = ${outputdir}."/dumps/${test_name}_sub.dump"; + my $dump_diff = ${outputdir}."/dumps/${test_name}_dump.diff"; + system("pg_dumpall " + . "-s " + . "-f " + . $pub_dump . " " + . "--no-sync " + . '-p ' + . $pub_node->port) == 0 or die "Dump pub node failed in ${test_name}"; + system("pg_dumpall " + . "-s " + . "-f " + . $sub_dump . " " + . "--no-sync " + . '-p ' + . $sub_node->port) == 0 or die "Dump sub node failed in ${test_name}"; + + # compare dumped results + system("diff ".$pub_dump." ".$sub_dump." > ".$dump_diff); + ok(system("diff ".$pub_dump." ".$sub_dump) == 0, "compare dumped results in ${test_name}") + or diag("Dumped results are different in ".$test_name + .", check ".$dump_diff); +} + +sub init_node { + my $node_name = $_[0]; + my $node = PostgreSQL::Test::Cluster->new($node_name); + # increase some settings that Cluster->new makes too low by default. + $node -> init(); + $node -> start(); + $node -> append_conf('postgresql.conf', 'max_connections = 25'); + $node -> append_conf('postgresql.conf', 'client_min_messages = error'); + $node -> append_conf('postgresql.conf', 'max_prepared_transactions = 10'); + $node -> restart(); + return $node; +} + +sub init_pub_node { + my $node_name = $_[0]."_pub"; + return init_node($node_name) +} + +sub init_sub_node { + my $node_name = $_[0]."_sub"; + return init_node($node_name) +} + +sub create_deparse_testing_resources_on_pub_node { + my $node = $_[0]; + my $dbname = $_[1]; + my $user = $_[2]; + $node -> psql($dbname, " + begin; + CREATE EXTENSION test_ddl_deparse_regress; + create table deparsed_ddls(id SERIAL PRIMARY KEY, tag text, object_identity text, ddl text); + + create or replace function deparse_to_json() + returns event_trigger language plpgsql as + \$\$ + declare + r record; + begin + for r in select * from pg_event_trigger_ddl_commands() + loop + insert into deparsed_ddls(tag, object_identity, ddl) values (r.command_tag, r.object_identity, pg_catalog.ddl_deparse_to_json(r.command)); + end loop; + END; + \$\$; + + create or replace function deparse_drops_to_json() + returns event_trigger language plpgsql as + \$\$ + declare + r record; + begin + for r in select * from pg_event_trigger_dropped_objects() + loop + insert into deparsed_ddls(tag, object_identity, ddl) values (r.object_type, r.object_identity, public.deparse_drop_ddl(r.object_identity, r.object_type)); + end loop; + END; + \$\$; + + create event trigger ddl_deparse_trig + on ddl_command_end execute procedure deparse_to_json(); + + create event trigger ddl_drops_deparse_trig + on sql_drop execute procedure deparse_drops_to_json(); + + commit; + " + ); +} + +sub clean_deparse_testing_resources_on_pub_node { + my $node = $_[0]; + my $dbname = $_[1]; + # Drop the event trigger and the function before taking a logical dump. + $node -> safe_psql($dbname,q( + drop event trigger ddl_deparse_trig; + drop event trigger ddl_drops_deparse_trig; + drop function deparse_to_json(); + drop function deparse_drops_to_json(); + drop table deparsed_ddls; + DROP EXTENSION test_ddl_deparse_regress; + )); +} + +sub create_prerequisite_resources { + my $node = $_[0]; + my $dbname = $_[1]; + my $user = $_[2]; + $node -> safe_psql($dbname, "CREATE ROLE ${user} SUPERUSER LOGIN CREATEDB;"); +} + +sub trim { + my @out = @_; + for (@out) { + s/^\s+//; + s/\s+$//; + } + return wantarray ? @out : $out[0]; +} + +# Create and start pub sub nodes +my $initial_dbname = "postgres"; +my $user = "ddl_testing_role"; +my $pub_node = init_pub_node("test", $user); +my $sub_node = init_sub_node("test", $user); +create_prerequisite_resources($pub_node, $initial_dbname, $user); +create_prerequisite_resources($sub_node, $initial_dbname, $user); + +# load test cases from the regression tests +my @regress_tests = split /\s+/, $ENV{REGRESS}; +my $test_case_count = scalar @regress_tests - 1; +my $test_count_per_case = 3; +my $test_count = $test_case_count * $test_count_per_case; + +plan tests => $test_count; +foreach(@regress_tests) { + my $test_name = trim($_); + # skip if it's regression test preparation or empty string + if ($test_name eq "" or $test_name eq "test_ddl_deparse") + { + next; + } + my $test_dbname = $test_name; + $pub_node -> safe_psql($initial_dbname, "CREATE DATABASE ${test_dbname};", extra_params => ["-U", "${user}"]); + $sub_node -> safe_psql($initial_dbname, "CREATE DATABASE ${test_dbname};", extra_params => ["-U", "${user}"]); + execute_test_case($test_name, $pub_node, $sub_node, $test_dbname, $user); +} +done_testing(); + +# Close nodes +$pub_node->stop; +$sub_node->stop; + diff --git a/src/test/modules/test_ddl_deparse_regress/t/002_regress_tests.pl b/src/test/modules/test_ddl_deparse_regress/t/002_regress_tests.pl new file mode 100644 index 0000000..3a875c3 --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/t/002_regress_tests.pl @@ -0,0 +1,207 @@ +use strict; +use warnings; +use Env; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; +use Test::More; +use File::Basename; + +sub execute_regress_test { + my $pub_node = $_[0]; + my $sub_node = $_[1]; + my $dbname = "postgres"; + my $dlpath = dirname($ENV{REGRESS_SHLIB}); + my $inputdir = "../../regress"; + my $outputdir = $PostgreSQL::Test::Utils::tmp_check; + + # set up deparse testing resources + create_deparse_testing_resources_on_pub_node($pub_node, $dbname); + + # execute core regression tests on pub node + my $regress_cmd = $ENV{PG_REGRESS} + . " " + . "--dlpath=\"$dlpath\" " + . "--max-concurrent-tests=20 " + . "--dbname=" + . $dbname . " " + . "--use-existing " + . "--host=" + . $pub_node->host . " " + . "--port=" + . $pub_node->port . " " + . "--inputdir=$inputdir " + . "--outputdir=\"$outputdir\" " + . "--schedule=$inputdir/parallel_schedule"; + print "Regression test command is $regress_cmd"; + my $rc = system($regress_cmd); + if ($rc != 0) + { + # If regression test fails, dump out the regression diffs file + my $diffs = "${outputdir}/regression/regression.diffs"; + if (-e $diffs) + { + print "=== dumping $diffs ===\n"; + print slurp_file($diffs); + print "=== EOF ===\n"; + } + die "Regression test failed"; + } + + # Retrieve SQL commands generated from deparsed DDLs on pub node + my $ddl_sql = ''; + $pub_node -> psql($dbname,q( + select ddl_deparse_expand_command(ddl) || ';' from deparsed_ddls ORDER BY id ASC), + stdout => \$ddl_sql); + + # Execute SQL commands on sub node + $sub_node -> psql($dbname, $ddl_sql); + + # Clean up deparse testing resources + clean_deparse_testing_resources_on_pub_node($pub_node, $dbname); + + # Dump from pub node and sub node + mkdir ${outputdir}."/dumps", 0755; + my $pub_dump = ${outputdir}."/dumps/regress_pub.dump"; + my $sub_dump = ${outputdir}."/dumps/regress_sub.dump"; + system("pg_dumpall " + . "-s " + . "-f " + . $pub_dump . " " + . "--no-sync " + . '-p ' + . $pub_node->port) == 0 or die "Dump pub node failed"; + system("pg_dumpall " + . "-s " + . "-f " + . $sub_dump . " " + . "--no-sync " + . '-p ' + . $sub_node->port) == 0 or die "Dump sub node failed"; + + # Compare dumped results + is(system("diff " + . $pub_dump . " " + . $sub_dump), 0, "Comparing dumped output"); + + # Close nodes + $pub_node->stop; + $sub_node->stop; +} + +sub init_node { + my $node_name = $_[0]; + my $node = PostgreSQL::Test::Cluster->new($node_name); + $node->init; + # increase some settings that Cluster->new makes too low by default. + $node->adjust_conf('postgresql.conf', 'max_connections', '25'); + $node->append_conf('postgresql.conf', + 'max_prepared_transactions = 10'); + return $node; +} + +sub init_pub_node { + my $node_name = $_[0]."_pub"; + return init_node($node_name) +} + +sub init_sub_node { + my $node_name = $_[0]."_sub"; + return init_node($node_name) +} + +sub create_deparse_testing_resources_on_pub_node { + my $node = $_[0]; + my $dbname = $_[1]; + $node -> psql($dbname, q( + begin; + CREATE EXTENSION test_ddl_deparse_regress; + create table deparsed_ddls(id SERIAL PRIMARY KEY, tag text, object_identity text, ddl text); + create or replace function deparse_to_json() + returns event_trigger language plpgsql as + $$ + declare + r record; + begin + for r in select * from pg_event_trigger_ddl_commands() + loop + insert into deparsed_ddls(tag, object_identity, ddl) values (r.command_tag, r.object_identity, pg_catalog.ddl_deparse_to_json(r.command)); + end loop; + END; + $$; + create or replace function deparse_drops_to_json() + returns event_trigger language plpgsql as + $$ + declare + r record; + begin + for r in select * from pg_event_trigger_dropped_objects() + loop + insert into deparsed_ddls(tag, object_identity, ddl) values (r.object_type, r.object_identity, public.deparse_drop_ddl(r.object_identity, r.object_type)); + end loop; + END; + $$; + create event trigger ddl_deparse_trig + on ddl_command_end execute procedure deparse_to_json(); + create event trigger ddl_drops_deparse_trig + on sql_drop execute procedure deparse_drops_to_json(); + commit; + )); +} + +sub clean_deparse_testing_resources_on_pub_node { + my $node = $_[0]; + my $dbname = $_[1]; + # Drop the event trigger and the function before taking a logical dump. + $node -> safe_psql($dbname,q( + drop event trigger ddl_deparse_trig; + drop event trigger ddl_drops_deparse_trig; + drop function deparse_to_json(); + drop function deparse_drops_to_json(); + drop table deparsed_ddls; + DROP EXTENSION test_ddl_deparse_regress; + )); +} + +sub trim { + my @out = @_; + for (@out) { + s/^\s+//; + s/\s+$//; + } + return wantarray ? @out : $out[0]; +} + +# Create and start pub sub nodes +my $pub_node = init_pub_node("regress"); +my $sub_node = init_sub_node("regress"); +$pub_node -> start; +$sub_node -> start; + +# Comment the execution temporarily, an error in ddl_deparse.c will cause the database exits abnormally, error signature: +# +# 2022-12-03 23:02:44.778 UTC [129102] pg_regress/tablespace LOG: statement: ALTER TABLE ALL IN TABLESPACE regress_tblspace_renamed SET TABLESPACE pg_default; +# TRAP: failed Assert("IsA(stmt, AlterTableStmt)"), File: "ddl_deparse.c", Line: 3371, PID: 129102 +# postgres: regress_pub: runqi postgres [local] ALTER TABLE(ExceptionalCondition+0xbb)[0x563bd6ea5b0d] +# ... +# /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7fd6a74a6d90] +# /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7fd6a74a6e40] +# postgres: regress_pub: runqi postgres [local] ALTER TABLE(_start+0x25)[0x563bd672f1e5] +# 2022-12-03 23:02:44.850 UTC [129058] LOG: server process (PID 129102) was terminated by signal 6: Aborted +# 2022-12-03 23:02:44.850 UTC [129058] DETAIL: Failed process was running: ALTER TABLE ALL IN TABLESPACE regress_tblspace_renamed SET TABLESPACE pg_default; +# 2022-12-03 23:02:44.850 UTC [129058] LOG: terminating any other active server processes +# 2022-12-03 23:02:44.851 UTC [129058] LOG: shutting down because restart_after_crash is off +# 2022-12-03 23:02:44.852 UTC [129058] LOG: database system is shut down + +# eval {execute_regress_test($pub_node, $sub_node);}; +# if ($@ ne "") +# { +# fail($@); +# } + +# Close nodes +$pub_node->stop; +$sub_node->stop; + +pass("regresssion test passed"); + +done_testing(); \ No newline at end of file diff --git a/src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress--1.0.sql b/src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress--1.0.sql new file mode 100644 index 0000000..14070cd --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress--1.0.sql @@ -0,0 +1,9 @@ +/* src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress--1.0.sql */ + +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION test_ddl_deparse_regress" to load this file. \quit + +CREATE FUNCTION deparse_drop_ddl(IN objidentity text, + IN objecttype text) + RETURNS text IMMUTABLE STRICT + AS 'MODULE_PATHNAME' LANGUAGE C; \ No newline at end of file diff --git a/src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress.c b/src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress.c new file mode 100644 index 0000000..bd6992b --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress.c @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------- + * test_ddl_deparse_regress.c + * Support functions for the test_ddl_deparse_regress module + * + * Copyright (c) 2014-2022, PostgreSQL Global Development Group + * + * IDENTIFICATION + * src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress.c + *---------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "catalog/pg_type.h" +#include "funcapi.h" +#include "nodes/execnodes.h" +#include "tcop/deparse_utility.h" +#include "tcop/utility.h" +#include "utils/builtins.h" +#include "tcop/ddl_deparse.h" + +PG_MODULE_MAGIC; + +PG_FUNCTION_INFO_V1(deparse_drop_ddl); + +/* + * Given object_identity and object_type of dropped object, return a JSON representation of DROP command. + */ +Datum +deparse_drop_ddl(PG_FUNCTION_ARGS) +{ + text *objidentity = PG_GETARG_TEXT_P(0); + const char *objidentity_str = text_to_cstring(objidentity); + text *objecttype = PG_GETARG_TEXT_P(1); + const char *objecttype_str = text_to_cstring(objecttype); + + char *command; + + // constraint is part of alter table command, no need to drop in DROP command + if (strcmp(objecttype_str, "table constraint") == 0) { + PG_RETURN_NULL(); + } else if (strcmp(objecttype_str, "toast table") == 0) { + objecttype_str = "table"; + } else if (strcmp(objecttype_str, "default value") == 0) { + PG_RETURN_NULL(); + } else if (strcmp(objecttype_str, "operator of access method") == 0) { + PG_RETURN_NULL(); + } else if (strcmp(objecttype_str, "function of access method") == 0) { + PG_RETURN_NULL(); + } else if (strcmp(objecttype_str, "table column") == 0) { + PG_RETURN_NULL(); + } + + command = deparse_drop_command(objidentity_str, objecttype_str, DROP_CASCADE); + + if (command) + PG_RETURN_TEXT_P(cstring_to_text(command)); + + PG_RETURN_NULL(); +} \ No newline at end of file diff --git a/src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress.control b/src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress.control new file mode 100644 index 0000000..a1f934e --- /dev/null +++ b/src/test/modules/test_ddl_deparse_regress/test_ddl_deparse_regress.control @@ -0,0 +1,4 @@ +comment = 'Test code for DDL deparse regress feature' +default_version = '1.0' +module_pathname = '$libdir/test_ddl_deparse_regress' +relocatable = true -- 1.8.3.1