-- TRANSACTION STUFF
-- not in a xact
-NOTICE: UserAbortTransactionBlock and not in in-progress state
abort;
+NOTICE: UserAbortTransactionBlock and not in in-progress state
-- not in a xact
-NOTICE: EndTransactionBlock and not inprogress/abort state
end;
+NOTICE: EndTransactionBlock and not inprogress/abort state
--
-- DEFINE AGGREGATE
-- formats
--
SET DateStyle TO 'US,Postgres';
-NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SELECT '' AS sixty_two, d1 AS us_postgres FROM DATETIME_TBL;
sixty_two | us_postgres
-----------+---------------------------------
(8 rows)
SET DateStyle TO 'US,SQL';
-NOTICE: DateStyle is SQL with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is SQL with US (NonEuropean) conventions
SELECT '' AS sixty_two, d1 AS us_sql FROM DATETIME_TBL;
sixty_two | us_sql
-----------+----------------------------
(8 rows)
SET DateStyle TO 'European,Postgres';
-NOTICE: DateStyle is Postgres with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with European conventions
INSERT INTO DATETIME_TBL VALUES('13/06/1957');
SELECT count(*) as one FROM DATETIME_TBL WHERE d1 = 'Jun 13 1957';
one
(8 rows)
SET DateStyle TO 'European,ISO';
-NOTICE: DateStyle is ISO with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is ISO with European conventions
SELECT '' AS sixty_three, d1 AS european_iso FROM DATETIME_TBL;
sixty_three | european_iso
-------------+---------------------------
(8 rows)
SET DateStyle TO 'European,SQL';
-NOTICE: DateStyle is SQL with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is SQL with European conventions
SELECT '' AS sixty_three, d1 AS european_sql FROM DATETIME_TBL;
sixty_three | european_sql
-------------+----------------------------
(8 rows)
RESET DateStyle;
-NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
--
-- formats
--
SET DateStyle TO 'US,Postgres';
-NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SELECT '' AS sixty_two, d1 AS us_postgres FROM DATETIME_TBL;
sixty_two | us_postgres
-----------+---------------------------------
(8 rows)
SET DateStyle TO 'US,SQL';
-NOTICE: DateStyle is SQL with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is SQL with US (NonEuropean) conventions
SELECT '' AS sixty_two, d1 AS us_sql FROM DATETIME_TBL;
sixty_two | us_sql
-----------+----------------------------
(8 rows)
SET DateStyle TO 'European,Postgres';
-NOTICE: DateStyle is Postgres with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with European conventions
INSERT INTO DATETIME_TBL VALUES('13/06/1957');
SELECT count(*) as one FROM DATETIME_TBL WHERE d1 = 'Jun 13 1957';
one
(8 rows)
SET DateStyle TO 'European,ISO';
-NOTICE: DateStyle is ISO with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is ISO with European conventions
SELECT '' AS sixty_three, d1 AS european_iso FROM DATETIME_TBL;
sixty_three | european_iso
-------------+---------------------------
(8 rows)
SET DateStyle TO 'European,SQL';
-NOTICE: DateStyle is SQL with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is SQL with European conventions
SELECT '' AS sixty_three, d1 AS european_sql FROM DATETIME_TBL;
sixty_three | european_sql
-------------+----------------------------
(8 rows)
RESET DateStyle;
-NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
-- formats
--
SET DateStyle TO 'US,Postgres';
-NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SELECT '' AS sixty_two, d1 AS us_postgres FROM DATETIME_TBL;
sixty_two | us_postgres
-----------+---------------------------------
(8 rows)
SET DateStyle TO 'US,SQL';
-NOTICE: DateStyle is SQL with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is SQL with US (NonEuropean) conventions
SELECT '' AS sixty_two, d1 AS us_sql FROM DATETIME_TBL;
sixty_two | us_sql
-----------+----------------------------
(8 rows)
SET DateStyle TO 'European,Postgres';
-NOTICE: DateStyle is Postgres with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with European conventions
INSERT INTO DATETIME_TBL VALUES('13/06/1957');
SELECT count(*) as one FROM DATETIME_TBL WHERE d1 = 'Jun 13 1957';
one
(8 rows)
SET DateStyle TO 'European,ISO';
-NOTICE: DateStyle is ISO with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is ISO with European conventions
SELECT '' AS sixty_three, d1 AS european_iso FROM DATETIME_TBL;
sixty_three | european_iso
-------------+---------------------------
(8 rows)
SET DateStyle TO 'European,SQL';
-NOTICE: DateStyle is SQL with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is SQL with European conventions
SELECT '' AS sixty_three, d1 AS european_sql FROM DATETIME_TBL;
sixty_three | european_sql
-------------+----------------------------
(8 rows)
RESET DateStyle;
-NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
--
-- formats
--
SET DateStyle TO 'US,Postgres';
-NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SELECT '' AS sixty_two, d1 AS us_postgres FROM DATETIME_TBL;
sixty_two | us_postgres
-----------+---------------------------------
(8 rows)
SET DateStyle TO 'US,SQL';
-NOTICE: DateStyle is SQL with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is SQL with US (NonEuropean) conventions
SELECT '' AS sixty_two, d1 AS us_sql FROM DATETIME_TBL;
sixty_two | us_sql
-----------+----------------------------
(8 rows)
SET DateStyle TO 'European,Postgres';
-NOTICE: DateStyle is Postgres with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with European conventions
INSERT INTO DATETIME_TBL VALUES('13/06/1957');
SELECT count(*) as one FROM DATETIME_TBL WHERE d1 = 'Jun 13 1957';
one
(8 rows)
SET DateStyle TO 'European,ISO';
-NOTICE: DateStyle is ISO with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is ISO with European conventions
SELECT '' AS sixty_three, d1 AS european_iso FROM DATETIME_TBL;
sixty_three | european_iso
-------------+---------------------------
(8 rows)
SET DateStyle TO 'European,SQL';
-NOTICE: DateStyle is SQL with European conventions
SHOW DateStyle;
+NOTICE: DateStyle is SQL with European conventions
SELECT '' AS sixty_three, d1 AS european_sql FROM DATETIME_TBL;
sixty_three | european_sql
-------------+----------------------------
(8 rows)
RESET DateStyle;
-NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
SHOW DateStyle;
+NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
-- Outer joins
--
SELECT '' AS "xxx", *
-NOTICE: OUTER JOIN not yet implemented
FROM JOIN1_TBL OUTER JOIN JOIN2_TBL USING (i);
+NOTICE: OUTER JOIN not yet implemented
ERROR: JOIN expressions are not yet implemented
SELECT '' AS "xxx", *
-NOTICE: LEFT OUTER JOIN not yet implemented
FROM JOIN1_TBL LEFT OUTER JOIN JOIN2_TBL USING (i);
+NOTICE: LEFT OUTER JOIN not yet implemented
ERROR: JOIN expressions are not yet implemented
SELECT '' AS "xxx", *
-NOTICE: RIGHT OUTER JOIN not yet implemented
FROM JOIN1_TBL RIGHT OUTER JOIN JOIN2_TBL USING (i);
+NOTICE: RIGHT OUTER JOIN not yet implemented
ERROR: JOIN expressions are not yet implemented
SELECT '' AS "xxx", *
-NOTICE: FULL OUTER JOIN not yet implemented
FROM JOIN1_TBL FULL OUTER JOIN JOIN2_TBL USING (i);
+NOTICE: FULL OUTER JOIN not yet implemented
ERROR: JOIN expressions are not yet implemented
--
-- More complicated constructs
-- no key in fkeys2
insert into fkeys values (60, '6', 4);
ERROR: check_fkeys_pkey2_exist: tuple references non-existing key in fkeys2
-NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys are deleted
delete from pkeys where pkey1 = 30 and pkey2 = '3';
-ERROR: check_fkeys2_fkey_restrict: tuple referenced in fkeys
NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys are deleted
-NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys2 are deleted
+ERROR: check_fkeys2_fkey_restrict: tuple referenced in fkeys
delete from pkeys where pkey1 = 40 and pkey2 = '4';
NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys are deleted
+NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys2 are deleted
update pkeys set pkey1 = 7, pkey2 = '70' where pkey1 = 50 and pkey2 = '5';
+NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys are deleted
ERROR: check_fkeys2_fkey_restrict: tuple referenced in fkeys
+update pkeys set pkey1 = 7, pkey2 = '70' where pkey1 = 10 and pkey2 = '1';
NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys are deleted
NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys2 are deleted
-update pkeys set pkey1 = 7, pkey2 = '70' where pkey1 = 10 and pkey2 = '1';
DROP TABLE pkeys;
DROP TABLE fkeys;
DROP TABLE fkeys2;
INSERT INTO tmp VALUES (null, 'Y', null);
INSERT INTO tmp VALUES (5, '!check failed', null);
INSERT INTO tmp VALUES (null, 'try again', null);
-NOTICE: insert_seq.nextval: sequence was re-created
INSERT INTO INSERT_TBL(y) select yd from tmp;
+NOTICE: insert_seq.nextval: sequence was re-created
SELECT '' AS three, * FROM INSERT_TBL;
three | x | y | z
-------+---+---------------+----
--
-- Primary keys
--
-NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'primary_tbl_pkey' for table 'primary_tbl'
CREATE TABLE PRIMARY_TBL (i int PRIMARY KEY, t text);
+NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'primary_tbl_pkey' for table 'primary_tbl'
INSERT INTO PRIMARY_TBL VALUES (1, 'one');
INSERT INTO PRIMARY_TBL VALUES (2, 'two');
INSERT INTO PRIMARY_TBL VALUES (1, 'three');
DROP TABLE PRIMARY_TBL;
CREATE TABLE PRIMARY_TBL (i int, t text,
-NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'primary_tbl_pkey' for table 'primary_tbl'
PRIMARY KEY(i,t));
+NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'primary_tbl_pkey' for table 'primary_tbl'
INSERT INTO PRIMARY_TBL VALUES (1, 'one');
INSERT INTO PRIMARY_TBL VALUES (2, 'two');
INSERT INTO PRIMARY_TBL VALUES (1, 'three');
--
-- Unique keys
--
-NOTICE: CREATE TABLE/UNIQUE will create implicit index 'unique_tbl_i_key' for table 'unique_tbl'
CREATE TABLE UNIQUE_TBL (i int UNIQUE, t text);
+NOTICE: CREATE TABLE/UNIQUE will create implicit index 'unique_tbl_i_key' for table 'unique_tbl'
INSERT INTO UNIQUE_TBL VALUES (1, 'one');
INSERT INTO UNIQUE_TBL VALUES (2, 'two');
INSERT INTO UNIQUE_TBL VALUES (1, 'three');
DROP TABLE UNIQUE_TBL;
CREATE TABLE UNIQUE_TBL (i int, t text,
-NOTICE: CREATE TABLE/UNIQUE will create implicit index 'unique_tbl_i_key' for table 'unique_tbl'
UNIQUE(i,t));
+NOTICE: CREATE TABLE/UNIQUE will create implicit index 'unique_tbl_i_key' for table 'unique_tbl'
INSERT INTO UNIQUE_TBL VALUES (1, 'one');
INSERT INTO UNIQUE_TBL VALUES (2, 'two');
INSERT INTO UNIQUE_TBL VALUES (1, 'three');
CREATE FUNCTION widget_in(opaque)
RETURNS widget
AS '_OBJWD_/regress_DLSUFFIX_'
-NOTICE: ProcedureCreate: type 'widget' is not yet defined
LANGUAGE 'c';
+NOTICE: ProcedureCreate: type 'widget' is not yet defined
CREATE FUNCTION widget_out(opaque)
RETURNS opaque
AS '_OBJWD_/regress_DLSUFFIX_'