deparse-test: add deparse_schedule to regression tests dev/deparse-test
authorPetr Jelinek <pjmodos@pjmodos.net>
Wed, 11 Feb 2015 15:02:44 +0000 (16:02 +0100)
committerPetr Jelinek <pjmodos@pjmodos.net>
Wed, 11 Feb 2015 15:02:44 +0000 (16:02 +0100)
src/test/regress/GNUmakefile
src/test/regress/deparse_schedule [new file with mode: 0644]
src/test/regress/expected/deparse_init.out
src/test/regress/sql/deparse_dump.sql [new file with mode: 0644]
src/test/regress/sql/deparse_init.sql [new file with mode: 0644]

index b40b37c0b7420c9112a99ea19d41499a1e320a76..0bc39071791b8ba9a206fe19870db817f6a5840d 100644 (file)
@@ -160,6 +160,10 @@ installcheck-tests: all tablespace-setup
 standbycheck: all
    $(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/standby_schedule --use-existing
 
+deparsetest: all  tablespace-setup
+   $(pg_regress_check) $(REGRESS_OPTS) --schedule=$(srcdir)/deparse_schedule $(TEMP_CONF) $(EXTRA_TESTS)
+
+
 # old interfaces follow...
 
 runcheck: check
diff --git a/src/test/regress/deparse_schedule b/src/test/regress/deparse_schedule
new file mode 100644 (file)
index 0000000..8fad12a
--- /dev/null
@@ -0,0 +1,151 @@
+# src/test/regress/serial_schedule
+# This should probably be in an order similar to parallel_schedule.
+test: deparse_init
+test: tablespace
+test: boolean
+test: char
+test: name
+test: varchar
+test: text
+test: int2
+test: int4
+test: int8
+test: oid
+test: float4
+test: float8
+test: bit
+test: numeric
+test: txid
+test: uuid
+test: enum
+test: money
+test: rangetypes
+test: pg_lsn
+test: regproc
+test: strings
+test: numerology
+test: point
+test: lseg
+test: line
+test: box
+test: path
+test: polygon
+test: circle
+test: date
+test: time
+test: timetz
+test: timestamp
+test: timestamptz
+test: interval
+test: abstime
+test: reltime
+test: tinterval
+test: inet
+test: macaddr
+test: tstypes
+test: comments
+test: geometry
+test: horology
+test: regex
+test: oidjoins
+test: type_sanity
+test: opr_sanity
+test: insert
+test: create_function_1
+test: create_type
+test: create_table
+test: create_function_2
+test: copy
+test: copyselect
+test: create_misc
+test: create_operator
+test: create_index
+test: create_view
+test: create_aggregate
+test: create_function_3
+test: create_cast
+test: constraints
+test: triggers
+test: inherit
+test: create_table_like
+test: typed_table
+test: vacuum
+test: drop_if_exists
+test: updatable_views
+test: sanity_check
+test: errors
+test: select
+test: select_into
+test: select_distinct
+test: select_distinct_on
+test: select_implicit
+test: select_having
+test: subselect
+test: union
+test: case
+test: join
+test: aggregates
+test: transactions
+ignore: random
+test: random
+test: portals
+test: arrays
+test: btree_index
+test: hash_index
+test: update
+test: delete
+test: namespace
+test: prepared_xacts
+test: privileges
+test: security_label
+test: collate
+test: matview
+test: lock
+test: replica_identity
+test: rowsecurity
+test: alter_generic
+test: misc
+test: psql
+test: async
+test: rules
+test: event_trigger
+test: select_views
+test: portals_p2
+test: foreign_key
+test: cluster
+test: dependency
+test: guc
+test: bitmapops
+test: combocid
+test: tsearch
+test: tsdicts
+test: foreign_data
+test: window
+test: xmlmap
+test: functional_deps
+test: advisory_lock
+test: json
+test: jsonb
+test: indirect_toast
+test: equivclass
+test: plancache
+test: limit
+test: plpgsql
+test: copy2
+test: temp
+test: domain
+test: rangefuncs
+test: prepare
+test: without_oid
+test: conversion
+test: truncate
+test: alter_table
+test: sequence
+test: polymorphism
+test: rowtypes
+test: returning
+test: largeobject
+test: with
+test: xml
+test: stats
+test: deparse_dump
\ No newline at end of file
index 0f306e705a567b89068cdf8c93fd598c9c653eee..3046c0ba07c56cbda14c6f65b599c876ab7700c4 100644 (file)
@@ -1,15 +1,21 @@
 --
 -- DEPARSE_INIT
 --
-CREATE TABLE deparse_test_commands (
+CREATE SCHEMA deparse;
+CREATE TABLE deparse.deparse_test_commands (
   id SERIAL PRIMARY KEY,
   command TEXT
 );
-CREATE FUNCTION deparse_test_ddl_command_end()
+CREATE FUNCTION deparse.deparse_test_ddl_command_end()
   RETURNS event_trigger
-  LANGUAGE C
-AS '/space/sda1/ibarwick/2ndquadrant_bdr/src/test/regress/regress.so', 'deparse_test_ddl_command_end';
-/* This should come last - we don't want to log anything defined here */
+  LANGUAGE plpgsql
+AS $fn$
+BEGIN
+   INSERT INTO deparse.deparse_test_commands (command)
+       SELECT pg_event_trigger_expand_command(command)
+       FROM pg_event_trigger_get_creation_commands();
+END;
+$fn$;
 CREATE EVENT TRIGGER deparse_test_trg_ddl_command_end
   ON ddl_command_end
-  EXECUTE PROCEDURE deparse_test_ddl_command_end();
+  EXECUTE PROCEDURE deparse.deparse_test_ddl_command_end();
diff --git a/src/test/regress/sql/deparse_dump.sql b/src/test/regress/sql/deparse_dump.sql
new file mode 100644 (file)
index 0000000..877796a
--- /dev/null
@@ -0,0 +1 @@
+SELECT * FROM deparse.deparse_test_commands ORDER BY id;
diff --git a/src/test/regress/sql/deparse_init.sql b/src/test/regress/sql/deparse_init.sql
new file mode 100644 (file)
index 0000000..b98aeb7
--- /dev/null
@@ -0,0 +1,22 @@
+--
+-- DEPARSE_INIT
+--
+CREATE SCHEMA deparse;
+CREATE TABLE deparse.deparse_test_commands (
+  id SERIAL PRIMARY KEY,
+  command TEXT
+);
+CREATE FUNCTION deparse.deparse_test_ddl_command_end()
+  RETURNS event_trigger
+  LANGUAGE plpgsql
+AS $fn$
+BEGIN
+   INSERT INTO deparse.deparse_test_commands (command)
+       SELECT pg_event_trigger_expand_command(command)
+       FROM pg_event_trigger_get_creation_commands();
+END;
+$fn$;
+
+CREATE EVENT TRIGGER deparse_test_trg_ddl_command_end
+  ON ddl_command_end
+  EXECUTE PROCEDURE deparse.deparse_test_ddl_command_end();