-- -- CREATE_TABLE -- -- Datatypes CREATE TABLE datatype_table ( id SERIAL, id_big BIGSERIAL, is_small SMALLSERIAL, v_bytea BYTEA, v_smallint SMALLINT, v_int INT, v_bigint BIGINT, v_char CHAR(1), v_varchar VARCHAR(10), v_text TEXT, v_bool BOOLEAN, v_inet INET, v_cidr CIDR, v_macaddr MACADDR, v_numeric NUMERIC(1,0), v_real REAL, v_float FLOAT(1), v_float8 FLOAT8, v_money MONEY, v_tsquery TSQUERY, v_tsvector TSVECTOR, v_date DATE, v_time TIME, v_time_tz TIME WITH TIME ZONE, v_timestamp TIMESTAMP, v_timestamp_tz TIMESTAMP WITH TIME ZONE, v_interval INTERVAL, v_bit BIT, v_bit4 BIT(4), v_varbit VARBIT, v_varbit4 VARBIT(4), v_box BOX, v_circle CIRCLE, v_lseg LSEG, v_path PATH, v_point POINT, v_polygon POLYGON, v_json JSON, v_xml XML, v_uuid UUID, v_txid_snapshot txid_snapshot, v_enum ENUM_TEST, v_postal_code japanese_postal_code, v_int2range int2range, PRIMARY KEY (id), UNIQUE (id_big) ); NOTICE: DDL test: type simple, tag CREATE SEQUENCE NOTICE: DDL test: type simple, tag CREATE SEQUENCE NOTICE: DDL test: type simple, tag CREATE SEQUENCE NOTICE: DDL test: type simple, tag CREATE TABLE NOTICE: DDL test: type simple, tag CREATE INDEX NOTICE: DDL test: type simple, tag CREATE INDEX NOTICE: DDL test: type simple, tag ALTER SEQUENCE NOTICE: DDL test: type simple, tag ALTER SEQUENCE NOTICE: DDL test: type simple, tag ALTER SEQUENCE -- Constraint definitions CREATE TABLE IF NOT EXISTS fkey_table ( id INT NOT NULL DEFAULT nextval('fkey_table_seq'::REGCLASS), datatype_id INT NOT NULL REFERENCES datatype_table(id), big_id BIGINT NOT NULL, sometext TEXT COLLATE "POSIX", check_col_1 INT NOT NULL CHECK(check_col_1 < 10), check_col_2 INT NOT NULL, PRIMARY KEY (id), CONSTRAINT fkey_big_id FOREIGN KEY (big_id) REFERENCES datatype_table(id_big), EXCLUDE USING btree (check_col_2 WITH =) ); NOTICE: DDL test: type simple, tag CREATE TABLE NOTICE: DDL test: type simple, tag CREATE INDEX NOTICE: DDL test: type simple, tag CREATE INDEX NOTICE: DDL test: type alter table, tag ALTER TABLE NOTICE: subcommand: ADD CONSTRAINT (and recurse) NOTICE: subcommand: ADD CONSTRAINT (and recurse) -- Typed table CREATE TABLE employees OF employee_type ( PRIMARY KEY (name), salary WITH OPTIONS DEFAULT 1000 ); NOTICE: DDL test: type simple, tag CREATE TABLE NOTICE: DDL test: type alter table, tag ALTER TABLE NOTICE: subcommand: SET NOT NULL NOTICE: DDL test: type simple, tag CREATE INDEX -- Inheritance CREATE TABLE person ( id INT NOT NULL PRIMARY KEY, name text, age int4, location point ); NOTICE: DDL test: type simple, tag CREATE TABLE NOTICE: DDL test: type simple, tag CREATE INDEX CREATE TABLE emp ( salary int4, manager name ) INHERITS (person); NOTICE: DDL test: type simple, tag CREATE TABLE CREATE TABLE student ( gpa float8 ) INHERITS (person); NOTICE: DDL test: type simple, tag CREATE TABLE CREATE TABLE stud_emp ( percent int4 ) INHERITS (emp, student); NOTICE: merging multiple inherited definitions of column "id" NOTICE: merging multiple inherited definitions of column "name" NOTICE: merging multiple inherited definitions of column "age" NOTICE: merging multiple inherited definitions of column "location" NOTICE: DDL test: type simple, tag CREATE TABLE -- Storage parameters CREATE TABLE storage ( id INT ) WITH ( fillfactor = 10, autovacuum_enabled = FALSE ); NOTICE: DDL test: type simple, tag CREATE TABLE -- LIKE CREATE TABLE like_datatype_table ( LIKE datatype_table EXCLUDING ALL ); NOTICE: DDL test: type simple, tag CREATE TABLE CREATE TABLE like_fkey_table ( LIKE fkey_table INCLUDING DEFAULTS INCLUDING INDEXES INCLUDING STORAGE ); NOTICE: DDL test: type simple, tag CREATE TABLE NOTICE: DDL test: type alter table, tag ALTER TABLE NOTICE: subcommand: ALTER COLUMN SET DEFAULT (precooked) NOTICE: DDL test: type simple, tag CREATE INDEX NOTICE: DDL test: type simple, tag CREATE INDEX -- Volatile table types CREATE UNLOGGED TABLE unlogged_table ( id INT PRIMARY KEY ); NOTICE: DDL test: type simple, tag CREATE TABLE NOTICE: DDL test: type simple, tag CREATE INDEX CREATE TEMP TABLE temp_table ( id INT PRIMARY KEY ); NOTICE: DDL test: type simple, tag CREATE TABLE NOTICE: DDL test: type simple, tag CREATE INDEX CREATE TEMP TABLE temp_table_commit_delete ( id INT PRIMARY KEY ) ON COMMIT DELETE ROWS; NOTICE: DDL test: type simple, tag CREATE TABLE NOTICE: DDL test: type simple, tag CREATE INDEX CREATE TEMP TABLE temp_table_commit_drop ( id INT PRIMARY KEY ) ON COMMIT DROP; NOTICE: DDL test: type simple, tag CREATE TABLE NOTICE: DDL test: type simple, tag CREATE INDEX