diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition.sql index 37787137a..033f1d940 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition.sql @@ -2,7 +2,7 @@ -- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"; -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col) @@ -19,7 +19,7 @@ COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" -- Partitions SQL -CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" FOR VALUES FROM ('0') TO ('1000'); ALTER TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition_msql.sql index 30c1610f5..4338f6052 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition_msql.sql @@ -1,2 +1,2 @@ -CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" FOR VALUES FROM (0) TO (1000); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition.sql index 794355c7b..d13d42951 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition.sql @@ -2,7 +2,7 @@ -- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"; -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition_msql.sql index 8aff6d38c..4a1685f46 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition_msql.sql @@ -1,4 +1,4 @@ -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql index aa3a6efc8..dde804810 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql @@ -2,7 +2,7 @@ -- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"; -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col); @@ -15,7 +15,7 @@ COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" -- Partitions SQL -CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" FOR VALUES FROM ('0') TO ('1000'); ALTER TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition_msql.sql index 30c1610f5..4338f6052 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition_msql.sql @@ -1,2 +1,2 @@ -CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" FOR VALUES FROM (0) TO (1000); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql index 2d267c70b..265d40907 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql @@ -2,7 +2,7 @@ -- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"; -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql index b47545daf..c0d8eeef6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql @@ -1,4 +1,4 @@ -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition.sql index 93a0a89f8..77416c67c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition.sql @@ -2,7 +2,7 @@ -- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"; -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col) @@ -19,7 +19,7 @@ COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" -- Partitions SQL -CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" FOR VALUES FROM ('0') TO ('1000'); ALTER TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition_msql.sql index 30c1610f5..4338f6052 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition_msql.sql @@ -1,2 +1,2 @@ -CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" FOR VALUES FROM (0) TO (1000); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition.sql index 8a01c4be5..db930c966 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition.sql @@ -2,7 +2,7 @@ -- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"; -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition_msql.sql index 9073841d8..460c2442b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition_msql.sql @@ -1,4 +1,4 @@ -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition.sql index c4d11cd91..2a7a61232 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition.sql @@ -2,7 +2,7 @@ -- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"; -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col); @@ -15,7 +15,7 @@ COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" -- Partitions SQL -CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" FOR VALUES FROM ('0') TO ('1000'); ALTER TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition_msql.sql index 30c1610f5..4338f6052 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition_msql.sql @@ -1,2 +1,2 @@ -CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#" FOR VALUES FROM (0) TO (1000); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition.sql index 2a2bec8ec..c4c47178c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition.sql @@ -2,7 +2,7 @@ -- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"; -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition_msql.sql index eaec0dd61..7aea9c848 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition_msql.sql @@ -1,4 +1,4 @@ -CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" +CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ( m_col bigint ) PARTITION BY RANGE (m_col); diff --git a/web/pgadmin/tools/erd/tests/sql/12_plus/test_sql_output.sql b/web/pgadmin/tools/erd/tests/sql/12_plus/test_sql_output.sql index e3d6ab762..222d947b0 100644 --- a/web/pgadmin/tools/erd/tests/sql/12_plus/test_sql_output.sql +++ b/web/pgadmin/tools/erd/tests/sql/12_plus/test_sql_output.sql @@ -1,20 +1,20 @@ -CREATE TABLE public.newtable1 +CREATE TABLE IF NOT EXISTS public.newtable1 ( id integer, col1 character varying(50), PRIMARY KEY (id) ); -CREATE TABLE public.newtable2 +CREATE TABLE IF NOT EXISTS public.newtable2 ( table1_id integer, col2 character varying(50), PRIMARY KEY (id) ); -CREATE TABLE public.newtable3 +CREATE TABLE IF NOT EXISTS public.newtable3 ( ) ; diff --git a/web/pgadmin/tools/erd/tests/sql/default/test_sql_output.sql b/web/pgadmin/tools/erd/tests/sql/default/test_sql_output.sql index 330e81443..94fff62ed 100644 --- a/web/pgadmin/tools/erd/tests/sql/default/test_sql_output.sql +++ b/web/pgadmin/tools/erd/tests/sql/default/test_sql_output.sql @@ -1,6 +1,6 @@ -CREATE TABLE public.newtable1 +CREATE TABLE IF NOT EXISTS public.newtable1 ( id integer, col1 character varying(50), @@ -10,7 +10,7 @@ WITH ( OIDS = FALSE ); -CREATE TABLE public.newtable2 +CREATE TABLE IF NOT EXISTS public.newtable2 ( table1_id integer, col2 character varying(50), @@ -20,7 +20,7 @@ WITH ( OIDS = FALSE ); -CREATE TABLE public.newtable3 +CREATE TABLE IF NOT EXISTS public.newtable3 ( )