(1 row)
-- test foreign data wrapper functionality
-CREATE ROLE dblink_regression_test;
+CREATE ROLE regress_dblink_user;
DO $d$
BEGIN
EXECUTE $$CREATE SERVER fdtest FOREIGN DATA WRAPPER dblink_fdw
ERROR: invalid option "server"
HINT: Valid options in this context are: user, password
CREATE USER MAPPING FOR public SERVER fdtest OPTIONS (user :'USER');
-GRANT USAGE ON FOREIGN SERVER fdtest TO dblink_regression_test;
-GRANT EXECUTE ON FUNCTION dblink_connect_u(text, text) TO dblink_regression_test;
-SET SESSION AUTHORIZATION dblink_regression_test;
+GRANT USAGE ON FOREIGN SERVER fdtest TO regress_dblink_user;
+GRANT EXECUTE ON FUNCTION dblink_connect_u(text, text) TO regress_dblink_user;
+SET SESSION AUTHORIZATION regress_dblink_user;
-- should fail
SELECT dblink_connect('myconn', 'fdtest');
ERROR: password is required
(11 rows)
\c - -
-REVOKE USAGE ON FOREIGN SERVER fdtest FROM dblink_regression_test;
-REVOKE EXECUTE ON FUNCTION dblink_connect_u(text, text) FROM dblink_regression_test;
-DROP USER dblink_regression_test;
+REVOKE USAGE ON FOREIGN SERVER fdtest FROM regress_dblink_user;
+REVOKE EXECUTE ON FUNCTION dblink_connect_u(text, text) FROM regress_dblink_user;
+DROP USER regress_dblink_user;
DROP USER MAPPING FOR public SERVER fdtest;
DROP SERVER fdtest;
-- test asynchronous notifications
SELECT dblink_disconnect('dtest1');
-- test foreign data wrapper functionality
-CREATE ROLE dblink_regression_test;
+CREATE ROLE regress_dblink_user;
DO $d$
BEGIN
EXECUTE $$CREATE SERVER fdtest FOREIGN DATA WRAPPER dblink_fdw
OPTIONS (server 'localhost'); -- fail, can't specify server here
CREATE USER MAPPING FOR public SERVER fdtest OPTIONS (user :'USER');
-GRANT USAGE ON FOREIGN SERVER fdtest TO dblink_regression_test;
-GRANT EXECUTE ON FUNCTION dblink_connect_u(text, text) TO dblink_regression_test;
+GRANT USAGE ON FOREIGN SERVER fdtest TO regress_dblink_user;
+GRANT EXECUTE ON FUNCTION dblink_connect_u(text, text) TO regress_dblink_user;
-SET SESSION AUTHORIZATION dblink_regression_test;
+SET SESSION AUTHORIZATION regress_dblink_user;
-- should fail
SELECT dblink_connect('myconn', 'fdtest');
-- should succeed
SELECT * FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[]);
\c - -
-REVOKE USAGE ON FOREIGN SERVER fdtest FROM dblink_regression_test;
-REVOKE EXECUTE ON FUNCTION dblink_connect_u(text, text) FROM dblink_regression_test;
-DROP USER dblink_regression_test;
+REVOKE USAGE ON FOREIGN SERVER fdtest FROM regress_dblink_user;
+REVOKE EXECUTE ON FUNCTION dblink_connect_u(text, text) FROM regress_dblink_user;
+DROP USER regress_dblink_user;
DROP USER MAPPING FOR public SERVER fdtest;
DROP SERVER fdtest;
--
-- Clean up in case a prior regression run failed
-SET client_min_messages TO 'error';
-DROP ROLE IF EXISTS file_fdw_superuser, file_fdw_user, no_priv_user;
+SET client_min_messages TO 'warning';
+DROP ROLE IF EXISTS regress_file_fdw_superuser, regress_file_fdw_user, regress_no_priv_user;
RESET client_min_messages;
-CREATE ROLE file_fdw_superuser LOGIN SUPERUSER; -- is a superuser
-CREATE ROLE file_fdw_user LOGIN; -- has priv and user mapping
-CREATE ROLE no_priv_user LOGIN; -- has priv but no user mapping
+CREATE ROLE regress_file_fdw_superuser LOGIN SUPERUSER; -- is a superuser
+CREATE ROLE regress_file_fdw_user LOGIN; -- has priv and user mapping
+CREATE ROLE regress_no_priv_user LOGIN; -- has priv but no user mapping
-- Install file_fdw
CREATE EXTENSION file_fdw;
--- file_fdw_superuser owns fdw-related objects
-SET ROLE file_fdw_superuser;
+-- regress_file_fdw_superuser owns fdw-related objects
+SET ROLE regress_file_fdw_superuser;
CREATE SERVER file_server FOREIGN DATA WRAPPER file_fdw;
-- privilege tests
-SET ROLE file_fdw_user;
+SET ROLE regress_file_fdw_user;
CREATE FOREIGN DATA WRAPPER file_fdw2 HANDLER file_fdw_handler VALIDATOR file_fdw_validator; -- ERROR
CREATE SERVER file_server2 FOREIGN DATA WRAPPER file_fdw; -- ERROR
-CREATE USER MAPPING FOR file_fdw_user SERVER file_server; -- ERROR
+CREATE USER MAPPING FOR regress_file_fdw_user SERVER file_server; -- ERROR
-SET ROLE file_fdw_superuser;
-GRANT USAGE ON FOREIGN SERVER file_server TO file_fdw_user;
+SET ROLE regress_file_fdw_superuser;
+GRANT USAGE ON FOREIGN SERVER file_server TO regress_file_fdw_user;
-SET ROLE file_fdw_user;
-CREATE USER MAPPING FOR file_fdw_user SERVER file_server;
+SET ROLE regress_file_fdw_user;
+CREATE USER MAPPING FOR regress_file_fdw_user SERVER file_server;
-- create user mappings and grant privilege to test users
-SET ROLE file_fdw_superuser;
-CREATE USER MAPPING FOR file_fdw_superuser SERVER file_server;
-CREATE USER MAPPING FOR no_priv_user SERVER file_server;
+SET ROLE regress_file_fdw_superuser;
+CREATE USER MAPPING FOR regress_file_fdw_superuser SERVER file_server;
+CREATE USER MAPPING FOR regress_no_priv_user SERVER file_server;
-- validator tests
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (format 'xml'); -- ERROR
b float4
) SERVER file_server
OPTIONS (format 'text', filename '@abs_srcdir@/data/agg.data', delimiter ' ', null '\N');
-GRANT SELECT ON agg_text TO file_fdw_user;
+GRANT SELECT ON agg_text TO regress_file_fdw_user;
CREATE FOREIGN TABLE agg_csv (
a int2,
b float4
DROP TABLE agg;
-- privilege tests
-SET ROLE file_fdw_superuser;
+SET ROLE regress_file_fdw_superuser;
SELECT * FROM agg_text ORDER BY a;
-SET ROLE file_fdw_user;
+SET ROLE regress_file_fdw_user;
SELECT * FROM agg_text ORDER BY a;
-SET ROLE no_priv_user;
+SET ROLE regress_no_priv_user;
SELECT * FROM agg_text ORDER BY a; -- ERROR
-SET ROLE file_fdw_user;
+SET ROLE regress_file_fdw_user;
\t on
EXPLAIN (VERBOSE, COSTS FALSE) SELECT * FROM agg_text WHERE a > 0;
\t off
-- file FDW allows foreign tables to be accessed without user mapping
-DROP USER MAPPING FOR file_fdw_user SERVER file_server;
+DROP USER MAPPING FOR regress_file_fdw_user SERVER file_server;
SELECT * FROM agg_text ORDER BY a;
-- privilege tests for object
-SET ROLE file_fdw_superuser;
-ALTER FOREIGN TABLE agg_text OWNER TO file_fdw_user;
+SET ROLE regress_file_fdw_superuser;
+ALTER FOREIGN TABLE agg_text OWNER TO regress_file_fdw_user;
ALTER FOREIGN TABLE agg_text OPTIONS (SET format 'text');
-SET ROLE file_fdw_user;
+SET ROLE regress_file_fdw_user;
ALTER FOREIGN TABLE agg_text OPTIONS (SET format 'text');
-SET ROLE file_fdw_superuser;
+SET ROLE regress_file_fdw_superuser;
-- cleanup
RESET ROLE;
DROP EXTENSION file_fdw CASCADE;
-DROP ROLE file_fdw_superuser, file_fdw_user, no_priv_user;
+DROP ROLE regress_file_fdw_superuser, regress_file_fdw_user, regress_no_priv_user;
-- Test foreign-data wrapper file_fdw.
--
-- Clean up in case a prior regression run failed
-SET client_min_messages TO 'error';
-DROP ROLE IF EXISTS file_fdw_superuser, file_fdw_user, no_priv_user;
+SET client_min_messages TO 'warning';
+DROP ROLE IF EXISTS regress_file_fdw_superuser, regress_file_fdw_user, regress_no_priv_user;
RESET client_min_messages;
-CREATE ROLE file_fdw_superuser LOGIN SUPERUSER; -- is a superuser
-CREATE ROLE file_fdw_user LOGIN; -- has priv and user mapping
-CREATE ROLE no_priv_user LOGIN; -- has priv but no user mapping
+CREATE ROLE regress_file_fdw_superuser LOGIN SUPERUSER; -- is a superuser
+CREATE ROLE regress_file_fdw_user LOGIN; -- has priv and user mapping
+CREATE ROLE regress_no_priv_user LOGIN; -- has priv but no user mapping
-- Install file_fdw
CREATE EXTENSION file_fdw;
--- file_fdw_superuser owns fdw-related objects
-SET ROLE file_fdw_superuser;
+-- regress_file_fdw_superuser owns fdw-related objects
+SET ROLE regress_file_fdw_superuser;
CREATE SERVER file_server FOREIGN DATA WRAPPER file_fdw;
-- privilege tests
-SET ROLE file_fdw_user;
+SET ROLE regress_file_fdw_user;
CREATE FOREIGN DATA WRAPPER file_fdw2 HANDLER file_fdw_handler VALIDATOR file_fdw_validator; -- ERROR
ERROR: permission denied to create foreign-data wrapper "file_fdw2"
HINT: Must be superuser to create a foreign-data wrapper.
CREATE SERVER file_server2 FOREIGN DATA WRAPPER file_fdw; -- ERROR
ERROR: permission denied for foreign-data wrapper file_fdw
-CREATE USER MAPPING FOR file_fdw_user SERVER file_server; -- ERROR
+CREATE USER MAPPING FOR regress_file_fdw_user SERVER file_server; -- ERROR
ERROR: permission denied for foreign server file_server
-SET ROLE file_fdw_superuser;
-GRANT USAGE ON FOREIGN SERVER file_server TO file_fdw_user;
-SET ROLE file_fdw_user;
-CREATE USER MAPPING FOR file_fdw_user SERVER file_server;
+SET ROLE regress_file_fdw_superuser;
+GRANT USAGE ON FOREIGN SERVER file_server TO regress_file_fdw_user;
+SET ROLE regress_file_fdw_user;
+CREATE USER MAPPING FOR regress_file_fdw_user SERVER file_server;
-- create user mappings and grant privilege to test users
-SET ROLE file_fdw_superuser;
-CREATE USER MAPPING FOR file_fdw_superuser SERVER file_server;
-CREATE USER MAPPING FOR no_priv_user SERVER file_server;
+SET ROLE regress_file_fdw_superuser;
+CREATE USER MAPPING FOR regress_file_fdw_superuser SERVER file_server;
+CREATE USER MAPPING FOR regress_no_priv_user SERVER file_server;
-- validator tests
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (format 'xml'); -- ERROR
ERROR: COPY format "xml" not recognized
b float4
) SERVER file_server
OPTIONS (format 'text', filename '@abs_srcdir@/data/agg.data', delimiter ' ', null '\N');
-GRANT SELECT ON agg_text TO file_fdw_user;
+GRANT SELECT ON agg_text TO regress_file_fdw_user;
CREATE FOREIGN TABLE agg_csv (
a int2,
b float4
ALTER FOREIGN TABLE agg_csv NO INHERIT agg;
DROP TABLE agg;
-- privilege tests
-SET ROLE file_fdw_superuser;
+SET ROLE regress_file_fdw_superuser;
SELECT * FROM agg_text ORDER BY a;
a | b
-----+---------
100 | 99.097
(4 rows)
-SET ROLE file_fdw_user;
+SET ROLE regress_file_fdw_user;
SELECT * FROM agg_text ORDER BY a;
a | b
-----+---------
100 | 99.097
(4 rows)
-SET ROLE no_priv_user;
+SET ROLE regress_no_priv_user;
SELECT * FROM agg_text ORDER BY a; -- ERROR
ERROR: permission denied for relation agg_text
-SET ROLE file_fdw_user;
+SET ROLE regress_file_fdw_user;
\t on
EXPLAIN (VERBOSE, COSTS FALSE) SELECT * FROM agg_text WHERE a > 0;
Foreign Scan on public.agg_text
\t off
-- file FDW allows foreign tables to be accessed without user mapping
-DROP USER MAPPING FOR file_fdw_user SERVER file_server;
+DROP USER MAPPING FOR regress_file_fdw_user SERVER file_server;
SELECT * FROM agg_text ORDER BY a;
a | b
-----+---------
(4 rows)
-- privilege tests for object
-SET ROLE file_fdw_superuser;
-ALTER FOREIGN TABLE agg_text OWNER TO file_fdw_user;
+SET ROLE regress_file_fdw_superuser;
+ALTER FOREIGN TABLE agg_text OWNER TO regress_file_fdw_user;
ALTER FOREIGN TABLE agg_text OPTIONS (SET format 'text');
-SET ROLE file_fdw_user;
+SET ROLE regress_file_fdw_user;
ALTER FOREIGN TABLE agg_text OPTIONS (SET format 'text');
ERROR: only superuser can change options of a file_fdw foreign table
-SET ROLE file_fdw_superuser;
+SET ROLE regress_file_fdw_superuser;
-- cleanup
RESET ROLE;
DROP EXTENSION file_fdw CASCADE;
NOTICE: drop cascades to 7 other objects
DETAIL: drop cascades to server file_server
-drop cascades to user mapping for file_fdw_superuser on server file_server
-drop cascades to user mapping for no_priv_user on server file_server
+drop cascades to user mapping for regress_file_fdw_superuser on server file_server
+drop cascades to user mapping for regress_no_priv_user on server file_server
drop cascades to foreign table agg_text
drop cascades to foreign table agg_csv
drop cascades to foreign table agg_bad
drop cascades to foreign table text_csv
-DROP ROLE file_fdw_superuser, file_fdw_user, no_priv_user;
+DROP ROLE regress_file_fdw_superuser, regress_file_fdw_user, regress_no_priv_user;
--
-- clean-up in case a prior regression run failed
SET client_min_messages TO 'warning';
-DROP DATABASE IF EXISTS regtest_sepgsql_test_database_1;
-DROP DATABASE IF EXISTS regtest_sepgsql_test_database;
-DROP USER IF EXISTS regtest_sepgsql_test_user;
+DROP DATABASE IF EXISTS sepgsql_test_regression_1;
+DROP DATABASE IF EXISTS sepgsql_test_regression;
+DROP USER IF EXISTS regress_sepgsql_test_user;
RESET client_min_messages;
SELECT sepgsql_getcon(); -- confirm client privilege
sepgsql_getcon
--
-- CREATE Objects to be altered (with debug_audit being silent)
--
-CREATE DATABASE regtest_sepgsql_test_database_1;
-CREATE USER regtest_sepgsql_test_user;
+CREATE DATABASE sepgsql_test_regression_1;
+CREATE USER regress_sepgsql_test_user;
CREATE SCHEMA regtest_schema_1;
CREATE SCHEMA regtest_schema_2;
GRANT ALL ON SCHEMA regtest_schema_1 TO public;
-- XXX: It should take db_xxx:{setattr} permission checks even if
-- owner is not actually changed.
--
-ALTER DATABASE regtest_sepgsql_test_database_1 OWNER TO regtest_sepgsql_test_user;
-LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="regtest_sepgsql_test_database_1"
-ALTER DATABASE regtest_sepgsql_test_database_1 OWNER TO regtest_sepgsql_test_user;
-LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="regtest_sepgsql_test_database_1"
-ALTER SCHEMA regtest_schema_1 OWNER TO regtest_sepgsql_test_user;
+ALTER DATABASE sepgsql_test_regression_1 OWNER TO regress_sepgsql_test_user;
+LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="sepgsql_test_regression_1"
+ALTER DATABASE sepgsql_test_regression_1 OWNER TO regress_sepgsql_test_user;
+LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="sepgsql_test_regression_1"
+ALTER SCHEMA regtest_schema_1 OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema_1"
-ALTER SCHEMA regtest_schema_1 OWNER TO regtest_sepgsql_test_user;
+ALTER SCHEMA regtest_schema_1 OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema_1"
-ALTER TABLE regtest_table_1 OWNER TO regtest_sepgsql_test_user;
+ALTER TABLE regtest_table_1 OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema_1"
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema_2"
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=system_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="public"
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_table name="regtest_schema_1.regtest_table_1"
-ALTER TABLE regtest_table_1 OWNER TO regtest_sepgsql_test_user;
+ALTER TABLE regtest_table_1 OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_table name="regtest_schema_1.regtest_table_1"
-ALTER SEQUENCE regtest_seq_1 OWNER TO regtest_sepgsql_test_user;
+ALTER SEQUENCE regtest_seq_1 OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_seq_t:s0 tclass=db_sequence name="regtest_schema_1.regtest_seq_1"
-ALTER SEQUENCE regtest_seq_1 OWNER TO regtest_sepgsql_test_user;
+ALTER SEQUENCE regtest_seq_1 OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_seq_t:s0 tclass=db_sequence name="regtest_schema_1.regtest_seq_1"
-ALTER VIEW regtest_view_1 OWNER TO regtest_sepgsql_test_user;
+ALTER VIEW regtest_view_1 OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_view_t:s0 tclass=db_view name="regtest_schema_1.regtest_view_1"
-ALTER VIEW regtest_view_1 OWNER TO regtest_sepgsql_test_user;
+ALTER VIEW regtest_view_1 OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_view_t:s0 tclass=db_view name="regtest_schema_1.regtest_view_1"
-ALTER FUNCTION regtest_func_1(text) OWNER TO regtest_sepgsql_test_user;
+ALTER FUNCTION regtest_func_1(text) OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="regtest_schema_1.regtest_func_1(pg_catalog.text)"
-ALTER FUNCTION regtest_func_1(text) OWNER TO regtest_sepgsql_test_user;
+ALTER FUNCTION regtest_func_1(text) OWNER TO regress_sepgsql_test_user;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="regtest_schema_1.regtest_func_1(pg_catalog.text)"
--
-- ALTER xxx SET SCHEMA
--
-- ALTER xxx RENAME TO
--
-ALTER DATABASE regtest_sepgsql_test_database_1 RENAME TO regtest_sepgsql_test_database;
-LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="regtest_sepgsql_test_database_1"
+ALTER DATABASE sepgsql_test_regression_1 RENAME TO sepgsql_test_regression;
+LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="sepgsql_test_regression_1"
ALTER SCHEMA regtest_schema_1 RENAME TO regtest_schema;
LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema_1"
ALTER TABLE regtest_table_1 RENAME TO regtest_table;
--
-- misc ALTER commands
--
-ALTER DATABASE regtest_sepgsql_test_database CONNECTION LIMIT 999;
-LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="regtest_sepgsql_test_database"
-ALTER DATABASE regtest_sepgsql_test_database SET search_path TO regtest_schema, public; -- not supported yet
+ALTER DATABASE sepgsql_test_regression CONNECTION LIMIT 999;
+LOG: SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="sepgsql_test_regression"
+ALTER DATABASE sepgsql_test_regression SET search_path TO regtest_schema, public; -- not supported yet
ALTER TABLE regtest_table ADD COLUMN d float;
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema"
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema_2"
--
RESET sepgsql.debug_audit;
RESET client_min_messages;
-DROP DATABASE regtest_sepgsql_test_database;
+DROP DATABASE sepgsql_test_regression;
DROP SCHEMA regtest_schema CASCADE;
NOTICE: drop cascades to 3 other objects
DETAIL: drop cascades to table regtest_table_2
drop cascades to sequence regtest_seq
drop cascades to view regtest_view
drop cascades to function regtest_func(text)
-DROP USER regtest_sepgsql_test_user;
+DROP USER regress_sepgsql_test_user;
--
-- clean-up in case a prior regression run failed
SET client_min_messages TO 'warning';
-DROP DATABASE IF EXISTS regtest_sepgsql_test_database;
-DROP USER IF EXISTS regtest_sepgsql_test_user;
+DROP DATABASE IF EXISTS sepgsql_test_regression;
+DROP USER IF EXISTS regress_sepgsql_test_user;
RESET client_min_messages;
-- confirm required permissions using audit messages
SELECT sepgsql_getcon(); -- confirm client privilege
--
-- CREATE Permission checks
--
-CREATE DATABASE regtest_sepgsql_test_database;
+CREATE DATABASE sepgsql_test_regression;
LOG: SELinux: allowed { getattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=system_u:object_r:sepgsql_db_t:s0 tclass=db_database name="template1"
-LOG: SELinux: allowed { create } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="regtest_sepgsql_test_database"
-CREATE USER regtest_sepgsql_test_user;
+LOG: SELinux: allowed { create } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="sepgsql_test_regression"
+CREATE USER regress_sepgsql_test_user;
CREATE SCHEMA regtest_schema;
LOG: SELinux: allowed { create } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema"
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=system_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="public"
-GRANT ALL ON SCHEMA regtest_schema TO regtest_sepgsql_test_user;
+GRANT ALL ON SCHEMA regtest_schema TO regress_sepgsql_test_user;
SET search_path = regtest_schema, public;
CREATE TABLE regtest_table (x serial primary key, y text);
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema"
LOG: SELinux: allowed { add_name } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema"
LOG: SELinux: allowed { create } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="regtest_schema.regtest_agg(integer)"
-- CREATE objects owned by others
-SET SESSION AUTHORIZATION regtest_sepgsql_test_user;
+SET SESSION AUTHORIZATION regress_sepgsql_test_user;
SET search_path = regtest_schema, public;
CREATE TABLE regtest_table_3 (x int, y serial);
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema"
LOG: SELinux: allowed { drop } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="regtest_schema.regtest_table.ctid"
LOG: SELinux: allowed { drop } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="regtest_schema.regtest_table.x"
LOG: SELinux: allowed { drop } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="regtest_schema.regtest_table.z"
-DROP OWNED BY regtest_sepgsql_test_user;
+DROP OWNED BY regress_sepgsql_test_user;
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema"
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=system_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="public"
LOG: SELinux: allowed { remove_name } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema"
LOG: SELinux: allowed { drop } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="regtest_schema.regtest_table_3.ctid"
LOG: SELinux: allowed { drop } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="regtest_schema.regtest_table_3.x"
LOG: SELinux: allowed { drop } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="regtest_schema.regtest_table_3.y"
-DROP DATABASE regtest_sepgsql_test_database;
-LOG: SELinux: allowed { drop } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="regtest_sepgsql_test_database"
-DROP USER regtest_sepgsql_test_user;
+DROP DATABASE sepgsql_test_regression;
+LOG: SELinux: allowed { drop } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_db_t:s0 tclass=db_database name="sepgsql_test_regression"
+DROP USER regress_sepgsql_test_user;
DROP SCHEMA IF EXISTS regtest_schema CASCADE;
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema"
LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=system_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="public"
-- clean-up in case a prior regression run failed
SET client_min_messages TO 'warning';
-DROP DATABASE IF EXISTS regtest_sepgsql_test_database_1;
-DROP DATABASE IF EXISTS regtest_sepgsql_test_database;
-DROP USER IF EXISTS regtest_sepgsql_test_user;
+DROP DATABASE IF EXISTS sepgsql_test_regression_1;
+DROP DATABASE IF EXISTS sepgsql_test_regression;
+DROP USER IF EXISTS regress_sepgsql_test_user;
RESET client_min_messages;
-- @SECURITY-CONTEXT=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
--
-- CREATE Objects to be altered (with debug_audit being silent)
--
-CREATE DATABASE regtest_sepgsql_test_database_1;
+CREATE DATABASE sepgsql_test_regression_1;
-CREATE USER regtest_sepgsql_test_user;
+CREATE USER regress_sepgsql_test_user;
CREATE SCHEMA regtest_schema_1;
CREATE SCHEMA regtest_schema_2;
-- XXX: It should take db_xxx:{setattr} permission checks even if
-- owner is not actually changed.
--
-ALTER DATABASE regtest_sepgsql_test_database_1 OWNER TO regtest_sepgsql_test_user;
-ALTER DATABASE regtest_sepgsql_test_database_1 OWNER TO regtest_sepgsql_test_user;
-ALTER SCHEMA regtest_schema_1 OWNER TO regtest_sepgsql_test_user;
-ALTER SCHEMA regtest_schema_1 OWNER TO regtest_sepgsql_test_user;
-ALTER TABLE regtest_table_1 OWNER TO regtest_sepgsql_test_user;
-ALTER TABLE regtest_table_1 OWNER TO regtest_sepgsql_test_user;
-ALTER SEQUENCE regtest_seq_1 OWNER TO regtest_sepgsql_test_user;
-ALTER SEQUENCE regtest_seq_1 OWNER TO regtest_sepgsql_test_user;
-ALTER VIEW regtest_view_1 OWNER TO regtest_sepgsql_test_user;
-ALTER VIEW regtest_view_1 OWNER TO regtest_sepgsql_test_user;
-ALTER FUNCTION regtest_func_1(text) OWNER TO regtest_sepgsql_test_user;
-ALTER FUNCTION regtest_func_1(text) OWNER TO regtest_sepgsql_test_user;
+ALTER DATABASE sepgsql_test_regression_1 OWNER TO regress_sepgsql_test_user;
+ALTER DATABASE sepgsql_test_regression_1 OWNER TO regress_sepgsql_test_user;
+ALTER SCHEMA regtest_schema_1 OWNER TO regress_sepgsql_test_user;
+ALTER SCHEMA regtest_schema_1 OWNER TO regress_sepgsql_test_user;
+ALTER TABLE regtest_table_1 OWNER TO regress_sepgsql_test_user;
+ALTER TABLE regtest_table_1 OWNER TO regress_sepgsql_test_user;
+ALTER SEQUENCE regtest_seq_1 OWNER TO regress_sepgsql_test_user;
+ALTER SEQUENCE regtest_seq_1 OWNER TO regress_sepgsql_test_user;
+ALTER VIEW regtest_view_1 OWNER TO regress_sepgsql_test_user;
+ALTER VIEW regtest_view_1 OWNER TO regress_sepgsql_test_user;
+ALTER FUNCTION regtest_func_1(text) OWNER TO regress_sepgsql_test_user;
+ALTER FUNCTION regtest_func_1(text) OWNER TO regress_sepgsql_test_user;
--
-- ALTER xxx SET SCHEMA
--
-- ALTER xxx RENAME TO
--
-ALTER DATABASE regtest_sepgsql_test_database_1 RENAME TO regtest_sepgsql_test_database;
+ALTER DATABASE sepgsql_test_regression_1 RENAME TO sepgsql_test_regression;
ALTER SCHEMA regtest_schema_1 RENAME TO regtest_schema;
ALTER TABLE regtest_table_1 RENAME TO regtest_table;
ALTER SEQUENCE regtest_seq_1 RENAME TO regtest_seq;
--
-- misc ALTER commands
--
-ALTER DATABASE regtest_sepgsql_test_database CONNECTION LIMIT 999;
-ALTER DATABASE regtest_sepgsql_test_database SET search_path TO regtest_schema, public; -- not supported yet
+ALTER DATABASE sepgsql_test_regression CONNECTION LIMIT 999;
+ALTER DATABASE sepgsql_test_regression SET search_path TO regtest_schema, public; -- not supported yet
ALTER TABLE regtest_table ADD COLUMN d float;
ALTER TABLE regtest_table DROP COLUMN d;
--
RESET sepgsql.debug_audit;
RESET client_min_messages;
-DROP DATABASE regtest_sepgsql_test_database;
+DROP DATABASE sepgsql_test_regression;
DROP SCHEMA regtest_schema CASCADE;
DROP SCHEMA regtest_schema_2 CASCADE;
-DROP USER regtest_sepgsql_test_user;
+DROP USER regress_sepgsql_test_user;
-- clean-up in case a prior regression run failed
SET client_min_messages TO 'warning';
-DROP DATABASE IF EXISTS regtest_sepgsql_test_database;
-DROP USER IF EXISTS regtest_sepgsql_test_user;
+DROP DATABASE IF EXISTS sepgsql_test_regression;
+DROP USER IF EXISTS regress_sepgsql_test_user;
RESET client_min_messages;
-- confirm required permissions using audit messages
--
-- CREATE Permission checks
--
-CREATE DATABASE regtest_sepgsql_test_database;
+CREATE DATABASE sepgsql_test_regression;
-CREATE USER regtest_sepgsql_test_user;
+CREATE USER regress_sepgsql_test_user;
CREATE SCHEMA regtest_schema;
-GRANT ALL ON SCHEMA regtest_schema TO regtest_sepgsql_test_user;
+GRANT ALL ON SCHEMA regtest_schema TO regress_sepgsql_test_user;
SET search_path = regtest_schema, public;
);
-- CREATE objects owned by others
-SET SESSION AUTHORIZATION regtest_sepgsql_test_user;
+SET SESSION AUTHORIZATION regress_sepgsql_test_user;
SET search_path = regtest_schema, public;
DROP TABLE regtest_table;
-DROP OWNED BY regtest_sepgsql_test_user;
+DROP OWNED BY regress_sepgsql_test_user;
-DROP DATABASE regtest_sepgsql_test_database;
-DROP USER regtest_sepgsql_test_user;
+DROP DATABASE sepgsql_test_regression;
+DROP USER regress_sepgsql_test_user;
DROP SCHEMA IF EXISTS regtest_schema CASCADE;
-- predictability
SET synchronous_commit = on;
-- setup
-CREATE ROLE lr_normal;
-CREATE ROLE lr_superuser SUPERUSER;
-CREATE ROLE lr_replication REPLICATION;
+CREATE ROLE regress_lr_normal;
+CREATE ROLE regress_lr_superuser SUPERUSER;
+CREATE ROLE regress_lr_replication REPLICATION;
CREATE TABLE lr_test(data text);
-- superuser can control replication
-SET ROLE lr_superuser;
+SET ROLE regress_lr_superuser;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
?column?
----------
RESET ROLE;
-- replication user can control replication
-SET ROLE lr_replication;
+SET ROLE regress_lr_replication;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
?column?
----------
RESET ROLE;
-- plain user *can't* can control replication
-SET ROLE lr_normal;
+SET ROLE regress_lr_normal;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
ERROR: must be superuser or replication role to use replication slots
INSERT INTO lr_test VALUES('lr_superuser_init');
ERROR: must be superuser or replication role to use replication slots
RESET ROLE;
-- replication users can drop superuser created slots
-SET ROLE lr_superuser;
+SET ROLE regress_lr_superuser;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
?column?
----------
(1 row)
RESET ROLE;
-SET ROLE lr_replication;
+SET ROLE regress_lr_replication;
SELECT pg_drop_replication_slot('regression_slot');
pg_drop_replication_slot
--------------------------
RESET ROLE;
-- normal users can't drop existing slots
-SET ROLE lr_superuser;
+SET ROLE regress_lr_superuser;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
?column?
----------
(1 row)
RESET ROLE;
-SET ROLE lr_normal;
+SET ROLE regress_lr_normal;
SELECT pg_drop_replication_slot('regression_slot');
ERROR: must be superuser or replication role to use replication slots
RESET ROLE;
-- all users can see existing slots
-SET ROLE lr_superuser;
+SET ROLE regress_lr_superuser;
SELECT slot_name, plugin FROM pg_replication_slots;
slot_name | plugin
-----------------+---------------
(1 row)
RESET ROLE;
-SET ROLE lr_replication;
+SET ROLE regress_lr_replication;
SELECT slot_name, plugin FROM pg_replication_slots;
slot_name | plugin
-----------------+---------------
(1 row)
RESET ROLE;
-SET ROLE lr_normal;
+SET ROLE regress_lr_normal;
SELECT slot_name, plugin FROM pg_replication_slots;
slot_name | plugin
-----------------+---------------
(1 row)
-DROP ROLE lr_normal;
-DROP ROLE lr_superuser;
-DROP ROLE lr_replication;
+DROP ROLE regress_lr_normal;
+DROP ROLE regress_lr_superuser;
+DROP ROLE regress_lr_replication;
DROP TABLE lr_test;
SET synchronous_commit = on;
-- setup
-CREATE ROLE lr_normal;
-CREATE ROLE lr_superuser SUPERUSER;
-CREATE ROLE lr_replication REPLICATION;
+CREATE ROLE regress_lr_normal;
+CREATE ROLE regress_lr_superuser SUPERUSER;
+CREATE ROLE regress_lr_replication REPLICATION;
CREATE TABLE lr_test(data text);
-- superuser can control replication
-SET ROLE lr_superuser;
+SET ROLE regress_lr_superuser;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
INSERT INTO lr_test VALUES('lr_superuser_init');
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
RESET ROLE;
-- replication user can control replication
-SET ROLE lr_replication;
+SET ROLE regress_lr_replication;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
INSERT INTO lr_test VALUES('lr_superuser_init');
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
RESET ROLE;
-- plain user *can't* can control replication
-SET ROLE lr_normal;
+SET ROLE regress_lr_normal;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
INSERT INTO lr_test VALUES('lr_superuser_init');
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
RESET ROLE;
-- replication users can drop superuser created slots
-SET ROLE lr_superuser;
+SET ROLE regress_lr_superuser;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
RESET ROLE;
-SET ROLE lr_replication;
+SET ROLE regress_lr_replication;
SELECT pg_drop_replication_slot('regression_slot');
RESET ROLE;
-- normal users can't drop existing slots
-SET ROLE lr_superuser;
+SET ROLE regress_lr_superuser;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
RESET ROLE;
-SET ROLE lr_normal;
+SET ROLE regress_lr_normal;
SELECT pg_drop_replication_slot('regression_slot');
RESET ROLE;
-- all users can see existing slots
-SET ROLE lr_superuser;
+SET ROLE regress_lr_superuser;
SELECT slot_name, plugin FROM pg_replication_slots;
RESET ROLE;
-SET ROLE lr_replication;
+SET ROLE regress_lr_replication;
SELECT slot_name, plugin FROM pg_replication_slots;
RESET ROLE;
-SET ROLE lr_normal;
+SET ROLE regress_lr_normal;
SELECT slot_name, plugin FROM pg_replication_slots;
RESET ROLE;
-- cleanup
SELECT pg_drop_replication_slot('regression_slot');
-DROP ROLE lr_normal;
-DROP ROLE lr_superuser;
-DROP ROLE lr_replication;
+DROP ROLE regress_lr_normal;
+DROP ROLE regress_lr_superuser;
+DROP ROLE regress_lr_replication;
DROP TABLE lr_test;
CREATE SERVER fdtest FOREIGN DATA WRAPPER dblink_fdw OPTIONS (hostaddr '127.0.0.1', dbname 'contrib_regression');
-CREATE USER dblink_regression_test WITH PASSWORD 'secret';
-CREATE USER MAPPING FOR dblink_regression_test SERVER fdtest OPTIONS (user 'dblink_regression_test', password 'secret');
-GRANT USAGE ON FOREIGN SERVER fdtest TO dblink_regression_test;
-GRANT SELECT ON TABLE foo TO dblink_regression_test;
+CREATE USER regress_dblink_user WITH PASSWORD 'secret';
+CREATE USER MAPPING FOR regress_dblink_user SERVER fdtest OPTIONS (user 'regress_dblink_user', password 'secret');
+GRANT USAGE ON FOREIGN SERVER fdtest TO regress_dblink_user;
+GRANT SELECT ON TABLE foo TO regress_dblink_user;
\set ORIGINAL_USER :USER
-\c - dblink_regression_test
+\c - regress_dblink_user
SELECT dblink_connect('myconn', 'fdtest');
dblink_connect
----------------
(11 rows)
\c - :ORIGINAL_USER
-REVOKE USAGE ON FOREIGN SERVER fdtest FROM dblink_regression_test;
-REVOKE SELECT ON TABLE foo FROM dblink_regression_test;
-DROP USER MAPPING FOR dblink_regression_test SERVER fdtest;
-DROP USER dblink_regression_test;
+REVOKE USAGE ON FOREIGN SERVER fdtest FROM regress_dblink_user;
+REVOKE SELECT ON TABLE foo FROM regress_dblink_user;
+DROP USER MAPPING FOR regress_dblink_user SERVER fdtest;
+DROP USER regress_dblink_user;
DROP SERVER fdtest;
</screen>
</refsect1>
<envar>PGPORT</envar> environment variables. The tests will be run in a
database named <literal>regression</>; any existing database by this name
will be dropped.
+ </para>
+
+ <para>
The tests will also transiently create some cluster-wide objects, such as
- user identities named <literal>regressuser<replaceable>N</></literal>.
+ roles and tablespaces. These objects will have names beginning with
+ <literal>regress_</literal>. Beware of using <literal>installcheck</>
+ mode in installations that have any actual users or tablespaces named
+ that way.
</para>
</sect2>
<para>
When using <literal>installcheck</> mode, these tests will destroy any
existing databases named <literal>pl_regression</>,
- <literal>contrib_regression</>, <literal>isolationtest</>,
- <literal>regress1</>, or <literal>connectdb</>, as well as
+ <literal>contrib_regression</>, <literal>isolation_regression</>,
+ <literal>ecpg1_regression</>, or <literal>ecpg2_regression</>, as well as
<literal>regression</>.
</para>
</sect2>
role => {
dump_cmd => [
'pg_dump', '-f',
- "$tempdir/role.sql", '--role=dump_test',
+ "$tempdir/role.sql", '--role=regress_dump_test_role',
'--schema=dump_test_second_schema', 'postgres', ], },
schema_only => {
dump_cmd =>
# as the regexps are used for each run the test applies to.
my %tests = (
- 'ALTER DEFAULT PRIVILEGES FOR ROLE dump_test' => {
+ 'ALTER DEFAULT PRIVILEGES FOR ROLE regress_dump_test_role' => {
create_order => 14,
create_sql => 'ALTER DEFAULT PRIVILEGES
- FOR ROLE dump_test IN SCHEMA dump_test
- GRANT SELECT ON TABLES TO dump_test;',
+ FOR ROLE regress_dump_test_role IN SCHEMA dump_test
+ GRANT SELECT ON TABLES TO regress_dump_test_role;',
regexp => qr/^
\QALTER DEFAULT PRIVILEGES \E
- \QFOR ROLE dump_test IN SCHEMA dump_test \E
- \QGRANT SELECT ON TABLES TO dump_test;\E
+ \QFOR ROLE regress_dump_test_role IN SCHEMA dump_test \E
+ \QGRANT SELECT ON TABLES TO regress_dump_test_role;\E
/xm,
like => {
binary_upgrade => 1,
pg_dumpall_globals_clean => 1,
section_pre_data => 1,
section_data => 1, }, },
- 'ALTER ROLE dump_test' => {
+ 'ALTER ROLE regress_dump_test_role' => {
regexp => qr/^
- \QALTER ROLE dump_test WITH \E
+ \QALTER ROLE regress_dump_test_role WITH \E
\QNOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN \E
\QNOREPLICATION NOBYPASSRLS;\E
/xm,
pg_dumpall_globals_clean => 1,
schema_only => 1,
section_post_data => 1, }, },
- 'CREATE ROLE dump_test' => {
+ 'CREATE ROLE regress_dump_test_role' => {
create_order => 1,
- create_sql => 'CREATE ROLE dump_test;',
- regexp => qr/^CREATE ROLE dump_test;/m,
+ create_sql => 'CREATE ROLE regress_dump_test_role;',
+ regexp => qr/^CREATE ROLE regress_dump_test_role;/m,
like => {
pg_dumpall_dbprivs => 1,
pg_dumpall_globals => 1,
'CREATE POLICY p2 ON test_table FOR SELECT' => {
create_order => 24,
create_sql => 'CREATE POLICY p2 ON dump_test.test_table
- FOR SELECT TO dump_test USING (true);',
+ FOR SELECT TO regress_dump_test_role USING (true);',
regexp => qr/^
- \QCREATE POLICY p2 ON test_table FOR SELECT TO dump_test \E
+ \QCREATE POLICY p2 ON test_table FOR SELECT TO regress_dump_test_role \E
\QUSING (true);\E
/xm,
like => {
'CREATE POLICY p3 ON test_table FOR INSERT' => {
create_order => 25,
create_sql => 'CREATE POLICY p3 ON dump_test.test_table
- FOR INSERT TO dump_test WITH CHECK (true);',
+ FOR INSERT TO regress_dump_test_role WITH CHECK (true);',
regexp => qr/^
\QCREATE POLICY p3 ON test_table FOR INSERT \E
- \QTO dump_test WITH CHECK (true);\E
+ \QTO regress_dump_test_role WITH CHECK (true);\E
/xm,
like => {
binary_upgrade => 1,
'CREATE POLICY p4 ON test_table FOR UPDATE' => {
create_order => 26,
create_sql => 'CREATE POLICY p4 ON dump_test.test_table FOR UPDATE
- TO dump_test USING (true) WITH CHECK (true);',
+ TO regress_dump_test_role USING (true) WITH CHECK (true);',
regexp => qr/^
- \QCREATE POLICY p4 ON test_table FOR UPDATE TO dump_test \E
+ \QCREATE POLICY p4 ON test_table FOR UPDATE TO regress_dump_test_role \E
\QUSING (true) WITH CHECK (true);\E
/xm,
like => {
'CREATE POLICY p5 ON test_table FOR DELETE' => {
create_order => 27,
create_sql => 'CREATE POLICY p5 ON dump_test.test_table
- FOR DELETE TO dump_test USING (true);',
+ FOR DELETE TO regress_dump_test_role USING (true);',
regexp => qr/^
\QCREATE POLICY p5 ON test_table FOR DELETE \E
- \QTO dump_test USING (true);\E
+ \QTO regress_dump_test_role USING (true);\E
/xm,
like => {
binary_upgrade => 1,
/xm,
like => { clean_if_exists => 1, },
unlike => { clean => 1, }, },
- 'DROP ROLE dump_test' => {
+ 'DROP ROLE regress_dump_test_role' => {
regexp => qr/^
- \QDROP ROLE dump_test;\E
+ \QDROP ROLE regress_dump_test_role;\E
/xm,
like => { pg_dumpall_globals_clean => 1, },
unlike => {
'GRANT USAGE ON SCHEMA dump_test_second_schema' => {
create_order => 10,
create_sql => 'GRANT USAGE ON SCHEMA dump_test_second_schema
- TO dump_test;',
+ TO regress_dump_test_role;',
regexp => qr/^
- \QGRANT USAGE ON SCHEMA dump_test_second_schema TO dump_test;\E
+ \QGRANT USAGE ON SCHEMA dump_test_second_schema TO regress_dump_test_role;\E
/xm,
like => {
binary_upgrade => 1,
test_schema_plus_blobs => 1, }, },
'GRANT CREATE ON DATABASE dump_test' => {
create_order => 48,
- create_sql => 'GRANT CREATE ON DATABASE dump_test TO dump_test;',
+ create_sql => 'GRANT CREATE ON DATABASE dump_test TO regress_dump_test_role;',
regexp => qr/^
- \QGRANT CREATE ON DATABASE dump_test TO dump_test;\E
+ \QGRANT CREATE ON DATABASE dump_test TO regress_dump_test_role;\E
/xm,
like => {
pg_dumpall_dbprivs => 1, },
'GRANT SELECT ON TABLE test_table' => {
create_order => 5,
create_sql => 'GRANT SELECT ON TABLE dump_test.test_table
- TO dump_test;',
- regexp => qr/^GRANT SELECT ON TABLE test_table TO dump_test;/m,
+ TO regress_dump_test_role;',
+ regexp => qr/^GRANT SELECT ON TABLE test_table TO regress_dump_test_role;/m,
like => {
binary_upgrade => 1,
clean => 1,
create_order => 19,
create_sql => 'GRANT SELECT ON
TABLE dump_test_second_schema.test_third_table
- TO dump_test;',
- regexp => qr/^GRANT SELECT ON TABLE test_third_table TO dump_test;/m,
+ TO regress_dump_test_role;',
+ regexp => qr/^GRANT SELECT ON TABLE test_third_table TO regress_dump_test_role;/m,
like => {
binary_upgrade => 1,
clean => 1,
create_order => 28,
create_sql => 'GRANT ALL ON SEQUENCE
dump_test_second_schema.test_third_table_col1_seq
- TO dump_test;',
+ TO regress_dump_test_role;',
regexp => qr/^
- \QGRANT ALL ON SEQUENCE test_third_table_col1_seq TO dump_test;\E
+ \QGRANT ALL ON SEQUENCE test_third_table_col1_seq TO regress_dump_test_role;\E
/xm,
like => {
binary_upgrade => 1,
create_order => 8,
create_sql =>
'GRANT INSERT (col1) ON TABLE dump_test.test_second_table
- TO dump_test;',
+ TO regress_dump_test_role;',
regexp => qr/^
- \QGRANT INSERT(col1) ON TABLE test_second_table TO dump_test;\E
+ \QGRANT INSERT(col1) ON TABLE test_second_table TO regress_dump_test_role;\E
/xm,
like => {
binary_upgrade => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
pg_dumpall_globals => 1, }, },
- 'GRANT EXECUTE ON FUNCTION pg_sleep() TO dump_test' => {
+ 'GRANT EXECUTE ON FUNCTION pg_sleep() TO regress_dump_test_role' => {
create_order => 16,
create_sql => 'GRANT EXECUTE ON FUNCTION pg_sleep(float8)
- TO dump_test;',
+ TO regress_dump_test_role;',
regexp => qr/^
- \QGRANT ALL ON FUNCTION pg_sleep(double precision) TO dump_test;\E
+ \QGRANT ALL ON FUNCTION pg_sleep(double precision) TO regress_dump_test_role;\E
/xm,
like => {
binary_upgrade => 1,
'pg_dump: [archiver (db)] connection to database "qqq" failed: FATAL: database "qqq" does not exist'
);
-command_exit_is([ 'pg_dump', '-p', "$port", '--role=dump_test' ],
+command_exit_is([ 'pg_dump', '-p', "$port", '--role=regress_dump_test_role' ],
1,
'pg_dump: [archiver (db)] query failed: ERROR: permission denied for');
$node->start;
$node->issues_sql_like(
- [ 'createuser', 'user1' ],
-qr/statement: CREATE ROLE user1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;/,
+ [ 'createuser', 'regress_user1' ],
+qr/statement: CREATE ROLE regress_user1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;/,
'SQL CREATE USER run');
$node->issues_sql_like(
- [ 'createuser', '-L', 'role1' ],
-qr/statement: CREATE ROLE role1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN;/,
+ [ 'createuser', '-L', 'regress_role1' ],
+qr/statement: CREATE ROLE regress_role1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN;/,
'create a non-login role');
$node->issues_sql_like(
- [ 'createuser', '-r', 'user2' ],
-qr/statement: CREATE ROLE user2 NOSUPERUSER NOCREATEDB CREATEROLE INHERIT LOGIN;/,
+ [ 'createuser', '-r', 'regress_user2' ],
+qr/statement: CREATE ROLE regress_user2 NOSUPERUSER NOCREATEDB CREATEROLE INHERIT LOGIN;/,
'create a CREATEROLE user');
$node->issues_sql_like(
- [ 'createuser', '-s', 'user3' ],
-qr/statement: CREATE ROLE user3 SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;/,
+ [ 'createuser', '-s', 'regress_user3' ],
+qr/statement: CREATE ROLE regress_user3 SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;/,
'create a superuser');
-$node->command_fails([ 'createuser', 'user1' ],
+$node->command_fails([ 'createuser', 'regress_user1' ],
'fails if role already exists');
$node->init;
$node->start;
-$node->safe_psql('postgres', 'CREATE ROLE foobar1');
+$node->safe_psql('postgres', 'CREATE ROLE regress_foobar1');
$node->issues_sql_like(
- [ 'dropuser', 'foobar1' ],
- qr/statement: DROP ROLE foobar1/,
+ [ 'dropuser', 'regress_foobar1' ],
+ qr/statement: DROP ROLE regress_foobar1/,
'SQL DROP ROLE run');
-$node->command_fails([ 'dropuser', 'nonexistent' ],
+$node->command_fails([ 'dropuser', 'regress_nonexistent' ],
'fails with nonexistent user');
endif
# Common options for tests. Also pick up anything passed in EXTRA_REGRESS_OPTS
-REGRESS_OPTS = --dbname=regress1,connectdb --create-role=connectuser,connectdb $(EXTRA_REGRESS_OPTS)
+REGRESS_OPTS = --dbname=ecpg1_regression,ecpg2_regression --create-role=regress_ecpg_user1,regress_ecpg_user2 $(EXTRA_REGRESS_OPTS)
check: all
$(with_temp_install) ./pg_regress $(REGRESS_OPTS) --temp-instance=./tmp_check $(TEMP_CONF) --bindir= $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule
ECPGdebug(1, stderr);
- strcpy(dbname, "regress1");
+ strcpy(dbname, "ecpg1_regression");
EXEC SQL connect to :dbname;
sql_check("main", "connect", 0);
ECPGdebug(1, stderr);
- exec sql connect to connectdb as main;
- exec sql alter user connectuser ENCRYPTED PASSWORD 'connectpw';
+ exec sql connect to ecpg2_regression as main;
+ exec sql alter user regress_ecpg_user1 ENCRYPTED PASSWORD 'connectpw';
exec sql disconnect; /* <-- "main" not specified */
- exec sql connect to connectdb@localhost as main;
+ exec sql connect to ecpg2_regression@localhost as main;
exec sql disconnect main;
- exec sql connect to @localhost as main user connectdb;
+ exec sql connect to @localhost as main user regress_ecpg_user2;
exec sql disconnect main;
- /* exec sql connect to :@TEMP_PORT@ as main user connectdb;
+ /* exec sql connect to :@TEMP_PORT@ as main user regress_ecpg_user2;
exec sql disconnect main; */
- exec sql connect to tcp:postgresql://localhost/connectdb user connectuser identified by connectpw;
+ exec sql connect to tcp:postgresql://localhost/ecpg2_regression user regress_ecpg_user1 identified by connectpw;
exec sql disconnect;
- exec sql connect to tcp:postgresql://localhost/ user connectdb;
+ exec sql connect to tcp:postgresql://localhost/ user regress_ecpg_user2;
exec sql disconnect;
strcpy(pw, "connectpw");
- strcpy(db, "tcp:postgresql://localhost/connectdb");
- exec sql connect to :db user connectuser using :pw;
+ strcpy(db, "tcp:postgresql://localhost/ecpg2_regression");
+ exec sql connect to :db user regress_ecpg_user1 using :pw;
exec sql disconnect;
- exec sql connect to unix:postgresql://localhost/connectdb user connectuser using "connectpw";
+ exec sql connect to unix:postgresql://localhost/ecpg2_regression user regress_ecpg_user1 using "connectpw";
exec sql disconnect;
- exec sql connect to unix:postgresql://localhost/connectdb?connect_timeout=14 user connectuser;
+ exec sql connect to unix:postgresql://localhost/ecpg2_regression?connect_timeout=14 user regress_ecpg_user1;
exec sql disconnect;
/* wrong db */
- exec sql connect to tcp:postgresql://localhost/nonexistant user connectuser identified by connectpw;
+ exec sql connect to tcp:postgresql://localhost/nonexistant user regress_ecpg_user1 identified by connectpw;
exec sql disconnect;
/* wrong port */
- exec sql connect to tcp:postgresql://localhost:20/connectdb user connectuser identified by connectpw;
+ exec sql connect to tcp:postgresql://localhost:20/ecpg2_regression user regress_ecpg_user1 identified by connectpw;
/* no disconnect necessary */
/* wrong password */
- exec sql connect to unix:postgresql://localhost/connectdb user connectuser identified by "wrongpw";
+ exec sql connect to unix:postgresql://localhost/ecpg2_regression user regress_ecpg_user1 identified by "wrongpw";
/* no disconnect necessary */
return (0);
ECPGdebug(1, stderr);
strcpy(id, "first");
- exec sql connect to connectdb as :id;
+ exec sql connect to ecpg2_regression as :id;
exec sql connect to REGRESSDB1 as second;
/* this selects from "second" which was opened last */
ECPGdebug(1, stderr);
strcpy(id, "first");
- exec sql connect to connectdb as :id;
+ exec sql connect to ecpg2_regression as :id;
exec sql connect to REGRESSDB1 as second;
/* this selects from "second" which was opened last */
/* will close "second" */
exec sql disconnect DEFAULT;
- exec sql connect to "connectdb" as second;
+ exec sql connect to "ecpg2_regression" as second;
exec sql disconnect ALL;
exec sql disconnect CURRENT;
exec sql begin declare section;
char db[200];
char id[200];
- char *user="connectuser";
+ char *user="regress_ecpg_user1";
exec sql end declare section;
ECPGdebug(1, stderr);
- exec sql connect to connectdb as main;
- exec sql alter user connectdb ENCRYPTED PASSWORD 'insecure';
- exec sql alter user connectuser ENCRYPTED PASSWORD 'connectpw';
+ exec sql connect to ecpg2_regression as main;
+ exec sql alter user regress_ecpg_user2 ENCRYPTED PASSWORD 'insecure';
+ exec sql alter user regress_ecpg_user1 ENCRYPTED PASSWORD 'connectpw';
exec sql commit;
exec sql disconnect; /* <-- "main" not specified */
- strcpy(db, "connectdb");
+ strcpy(db, "ecpg2_regression");
strcpy(id, "main");
exec sql connect to :db as :id;
exec sql disconnect :id;
- exec sql connect to connectdb as main;
+ exec sql connect to ecpg2_regression as main;
exec sql disconnect main;
- exec sql connect to "connectdb" as main;
+ exec sql connect to "ecpg2_regression" as main;
exec sql disconnect main;
- exec sql connect to 'connectdb' as main;
+ exec sql connect to 'ecpg2_regression' as main;
exec sql disconnect main;
- exec sql connect to as main user connectdb/insecure;
+ exec sql connect to as main user regress_ecpg_user2/insecure;
exec sql disconnect main;
- exec sql connect to connectdb as main user connectuser/connectpw;
+ exec sql connect to ecpg2_regression as main user regress_ecpg_user1/connectpw;
exec sql disconnect main;
- exec sql connect to unix:postgresql://localhost/connectdb as main user connectuser/connectpw;
+ exec sql connect to unix:postgresql://localhost/ecpg2_regression as main user regress_ecpg_user1/connectpw;
exec sql disconnect main;
- exec sql connect to "unix:postgresql://localhost/connectdb" as main user connectuser/connectpw;
+ exec sql connect to "unix:postgresql://localhost/ecpg2_regression" as main user regress_ecpg_user1/connectpw;
exec sql disconnect main;
- exec sql connect to 'unix:postgresql://localhost/connectdb' as main user :user USING "connectpw";
+ exec sql connect to 'unix:postgresql://localhost/ecpg2_regression' as main user :user USING "connectpw";
exec sql disconnect main;
- exec sql connect to unix:postgresql://localhost/connectdb?connect_timeout=14&client_encoding=latin1 as main user connectuser/connectpw;
+ exec sql connect to unix:postgresql://localhost/ecpg2_regression?connect_timeout=14&client_encoding=latin1 as main user regress_ecpg_user1/connectpw;
exec sql disconnect main;
- exec sql connect to "unix:postgresql://200.46.204.71/connectdb" as main user connectuser/connectpw;
+ exec sql connect to "unix:postgresql://200.46.204.71/ecpg2_regression" as main user regress_ecpg_user1/connectpw;
exec sql disconnect main;
- exec sql connect to unix:postgresql://localhost/ as main user connectdb IDENTIFIED BY insecure;
+ exec sql connect to unix:postgresql://localhost/ as main user regress_ecpg_user2 IDENTIFIED BY insecure;
exec sql disconnect main;
/* connect twice */
- exec sql connect to connectdb as main;
- exec sql connect to connectdb as main;
+ exec sql connect to ecpg2_regression as main;
+ exec sql connect to ecpg2_regression as main;
exec sql disconnect main;
/* not connected */
ECPGdebug(1, stderr);
strcpy(msg, "connect");
- { ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 1, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 27 "describe.pgc"
if (sqlca.sqlcode < 0) exit (1);}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 30: query: set datestyle to iso; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: set datestyle to iso; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 30: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 33: query: create table descr_t1 ( id serial primary key , t text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 33: query: create table descr_t1 ( id serial primary key , t text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 33: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: insert into descr_t1 ( id , t ) values ( default , 'a' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: insert into descr_t1 ( id , t ) values ( default , 'a' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 36: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: insert into descr_t1 ( id , t ) values ( default , 'b' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: insert into descr_t1 ( id , t ) values ( default , 'b' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 37: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 38: query: insert into descr_t1 ( id , t ) values ( default , 'c' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 38: query: insert into descr_t1 ( id , t ) values ( default , 'c' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 38: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 38: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: insert into descr_t1 ( id , t ) values ( default , 'd' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 39: query: insert into descr_t1 ( id , t ) values ( default , 'd' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 42: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 42: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 55: name st_id1; query: "SELECT id, t FROM descr_t1"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: deallocate_one on line 185: name st_id2
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 190: query: drop table descr_t1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 190: query: drop table descr_t1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 190: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 190: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 193: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 193: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
#line 27 "rnull.pgc"
- { ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 1, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 29 "rnull.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 31: query: create table test ( id int , c char ( 10 ) , s smallint , i int , b bool , f float , l bigint , dbl double precision , dec decimal , dat date , tmp timestamptz ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 31: query: create table test ( id int , c char ( 10 ) , s smallint , i int , b bool , f float , l bigint , dbl double precision , dec decimal , dat date , tmp timestamptz ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 31: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 31: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 34: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 34: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: insert into test ( id , c , s , i , b , f , l , dbl ) values ( 1 , $1 , $2 , $3 , $4 , $5 , $6 , $7 ); with 7 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: insert into test ( id , c , s , i , b , f , l , dbl ) values ( 1 , $1 , $2 , $3 , $4 , $5 , $6 , $7 ); with 7 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 36: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 39: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 39: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 52: query: insert into test ( id , c , s , i , b , f , l , dbl , dec , dat , tmp ) values ( 2 , $1 , $2 , $3 , $4 , $5 , $6 , $7 , $8 , $9 , $10 ); with 10 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 52: query: insert into test ( id , c , s , i , b , f , l , dbl , dec , dat , tmp ) values ( 2 , $1 , $2 , $3 , $4 , $5 , $6 , $7 , $8 , $9 , $10 ); with 10 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 52: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 52: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 55: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 55: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 59: query: select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 59: query: select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 59: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 59: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 76: query: select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 76: query: select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 76: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 76: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 91: query: drop table test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 91: query: drop table test; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 91: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 91: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 92: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 92: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
strcpy(msg, "connect");
- { ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , "regress1", 0);
+ { ECPGconnect(__LINE__, 1, "ecpg1_regression" , NULL, NULL , "regress1", 0);
#line 68 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);}
* on a named connection
*/
- { ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , "con2", 0);
+ { ECPGconnect(__LINE__, 1, "ecpg1_regression" , NULL, NULL , "con2", 0);
#line 199 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 71: query: set datestyle to iso; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: deallocate_one on line 189: name st_id3
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 218: name st_id4; query: "SELECT * FROM t1 WHERE id = $1"
[NO_PID]: sqlca: code: 0, state: 00000
#line 19 "test_informix.pgc"
- { ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 1, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 21 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 24: query: create table test ( i int primary key , j int , c text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 24: query: create table test ( i int primary key , j int , c text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 24: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 28: query: insert into test ( i , j , c ) values ( 7 , $1 , 'test ' ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 28: query: insert into test ( i , j , c ) values ( 7 , $1 , 'test ' ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 28: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 28: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 29: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 29: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: insert into test ( i , j , c ) values ( 7 , 12 , 'a' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: insert into test ( i , j , c ) values ( 7 , 12 , 'a' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlstate 23505 (sqlcode -239): duplicate key value violates unique constraint "test_pkey" on line 32
[NO_PID]: sqlca: code: -239, state: 23505
-[NO_PID]: ECPGtrans on line 34: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 34: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: insert into test ( i , j , c ) values ( $1 , 1 , 'a ' ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: insert into test ( i , j , c ) values ( $1 , 1 , 'a ' ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 36: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 37: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 37: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 40: query: select i from test where j = ( select j from test ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 40: query: select i from test where j = ( select j from test ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 40: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlstate 21000 (sqlcode -284): more than one row returned by a subquery used as an expression on line 40
[NO_PID]: sqlca: code: -284, state: 21000
-[NO_PID]: ECPGtrans on line 41: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 41: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 44: query: select i from test where j = ( select j from test order by i limit 1 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 44: query: select i from test where j = ( select j from test order by i limit 1 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 44: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 44: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 95: query: declare c cursor for select * from test where i <= $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 95: query: declare c cursor for select * from test where i <= $1 ; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 95: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 95: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 57: query: fetch forward c; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 57: query: fetch forward c; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 57: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 57: RESULT: test offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 57: query: fetch forward c; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 57: query: fetch forward c; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 57: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 57: RESULT: a offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 57: query: fetch forward c; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 57: query: fetch forward c; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 57: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 57: no data found on line 57
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 75: query: delete from test where i = $1 :: decimal; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 75: query: delete from test where i = $1 :: decimal; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 75: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 75: no data found on line 75
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 78: query: select 1 from test where i = 14; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 78: query: select 1 from test where i = 14; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 78: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 78: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 81: query: select 1 from test where i = 147; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 81: query: select 1 from test where i = 147; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 81: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 81: no data found on line 81
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ECPGtrans on line 84: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 84: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 85: query: drop table test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 85: query: drop table test; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 85: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 85: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 86: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 86: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- strcpy(dbname, "regress1");
+ strcpy(dbname, "ecpg1_regression");
{ ECPGconnect(__LINE__, 1, dbname , NULL, NULL , NULL, 0);
#line 63 "test_informix2.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 66: query: set DateStyle to 'DMY'; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 66: query: set DateStyle to 'DMY'; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 66: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 66: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 68: query: create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 68: query: create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 68: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 68: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 71: query: insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 71: query: insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 71: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 71: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 76: query: select max ( timestamp ) from history; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 76: query: select max ( timestamp ) from history; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 76: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 76: RESULT: Wed 07 May 13:28:34 2003 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 81: query: select customerid , timestamp from history where timestamp = $1 limit 1; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 81: query: select customerid , timestamp from history where timestamp = $1 limit 1; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 81: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 81: RESULT: Wed 07 May 13:28:34 2003 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 95: query: insert into history ( customerid , timestamp , action_taken , narrative ) values ( $1 , $2 , 'test' , 'test' ); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 95: query: insert into history ( customerid , timestamp , action_taken , narrative ) values ( $1 , $2 , 'test' , 'test' ); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 95: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 95: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 100: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 100: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 102: query: drop table history; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 102: query: drop table history; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 102: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 102: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 105: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 105: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: query: alter user connectuser encrypted password 'connectpw'; with 0 parameter(s) on connection main
+[NO_PID]: ecpg_execute on line 23: query: alter user regress_ecpg_user1 encrypted password 'connectpw'; with 0 parameter(s) on connection main
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 23: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: OK: ALTER ROLE
+[NO_PID]: ecpg_process_output on line 23: OK: ALTER ROLE
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT> for user connectdb
+[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT> for user regress_ecpg_user2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGconnect: could not open database: FATAL: database "regress_ecpg_user2" does not exist
+
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port <DEFAULT> for user connectuser
+[NO_PID]: raising sqlcode -402 on line 29: could not connect to database "<DEFAULT>" on line 29
+[NO_PID]: sqlca: code: -402, state: 08001
+[NO_PID]: raising sqlcode -220 on line 30: connection "main" does not exist on line 30
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <DEFAULT> for user regress_ecpg_user1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT> for user regress_ecpg_user2
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT> for user connectdb
+[NO_PID]: ECPGconnect: could not open database: FATAL: database "regress_ecpg_user2" does not exist
+
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection (null) closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port <DEFAULT> for user connectuser
+[NO_PID]: raising sqlcode -402 on line 38: could not connect to database "<DEFAULT>" on line 38
+[NO_PID]: sqlca: code: -402, state: 08001
+[NO_PID]: raising sqlcode -220 on line 39: connection "CURRENT" does not exist on line 39
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> with options connect_timeout=14 for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> with options connect_timeout=14 for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database nonexistant on localhost port <DEFAULT> for user connectuser
+[NO_PID]: ECPGconnect: opening database nonexistant on localhost port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: could not open database: FATAL: database "nonexistant" does not exist
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -402 on line 53: could not connect to database "nonexistant" on line 53
[NO_PID]: sqlca: code: -402, state: 08001
-[NO_PID]: raising sqlcode -220 on line 54: no such connection CURRENT on line 54
+[NO_PID]: raising sqlcode -220 on line 54: connection "CURRENT" does not exist on line 54
[NO_PID]: sqlca: code: -220, state: 08003
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT> for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <REGRESSION_PORT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: could not open database: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" and accepting
TCP/IP connections on port 20?
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: raising sqlcode -402 on line 57: could not connect to database "connectdb" on line 57
+[NO_PID]: raising sqlcode -402 on line 57: could not connect to database "ecpg2_regression" on line 57
[NO_PID]: sqlca: code: -402, state: 08001
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); }
#line 22 "test1.pgc"
- { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user connectuser encrypted password 'connectpw'", ECPGt_EOIT, ECPGt_EORT);}
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user regress_ecpg_user1 encrypted password 'connectpw'", ECPGt_EOIT, ECPGt_EORT);}
#line 23 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 24 "test1.pgc"
/* <-- "main" not specified */
- { ECPGconnect(__LINE__, 0, "connectdb@localhost" , NULL, NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression@localhost" , NULL, NULL , "main", 0); }
#line 26 "test1.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 27 "test1.pgc"
- { ECPGconnect(__LINE__, 0, "@localhost" , "connectdb" , NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "@localhost" , "regress_ecpg_user2" , NULL , "main", 0); }
#line 29 "test1.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 30 "test1.pgc"
- /* exec sql connect to :@TEMP_PORT@ as main user connectdb;
+ /* exec sql connect to :@TEMP_PORT@ as main user regress_ecpg_user2;
exec sql disconnect main; */
- { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , NULL, 0); }
#line 35 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 36 "test1.pgc"
- { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost/" , "connectdb" , NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost/" , "regress_ecpg_user2" , NULL , NULL, 0); }
#line 38 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
strcpy(pw, "connectpw");
- strcpy(db, "tcp:postgresql://localhost/connectdb");
- { ECPGconnect(__LINE__, 0, db , "connectuser" , pw , NULL, 0); }
+ strcpy(db, "tcp:postgresql://localhost/ecpg2_regression");
+ { ECPGconnect(__LINE__, 0, db , "regress_ecpg_user1" , pw , NULL, 0); }
#line 43 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 44 "test1.pgc"
- { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , NULL, 0); }
#line 46 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 47 "test1.pgc"
- { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb?connect_timeout=14" , "connectuser" , NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression?connect_timeout=14" , "regress_ecpg_user1" , NULL , NULL, 0); }
#line 49 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
/* wrong db */
- { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost/nonexistant" , "connectuser" , "connectpw" , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost/nonexistant" , "regress_ecpg_user1" , "connectpw" , NULL, 0); }
#line 53 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
/* wrong port */
- { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:20/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:20/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , NULL, 0); }
#line 57 "test1.pgc"
/* no disconnect necessary */
/* wrong password */
- { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , "wrongpw" , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression" , "regress_ecpg_user1" , "wrongpw" , NULL, 0); }
#line 61 "test1.pgc"
/* no disconnect necessary */
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: query: alter user connectuser encrypted password 'connectpw'; with 0 parameter(s) on connection main
+[NO_PID]: ecpg_execute on line 23: query: alter user regress_ecpg_user1 encrypted password 'connectpw'; with 0 parameter(s) on connection main
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 23: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT> for user connectdb
+[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT> for user regress_ecpg_user2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGconnect: could not open database: FATAL: database "regress_ecpg_user2" does not exist
+
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port <DEFAULT> for user connectuser
+[NO_PID]: raising sqlcode -402 on line 29: could not connect to database "<DEFAULT>" on line 29
+[NO_PID]: sqlca: code: -402, state: 08001
+[NO_PID]: raising sqlcode -220 on line 30: connection "main" does not exist on line 30
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <DEFAULT> for user regress_ecpg_user1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT> for user regress_ecpg_user2
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT> for user connectdb
+[NO_PID]: ECPGconnect: could not open database: FATAL: database "regress_ecpg_user2" does not exist
+
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection (null) closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port <DEFAULT> for user connectuser
+[NO_PID]: raising sqlcode -402 on line 38: could not connect to database "<DEFAULT>" on line 38
+[NO_PID]: sqlca: code: -402, state: 08001
+[NO_PID]: raising sqlcode -220 on line 39: connection "CURRENT" does not exist on line 39
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> with options connect_timeout=14 for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> with options connect_timeout=14 for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database nonexistant on localhost port <DEFAULT> for user connectuser
+[NO_PID]: ECPGconnect: opening database nonexistant on localhost port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: could not open database: FATAL: database "nonexistant" does not exist
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: raising sqlcode -220 on line 54: connection "CURRENT" does not exist on line 54
[NO_PID]: sqlca: code: -220, state: 08003
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT> for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <REGRESSION_PORT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: could not open database: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 20?
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection connectdb closed
+[NO_PID]: ecpg_finish: connection ecpg2_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: raising sqlcode -402 on line 57: could not connect to database "connectdb" on line 57
+[NO_PID]: raising sqlcode -402 on line 57: could not connect to database "ecpg2_regression" on line 57
[NO_PID]: sqlca: code: -402, state: 08001
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
strcpy(id, "first");
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , id, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , id, 0); }
#line 24 "test2.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "second", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "second", 0); }
#line 25 "test2.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 28: query: select current_database ( ); with 0 parameter(s) on connection second
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 28: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 28: RESULT: regress1 offset: -1; array: no
+[NO_PID]: ecpg_get_data on line 28: RESULT: ecpg1_regression offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 29: query: select current_database ( ); with 0 parameter(s) on connection first
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 29: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 29: RESULT: connectdb offset: -1; array: no
+[NO_PID]: ecpg_get_data on line 29: RESULT: ecpg2_regression offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: query: select current_database ( ); with 0 parameter(s) on connection second
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 30: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 30: RESULT: regress1 offset: -1; array: no
+[NO_PID]: ecpg_get_data on line 30: RESULT: ecpg1_regression offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 33: query: select current_database ( ); with 0 parameter(s) on connection first
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 33: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 33: RESULT: connectdb offset: -1; array: no
+[NO_PID]: ecpg_get_data on line 33: RESULT: ecpg2_regression offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection first closed
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 37: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 37: RESULT: regress1 offset: -1; array: no
+[NO_PID]: ecpg_get_data on line 37: RESULT: ecpg1_regression offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -220 on line 40: connection "first" does not exist on line 40
[NO_PID]: sqlca: code: -220, state: 08003
ECPGdebug(1, stderr);
strcpy(id, "first");
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , id, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , id, 0); }
#line 23 "test3.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "second", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "second", 0); }
#line 24 "test3.pgc"
#line 31 "test3.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "second", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "second", 0); }
#line 33 "test3.pgc"
/* will close "second" */
#line 35 "test3.pgc"
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "second", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "second", 0); }
#line 37 "test3.pgc"
{ ECPGdisconnect(__LINE__, "ALL");}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 27: query: select current_database ( ); with 0 parameter(s) on connection second
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 27: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 27: RESULT: regress1 offset: -1; array: no
+[NO_PID]: ecpg_get_data on line 27: RESULT: ecpg1_regression offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection second closed
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 31: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 31: RESULT: connectdb offset: -1; array: no
+[NO_PID]: ecpg_get_data on line 31: RESULT: ecpg2_regression offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -220 on line 35: connection "DEFAULT" does not exist on line 35
[NO_PID]: sqlca: code: -220, state: 08003
{
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "main", 0); }
#line 13 "test4.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -220 on line 17: connection "DEFAULT" does not exist on line 17
[NO_PID]: sqlca: code: -220, state: 08003
char id [ 200 ] ;
#line 18 "test5.pgc"
- char * user = "connectuser" ;
+ char * user = "regress_ecpg_user1" ;
/* exec sql end declare section */
#line 19 "test5.pgc"
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); }
#line 23 "test5.pgc"
- { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user connectdb encrypted password 'insecure'", ECPGt_EOIT, ECPGt_EORT);}
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user regress_ecpg_user2 encrypted password 'insecure'", ECPGt_EOIT, ECPGt_EORT);}
#line 24 "test5.pgc"
- { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user connectuser encrypted password 'connectpw'", ECPGt_EOIT, ECPGt_EORT);}
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user regress_ecpg_user1 encrypted password 'connectpw'", ECPGt_EOIT, ECPGt_EORT);}
#line 25 "test5.pgc"
{ ECPGtrans(__LINE__, NULL, "commit");}
#line 27 "test5.pgc"
/* <-- "main" not specified */
- strcpy(db, "connectdb");
+ strcpy(db, "ecpg2_regression");
strcpy(id, "main");
{ ECPGconnect(__LINE__, 0, db , NULL, NULL , id, 0); }
#line 31 "test5.pgc"
#line 32 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); }
#line 34 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 35 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); }
#line 37 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 38 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); }
#line 40 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 41 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "" , "connectdb" , "insecure" , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "" , "regress_ecpg_user2" , "insecure" , "main", 0); }
#line 43 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 44 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "connectdb" , "connectuser" , "connectpw" , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , "main", 0); }
#line 46 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 47 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , "connectpw" , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , "main", 0); }
#line 49 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 50 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , "connectpw" , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , "main", 0); }
#line 52 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 53 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , user , "connectpw" , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression" , user , "connectpw" , "main", 0); }
#line 55 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 56 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb?connect_timeout=14 & client_encoding=latin1" , "connectuser" , "connectpw" , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression?connect_timeout=14 & client_encoding=latin1" , "regress_ecpg_user1" , "connectpw" , "main", 0); }
#line 58 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 59 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "unix:postgresql://200.46.204.71/connectdb" , "connectuser" , "connectpw" , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://200.46.204.71/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , "main", 0); }
#line 61 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 62 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/" , "connectdb" , "insecure" , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/" , "regress_ecpg_user2" , "insecure" , "main", 0); }
#line 64 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
/* connect twice */
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); }
#line 68 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); }
#line 69 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 24: query: alter user connectdb encrypted password 'insecure'; with 0 parameter(s) on connection main
+[NO_PID]: ecpg_execute on line 24: query: alter user regress_ecpg_user2 encrypted password 'insecure'; with 0 parameter(s) on connection main
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 24: OK: ALTER ROLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 25: query: alter user connectuser encrypted password 'connectpw'; with 0 parameter(s) on connection main
+[NO_PID]: ecpg_execute on line 25: query: alter user regress_ecpg_user1 encrypted password 'connectpw'; with 0 parameter(s) on connection main
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 25: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <DEFAULT> for user connectdb
+[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <DEFAULT> for user regress_ecpg_user2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGconnect: could not open database: FATAL: database "regress_ecpg_user2" does not exist
+
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
+[NO_PID]: raising sqlcode -402 on line 43: could not connect to database "<DEFAULT>" on line 43
+[NO_PID]: sqlca: code: -402, state: 08001
+[NO_PID]: raising sqlcode -220 on line 44: connection "main" does not exist on line 44
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> with options connect_timeout=14 & client_encoding=latin1 for user connectuser
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> with options connect_timeout=14 & client_encoding=latin1 for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: non-localhost access via sockets on line 61
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: raising sqlcode -402 on line 61: could not connect to database "connectdb" on line 61
+[NO_PID]: raising sqlcode -402 on line 61: could not connect to database "ecpg2_regression" on line 61
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: raising sqlcode -220 on line 62: connection "main" does not exist on line 62
[NO_PID]: sqlca: code: -220, state: 08003
-[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <DEFAULT> for user connectdb
+[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <DEFAULT> for user regress_ecpg_user2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGconnect: could not open database: FATAL: database "regress_ecpg_user2" does not exist
+
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: raising sqlcode -402 on line 64: could not connect to database "<DEFAULT>" on line 64
+[NO_PID]: sqlca: code: -402, state: 08001
+[NO_PID]: raising sqlcode -220 on line 65: connection "main" does not exist on line 65
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: connection identifier main is already in use
[NO_PID]: sqlca: code: 0, state: 00000
/* exec sql whenever sqlerror do sqlprint ( ) ; */
#line 27 "dt_test.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 28 "dt_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 29: query: create table date_test ( d date , ts timestamp ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 29: query: create table date_test ( d date , ts timestamp ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 29: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 29: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 30: query: set datestyle to iso; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: set datestyle to iso; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 30: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 31: query: set intervalstyle to postgres_verbose; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 31: query: set intervalstyle to postgres_verbose; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 31: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 31: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: insert into date_test ( d , ts ) values ( $1 , $2 ); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: insert into date_test ( d , ts ) values ( $1 , $2 ); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 36: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 38: query: select * from date_test where d = $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 38: query: select * from date_test where d = $1 ; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 38: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 38: RESULT: 2000-07-12 17:34:29 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 365: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 365: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
#line 26 "nan_test.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 28 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 30: query: create table nantest1 ( id int4 , d float8 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: create table nantest1 ( id int4 , d float8 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 30: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 31: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 31: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 31: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 31: OK: INSERT 0 3
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 34: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 34: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 34: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 34: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 37: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 45: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 45: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 45: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 45: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 46: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 46: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 46: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 46: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 37: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 45: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 45: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 45: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 45: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 46: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 46: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 46: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 46: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 37: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 45: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 45: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 45: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 45: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 46: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 46: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 46: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 46: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 37: no data found on line 37
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 48: query: close cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 48: query: close cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 48: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 50: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 50: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 50: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 50: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 53: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 53: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 53: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 53: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 53: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 53: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 53: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 53: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 53: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: fetch from cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 53: no data found on line 53
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 61: query: close cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 61: query: close cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 61: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 61: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 65: query: create table nantest2 ( id int4 , d numeric ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 65: query: create table nantest2 ( id int4 , d numeric ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 65: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 65: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 66: query: insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 66: query: insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 66: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 66: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 68: query: select id , d , d from nantest2 where id = 4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 68: query: select id , d , d from nantest2 where id = 4; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 68: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 68: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: query: insert into nantest2 ( id , d ) values ( 5 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 72: query: insert into nantest2 ( id , d ) values ( 5 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 72: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 72: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 73: query: insert into nantest2 ( id , d ) values ( 6 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 73: query: insert into nantest2 ( id , d ) values ( 6 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 73: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 73: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 76: query: declare cur1 cursor for select id , d , d from nantest2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 76: query: declare cur1 cursor for select id , d , d from nantest2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 76: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 76: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 79: query: fetch from cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 79: query: fetch from cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 79: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 79: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 79: query: fetch from cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 79: query: fetch from cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 79: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 79: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 79: query: fetch from cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 79: query: fetch from cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 79: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 79: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 79: query: fetch from cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 79: query: fetch from cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 79: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 79: no data found on line 79
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 84: query: close cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 84: query: close cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 84: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 84: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 88: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 88: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
#line 30 "num_test.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 32 "num_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGsetcommit on line 34: action "off"; connection "regress1"
+[NO_PID]: ECPGsetcommit on line 34: action "off"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 35: query: create table test ( text char ( 5 ) , num numeric ( 14 , 7 ) ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 35: query: create table test ( text char ( 5 ) , num numeric ( 14 , 7 ) ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 35: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 35: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 60: query: insert into test ( text , num ) values ( 'test' , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 60: query: insert into test ( text , num ) values ( 'test' , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 60: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 60: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 66: query: select num from test where text = 'test'; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 66: query: select num from test where text = 'test'; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 66: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 66: RESULT: 2369.7000000 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 93: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 93: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 50 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 52: query: create table customers ( c varchar ( 50 ) , p int ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 52: query: create table customers ( c varchar ( 50 ) , p int ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 52: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 52: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: insert into customers values ( 'John Doe' , '12345' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: insert into customers values ( 'John Doe' , '12345' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 53: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: query: insert into customers values ( 'Jane Doe' , '67890' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 54: query: insert into customers values ( 'Jane Doe' , '67890' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 54: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 54: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 56: query: select * from customers limit 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 56: query: select * from customers limit 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 56: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 56: RESULT: 67890 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 64: query: select * from customers limit 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 64: query: select * from customers limit 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 64: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 64: RESULT: 67890 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: query: select * from customers limit 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 72: query: select * from customers limit 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 72: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 72: RESULT: 67890 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 80: query: select * from customers limit 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 80: query: select * from customers limit 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 80: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 80: RESULT: 12345 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 85: query: select c from customers limit 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 85: query: select c from customers limit 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 85: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 85: RESULT: Jane Doe offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 16 "autoprep.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 21: query: create table T ( Item1 int , Item2 int ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 21: query: create table T ( Item1 int , Item2 int ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 21: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 23: name ecpg1; query: "insert into T values ( 1 , null )"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: query: insert into T values ( 1 , null ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 23: query: insert into T values ( 1 , null ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 23: using PQexecPrepared for "insert into T values ( 1 , null )"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 24: name ecpg2; query: "insert into T values ( 1 , $1 )"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 24: query: insert into T values ( 1 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 24: query: insert into T values ( 1 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: using PQexecPrepared for "insert into T values ( 1 , $1 )"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_auto_prepare on line 26: statement found in cache; entry 1640
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into T values ( 1 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into T values ( 1 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecPrepared for "insert into T values ( 1 , $1 )"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 27: name i; query: " insert into T values ( 1 , 2 ) "
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 28: query: insert into T values ( 1 , 2 ) ; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 28: query: insert into T values ( 1 , 2 ) ; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 28: using PQexecPrepared for " insert into T values ( 1 , 2 ) "
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 30: name ecpg3; query: "select Item2 from T order by Item2 nulls last"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 30: query: select Item2 from T order by Item2 nulls last; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: select Item2 from T order by Item2 nulls last; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexecPrepared for "select Item2 from T order by Item2 nulls last"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 30: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: declare C cursor for select Item1 from T; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: declare C cursor for select Item1 from T; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 37: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: fetch 1 in C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 39: query: fetch 1 in C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 39: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 42: query: close C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 42: query: close C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 42: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 44: name stmt1; query: "SELECT item2 FROM T ORDER BY item2 NULLS LAST"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 48: query: declare cur1 cursor for SELECT item2 FROM T ORDER BY item2 NULLS LAST; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 48: query: declare cur1 cursor for SELECT item2 FROM T ORDER BY item2 NULLS LAST; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 48: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 55: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 55: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 55: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 55: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 55: no data found on line 55
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 60: query: close cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 60: query: close cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 60: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 60: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 62: query: drop table T; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 62: query: drop table T; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 62: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: deallocate_one on line 0: name ecpg1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 21: query: create table T ( Item1 int , Item2 int ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 21: query: create table T ( Item1 int , Item2 int ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 21: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 23: name ecpg1; query: "insert into T values ( 1 , null )"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: query: insert into T values ( 1 , null ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 23: query: insert into T values ( 1 , null ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 23: using PQexecPrepared for "insert into T values ( 1 , null )"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 24: name ecpg2; query: "insert into T values ( 1 , $1 )"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 24: query: insert into T values ( 1 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 24: query: insert into T values ( 1 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: using PQexecPrepared for "insert into T values ( 1 , $1 )"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_auto_prepare on line 26: statement found in cache; entry 1640
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into T values ( 1 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into T values ( 1 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecPrepared for "insert into T values ( 1 , $1 )"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 27: name i; query: " insert into T values ( 1 , 2 ) "
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 28: query: insert into T values ( 1 , 2 ) ; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 28: query: insert into T values ( 1 , 2 ) ; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 28: using PQexecPrepared for " insert into T values ( 1 , 2 ) "
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 30: name ecpg3; query: "select Item2 from T order by Item2 nulls last"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 30: query: select Item2 from T order by Item2 nulls last; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: select Item2 from T order by Item2 nulls last; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexecPrepared for "select Item2 from T order by Item2 nulls last"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 30: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: declare C cursor for select Item1 from T; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: declare C cursor for select Item1 from T; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 37: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: fetch 1 in C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 39: query: fetch 1 in C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 39: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 42: query: close C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 42: query: close C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 42: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 44: name stmt1; query: "SELECT item2 FROM T ORDER BY item2 NULLS LAST"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 48: query: declare cur1 cursor for SELECT item2 FROM T ORDER BY item2 NULLS LAST; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 48: query: declare cur1 cursor for SELECT item2 FROM T ORDER BY item2 NULLS LAST; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 48: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 55: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 55: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 55: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 55: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 55: no data found on line 55
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 60: query: close cur1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 60: query: close cur1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 60: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 60: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 62: query: drop table T; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 62: query: drop table T; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 62: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: deallocate_one on line 0: name ecpg1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
{
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 17 "comment.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
strcpy(msg, "connect");
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "test1", 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "test1", 0);
#line 39 "cursor.pgc"
if (sqlca.sqlcode < 0) exit (1);}
#line 39 "cursor.pgc"
- { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "test2", 0);
+ { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "test2", 0);
#line 40 "cursor.pgc"
if (sqlca.sqlcode < 0) exit (1);}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 43: query: set datestyle to iso; with 0 parameter(s) on connection test1
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 34 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 36: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 37: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 37: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 39: query: insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 40: query: insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 40: query: insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 40: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 40: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 41: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 41: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 43: query: select * from test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 43: query: select * from test; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 43: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 43: RESULT: t offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 57: query: drop table test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 57: query: drop table test; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 57: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 57: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 58: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 58: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
strcpy(msg, "connect");
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 26 "describe.pgc"
if (sqlca.sqlcode < 0) exit (1);}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 29: query: set datestyle to iso; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 29: query: set datestyle to iso; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 29: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 29: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: create table t1 ( id serial primary key , t text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: create table t1 ( id serial primary key , t text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 35: query: insert into t1 ( id , t ) values ( default , 'a' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 35: query: insert into t1 ( id , t ) values ( default , 'a' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 35: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 35: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: insert into t1 ( id , t ) values ( default , 'b' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: insert into t1 ( id , t ) values ( default , 'b' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: insert into t1 ( id , t ) values ( default , 'c' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: insert into t1 ( id , t ) values ( default , 'c' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 38: query: insert into t1 ( id , t ) values ( default , 'd' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 38: query: insert into t1 ( id , t ) values ( default , 'd' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 38: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 38: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 41: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 41: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare on line 55: name st_id1; query: "SELECT id, t FROM t1"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGdeallocate on line 132: name st_id2
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 138: query: drop table t1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 138: query: drop table t1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 138: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 138: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 141: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 141: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
strcpy(msg, "connect");
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 75 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 78: query: set datestyle to iso; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 78: query: set datestyle to iso; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 78: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 78: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 81: query: create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 81: query: create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 81: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 81: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 84: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 84: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 84: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 84: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 85: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 85: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 85: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 85: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 86: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 86: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 86: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 86: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 89: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 89: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 40: query: declare mycur cursor for select * from a1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 40: query: declare mycur cursor for select * from a1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 40: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 40: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 49: RESULT: a offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 49: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 49: RESULT: b offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 49: no data found on line 49
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 58: query: close mycur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 58: query: close mycur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 58: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 58: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 118: query: drop table a1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 118: query: drop table a1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 118: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 118: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 121: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 121: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 54 "pointer_to_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 56: query: create table customers ( c varchar ( 50 ) , p int ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 56: query: create table customers ( c varchar ( 50 ) , p int ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 56: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 56: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 57: query: insert into customers values ( 'John Doe' , '12345' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 57: query: insert into customers values ( 'John Doe' , '12345' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 57: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 57: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 58: query: insert into customers values ( 'Jane Doe' , '67890' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 58: query: insert into customers values ( 'Jane Doe' , '67890' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 58: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 58: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 60: query: select * from customers limit 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 60: query: select * from customers limit 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 60: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 60: RESULT: 67890 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 68: query: select * from customers limit 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 68: query: select * from customers limit 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 68: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 68: RESULT: 67890 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 76: query: select * from customers limit 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 76: query: select * from customers limit 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 76: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 76: RESULT: 67890 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 84: query: select * from customers limit 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 84: query: select * from customers limit 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 84: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 84: RESULT: 12345 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 89: query: select c from customers limit 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 89: query: select c from customers limit 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 89: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 89: RESULT: Jane Doe offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
{
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 11 "strings.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 13: query: set standard_conforming_strings to on; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 13: query: set standard_conforming_strings to on; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 13: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 13: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 15: query: select 'abcdef' , N'abcdef' as foo , E'abc\bdef' as "foo" , U&'d\0061t\0061' as U&"foo" , U&'d!+000061t!+000061' uescape '!' , $foo$abc$def$foo$; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 15: query: select 'abcdef' , N'abcdef' as foo , E'abc\bdef' as "foo" , U&'d\0061t\0061' as U&"foo" , U&'d!+000061t!+000061' uescape '!' , $foo$abc$def$foo$; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 15: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 15: RESULT: abc$def offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug (1, stderr);
empl.idnum = 1;
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 43 "type.pgc"
if (sqlca.sqlcode)
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 50: query: create table empl ( idnum integer , name char ( 20 ) , accs smallint , string1 char ( 10 ) , string2 char ( 10 ) , string3 char ( 10 ) ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 50: query: create table empl ( idnum integer , name char ( 20 ) , accs smallint , string1 char ( 10 ) , string2 char ( 10 ) , string3 char ( 10 ) ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 50: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 50: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 58: query: insert into empl values ( 1 , 'user name' , 320 , 'first str' , 'second str' , 'third str' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 58: query: insert into empl values ( 1 , 'user name' , 320 , 'first str' , 'second str' , 'third str' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 58: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 58: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 65: query: select idnum , name , accs , string1 , string2 , string3 from empl where idnum = $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 65: query: select idnum , name , accs , string1 , string2 , string3 from empl where idnum = $1 ; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 65: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 65: RESULT: third str offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
strcpy(msg, "connect");
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 44 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 47: query: set datestyle to iso; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 47: query: set datestyle to iso; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 47: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 47: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 50: query: create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 50: query: create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 50: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 50: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 53: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: query: insert into family ( name , born , married , children ) values ( 'Dad' , '19610721' , '19870714' , 3 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 54: query: insert into family ( name , born , married , children ) values ( 'Dad' , '19610721' , '19870714' , 3 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 54: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 54: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: insert into family ( name , age ) values ( 'Child 1' , 16 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: insert into family ( name , age ) values ( 'Child 1' , 16 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 55: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 56: query: insert into family ( name , age ) values ( 'Child 2' , 14 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 56: query: insert into family ( name , age ) values ( 'Child 2' , 14 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 56: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 56: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 57: query: insert into family ( name , age ) values ( 'Child 3' , 9 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 57: query: insert into family ( name , age ) values ( 'Child 3' , 9 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 57: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 57: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 60: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 60: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 63: query: declare cur cursor for select name , born , age , married , children from family; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 63: query: declare cur cursor for select name , born , age , married , children from family; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 63: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 63: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 72: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 72: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 72: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 72: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 72: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 72: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 72: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 72: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 72: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 72: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 72: query: fetch cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 72: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 72: no data found on line 72
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 89: query: close cur; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 89: query: close cur; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 89: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 89: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 92: query: drop table family; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 92: query: drop table family; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 92: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 92: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 95: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 95: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 31 "whenever.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: create table test ( i int , c char ( 10 ) ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: create table test ( i int , c char ( 10 ) ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 32: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 33: query: insert into test values ( 1 , 'abcdefghij' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 33: query: insert into test values ( 1 , 'abcdefghij' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 33: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: select * from test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: select * from test; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 36: RESULT: abcdefghij offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
Warning: At least one column was truncated
-[NO_PID]: ECPGtrans on line 37: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 37: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: select * from nonexistant; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 39: query: select * from nonexistant; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlstate 42P01 (sqlcode -400): relation "nonexistant" does not exist on line 39
[NO_PID]: sqlca: code: -400, state: 42P01
SQL error: relation "nonexistant" does not exist on line 39
-[NO_PID]: ECPGtrans on line 40: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 40: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 43: query: select * from nonexistant; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 43: query: select * from nonexistant; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 43: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: -400, state: 42P01
Error in statement 'select':
SQL error: relation "nonexistant" does not exist on line 43
-[NO_PID]: ECPGtrans on line 44: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 44: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 47: query: select * from nonexistant; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 47: query: select * from nonexistant; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 47: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: -400, state: 42P01
Found another error
SQL error: relation "nonexistant" does not exist on line 47
-[NO_PID]: ECPGtrans on line 48: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 48: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 51: query: select * from nonexistant; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 51: query: select * from nonexistant; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 51: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlstate 42P01 (sqlcode -400): relation "nonexistant" does not exist on line 51
[NO_PID]: sqlca: code: -400, state: 42P01
-[NO_PID]: ECPGtrans on line 52: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 52: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: select * from nonexistant; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: select * from nonexistant; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlstate 42P01 (sqlcode -400): relation "nonexistant" does not exist on line 55
[NO_PID]: sqlca: code: -400, state: 42P01
-[NO_PID]: ECPGtrans on line 59: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 59: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 64: query: select 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 64: query: select 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 64: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 64: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 65: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 65: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
n[j] = *value;
}
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 53 "array.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGsetcommit on line 55: action "on"; connection "regress1"
+[NO_PID]: ECPGsetcommit on line 55: action "on"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 57: action "begin work"; connection "regress1"
+[NO_PID]: ECPGtrans on line 57: action "begin work"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 59: query: create table test ( f float , i int , a int [ 10 ] , text char ( 10 ) , ts timestamp [ 10 ] , n numeric [ 10 ] , d date [ 10 ] , inter interval [ 10 ] ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 59: query: create table test ( f float , i int , a int [ 10 ] , text char ( 10 ) , ts timestamp [ 10 ] , n numeric [ 10 ] , d date [ 10 ] , inter interval [ 10 ] ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 59: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 59: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 61: query: insert into test ( f , i , a , text , ts , n , d , inter ) values ( 404.90 , 3 , '{0,1,2,3,4,5,6,7,8,9}' , 'abcdefghij' , $1 , $2 , $3 , $4 ); with 4 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 61: query: insert into test ( f , i , a , text , ts , n , d , inter ) values ( 404.90 , 3 , '{0,1,2,3,4,5,6,7,8,9}' , 'abcdefghij' , $1 , $2 , $3 , $4 ); with 4 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 61: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 61: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 63: query: insert into test ( f , i , a , text , ts , n , d , inter ) values ( 140787.0 , 2 , $1 , $2 , $3 , $4 , $5 , $6 ); with 6 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 63: query: insert into test ( f , i , a , text , ts , n , d , inter ) values ( 140787.0 , 2 , $1 , $2 , $3 , $4 , $5 , $6 ); with 6 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 63: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 63: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 65: query: insert into test ( f , i , a , text , ts , n , d , inter ) values ( 14.07 , $1 , $2 , $3 , $4 , $5 , $6 , $7 ); with 7 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 65: query: insert into test ( f , i , a , text , ts , n , d , inter ) values ( 14.07 , $1 , $2 , $3 , $4 , $5 , $6 , $7 ); with 7 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 65: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 65: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 67: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 67: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 75: action "begin work"; connection "regress1"
+[NO_PID]: ECPGtrans on line 75: action "begin work"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 77: query: select f , text from test where i = 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 77: query: select f , text from test where i = 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 77: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 77: RESULT: 0123456789 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 85: query: select a , text , ts , n , d , inter from test where f = $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 85: query: select a , text , ts , n , d , inter from test where f = $1 ; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 85: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 85: RESULT: {"@ 10 hours","@ 11 hours","@ 12 hours","@ 13 hours","@ 14 hours","@ 15 hours","@ 16 hours","@ 17 hours","@ 18 hours","@ 19 hours"} offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 95: query: select a from test where f = $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 95: query: select a from test where f = $1 ; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 95: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 95: RESULT: {9,8,7,6,5,4,3,2,1,0} offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 102: query: drop table test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 102: query: drop table test; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 102: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 102: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 104: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 104: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug (1, stderr);
empl.idnum = 1;
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 29 "binary.pgc"
if (sqlca.sqlcode)
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: set bytea_output = escape; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: set bytea_output = escape; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 36: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 43: query: create table empl ( idnum integer , name char ( 20 ) , accs smallint , byte bytea ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 43: query: create table empl ( idnum integer , name char ( 20 ) , accs smallint , byte bytea ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 43: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 43: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 51: query: insert into empl values ( 1 , 'first user' , 320 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 51: query: insert into empl values ( 1 , 'first user' , 320 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 51: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 51: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 59: query: declare C cursor for select name , accs , byte from empl where idnum = $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 59: query: declare C cursor for select name , accs , byte from empl where idnum = $1 ; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 59: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 59: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 60: query: fetch C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 60: query: fetch C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 60: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 60: RESULT: \001m\000\212 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 69: query: close C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 69: query: close C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 69: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 69: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 73: query: declare B binary cursor for select name , accs , byte from empl where idnum = $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 73: query: declare B binary cursor for select name , accs , byte from empl where idnum = $1 ; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 73: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 73: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 74: query: fetch B; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 74: query: fetch B; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 74: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 74: RESULT: BINARY offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 81: query: close B; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 81: query: close B; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 81: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 81: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 90: query: declare A binary cursor for select byte from empl where idnum = $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 90: query: declare A binary cursor for select byte from empl where idnum = $1 ; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 90: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 90: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 91: query: fetch A; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 91: query: fetch A; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 91: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 91: RESULT: BINARY offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 98: query: close A; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 98: query: close A; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 98: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 98: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1,stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 15 "code100.pgc"
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 18: query: create table test ( "index" numeric ( 3 ) primary key , "payload" int4 not null ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 18: query: create table test ( "index" numeric ( 3 ) primary key , "payload" int4 not null ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 18: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 18: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 22: action "commit work"; connection "regress1"
+[NO_PID]: ECPGtrans on line 22: action "commit work"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test ( payload , index ) values ( 0 , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 31: action "commit work"; connection "regress1"
+[NO_PID]: ECPGtrans on line 31: action "commit work"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 34: query: update test set payload = payload + 1 where index = - 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 34: query: update test set payload = payload + 1 where index = - 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 34: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 34: no data found on line 34
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 38: query: delete from test where index = - 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 38: query: delete from test where index = - 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 38: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 38: no data found on line 38
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 41: query: insert into test ( select * from test where index = - 1 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 41: query: insert into test ( select * from test where index = - 1 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 41: no data found on line 41
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 44: query: drop table test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 44: query: drop table test; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 44: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 44: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 46: action "commit work"; connection "regress1"
+[NO_PID]: ECPGtrans on line 46: action "commit work"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
{
ECPGdebug (1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 13 "copystdout.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 14: query: create table foo ( a int , b varchar ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 14: query: create table foo ( a int , b varchar ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 14: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 14: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 15: query: insert into foo values ( 5 , 'abc' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 15: query: insert into foo values ( 5 , 'abc' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 15: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 15: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 16: query: insert into foo values ( 6 , 'def' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 16: query: insert into foo values ( 6 , 'def' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 16: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 16: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 17: query: insert into foo values ( 7 , 'ghi' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 17: query: insert into foo values ( 7 , 'ghi' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 17: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 17: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 19: query: copy foo to stdout with delimiter ','; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 19: query: copy foo to stdout with delimiter ','; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 19: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 19: got PGRES_COMMAND_OK after PGRES_COPY_OUT
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
/* exec sql whenever sqlerror do sqlprint ( ) ; */
#line 16 "define.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 17 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 19: query: create table test ( a int , b text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 19: query: create table test ( a int , b text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 19: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 19: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 20: query: insert into test values ( 29 , 'abcdef' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 20: query: insert into test values ( 29 , 'abcdef' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 20: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 20: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: query: insert into test values ( null , 'defined' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 23: query: insert into test values ( null , 'defined' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 23: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 23: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 31: query: insert into test values ( null , 'someothervar not defined' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 31: query: insert into test values ( null , 'someothervar not defined' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 31: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 31: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: select 1 , 29 :: text || '-' || 'abcdef'; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: select 1 , 29 :: text || '-' || 'abcdef'; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 36: RESULT: 29-abcdef offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 42: query: insert into test values ( 29 , 'no string' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 42: query: insert into test values ( 29 , 'no string' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 42: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 42: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: set TIMEZONE to 'UTC'; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: set TIMEZONE to 'UTC'; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 53: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
#line 26 "desc.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 28 "desc.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 30: query: create table test1 ( a int , b text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: create table test1 ( a int , b text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 34: name foo3; query: "SELECT * from test1 where $1 = a"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexecPrepared for "INSERT INTO test1 VALUES ($1, $2)"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 36: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 41: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 41: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexecPrepared for "INSERT INTO test1 VALUES ($1, $2)"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 41: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 46: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 46: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 46: using PQexecPrepared for "INSERT INTO test1 VALUES ($1, $2)"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: deallocate_one on line 48: name Foo-1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 53: query: SELECT * from test1 where a = $1 and b = $2; with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: SELECT * from test1 where a = $1 and b = $2; with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexecPrepared for "SELECT * from test1 where a = $1 and b = $2"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 55: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 59: query: declare c1 cursor for SELECT * from test1 where a = $1 and b = $2; with 2 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 59: query: declare c1 cursor for SELECT * from test1 where a = $1 and b = $2; with 2 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 59: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 59: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 61: query: fetch next from c1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 61: query: fetch next from c1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 61: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 61: RESULT: one offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 65: query: close c1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 65: query: close c1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 65: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 65: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 71: query: declare c2 cursor for SELECT * from test1 where $1 = a; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 71: query: declare c2 cursor for SELECT * from test1 where $1 = a; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 71: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 71: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 73: query: fetch next from c2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 73: query: fetch next from c2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 73: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 73: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 76: query: close c2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 76: query: close c2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 76: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 76: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 78: query: select * from test1 where a = 3; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 78: query: select * from test1 where a = 3; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 78: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 78: RESULT: this is a long test offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 81: query: drop table test1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 81: query: drop table test1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 81: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: deallocate_one on line 82: name foo1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
strcpy(msg, "connect");
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 27 "describe.pgc"
if (sqlca.sqlcode < 0) exit (1);}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 30: query: set datestyle to iso; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: set datestyle to iso; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 30: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 33: query: create table descr_t2 ( id serial primary key , t text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 33: query: create table descr_t2 ( id serial primary key , t text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 33: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: insert into descr_t2 ( id , t ) values ( default , 'a' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: insert into descr_t2 ( id , t ) values ( default , 'a' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 36: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: insert into descr_t2 ( id , t ) values ( default , 'b' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: insert into descr_t2 ( id , t ) values ( default , 'b' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 37: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 38: query: insert into descr_t2 ( id , t ) values ( default , 'c' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 38: query: insert into descr_t2 ( id , t ) values ( default , 'c' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 38: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 38: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: insert into descr_t2 ( id , t ) values ( default , 'd' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 39: query: insert into descr_t2 ( id , t ) values ( default , 'd' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 42: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 42: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 55: name st_id1; query: "SELECT id, t FROM descr_t2"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: deallocate_one on line 185: name st_id2
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 190: query: drop table descr_t2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 190: query: drop table descr_t2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 190: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 190: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 193: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 193: action "commit"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
/* exec sql whenever sqlerror do sqlprint ( ) ; */
#line 32 "dynalloc.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 33 "dynalloc.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 35: query: set datestyle to mdy; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 35: query: set datestyle to mdy; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 35: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 35: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 37: query: create table test ( a serial , b numeric ( 12 , 3 ) , c varchar , d varchar ( 3 ) , e char ( 4 ) , f timestamptz , g boolean , h box , i inet ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: create table test ( a serial , b numeric ( 12 , 3 ) , c varchar , d varchar ( 3 ) , e char ( 4 ) , f timestamptz , g boolean , h box , i inet ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 37: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 38: query: insert into test ( b , c , d , e , f , g , h , i ) values ( 23.456 , 'varchar' , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , true , '(1,2,3,4)' , '2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 38: query: insert into test ( b , c , d , e , f , g , h , i ) values ( 23.456 , 'varchar' , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , true , '(1,2,3,4)' , '2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 38: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 38: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: insert into test ( b , c , d , e , f , g , h , i ) values ( 2.446456 , null , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , false , null , null ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 39: query: insert into test ( b , c , d , e , f , g , h , i ) values ( 2.446456 , null , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , false , null , null ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 42: query: select a , b , c , d , e , f , g , h , i from test order by a; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 42: query: select a , b , c , d , e , f , g , h , i from test order by a; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 42: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 52: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
/* exec sql whenever sqlerror do sqlprint ( ) ; */
#line 19 "dynalloc2.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 20 "dynalloc2.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 22: query: set datestyle to postgres; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 22: query: set datestyle to postgres; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 22: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 22: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 24: query: create table test ( a int , b text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 24: query: create table test ( a int , b text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 24: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 25: query: insert into test values ( 1 , 'one' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 25: query: insert into test values ( 1 , 'one' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 25: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 25: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: insert into test values ( 2 , 'two' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: insert into test values ( 2 , 'two' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 27: query: insert into test values ( null , 'three' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 27: query: insert into test values ( null , 'three' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 27: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 27: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 28: query: insert into test values ( 4 , 'four' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 28: query: insert into test values ( 4 , 'four' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 28: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 28: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 29: query: insert into test values ( 5 , null ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 29: query: insert into test values ( 5 , null ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 29: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 29: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 30: query: insert into test values ( null , null ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: insert into test values ( null , null ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 30: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 33: query: select * from test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 33: query: select * from test; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 36: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 52: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 52: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
#line 45 "dyntest.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 47 "dyntest.pgc"
if (sqlca.sqlcode < 0) error ( );}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 49: query: set datestyle to german; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 49: query: set datestyle to german; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 49: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 51: query: create table dyntest ( name char ( 14 ) , d float8 , i int , bignumber int8 , b boolean , comment text , day date ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 51: query: create table dyntest ( name char ( 14 ) , d float8 , i int , bignumber int8 , b boolean , comment text , day date ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 51: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 51: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: query: insert into dyntest values ( 'first entry' , 14.7 , 14 , 123045607890 , true , 'The world''s most advanced open source database.' , '1987-07-14' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 54: query: insert into dyntest values ( 'first entry' , 14.7 , 14 , 123045607890 , true , 'The world''s most advanced open source database.' , '1987-07-14' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 54: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 54: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: insert into dyntest values ( 'second entry' , 1407.87 , 1407 , 987065403210 , false , 'The elephant never forgets.' , '1999-11-5' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: insert into dyntest values ( 'second entry' , 1407.87 , 1407 , 987065403210 , false , 'The elephant never forgets.' , '1999-11-5' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 57: name myquery; query: "select * from dyntest"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 60: query: declare MYCURS cursor for select * from dyntest; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 60: query: declare MYCURS cursor for select * from dyntest; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 60: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 60: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 64: query: fetch in MYCURS; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 64: query: fetch in MYCURS; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 64: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 176: RESULT: 14.07.1987 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 64: query: fetch in MYCURS; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 64: query: fetch in MYCURS; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 64: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 176: RESULT: 05.11.1999 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 64: query: fetch in MYCURS; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 64: query: fetch in MYCURS; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 64: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 64: no data found on line 64
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 194: query: close MYCURS; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 194: query: close MYCURS; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 194: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "main", 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "main", 0);
#line 24 "execute.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 25: query: create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ); with 0 parameter(s) on connection main
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 14 "fetch.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 19: query: create table My_Table ( Item1 int , Item2 text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 19: query: create table My_Table ( Item1 int , Item2 text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 19: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 19: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 21: query: insert into My_Table values ( 1 , 'text1' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 21: query: insert into My_Table values ( 1 , 'text1' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 21: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 21: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 22: query: insert into My_Table values ( 2 , 'text2' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 22: query: insert into My_Table values ( 2 , 'text2' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 22: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 22: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: query: insert into My_Table values ( 3 , 'text3' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 23: query: insert into My_Table values ( 3 , 'text3' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 23: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 23: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 24: query: insert into My_Table values ( 4 , 'text4' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 24: query: insert into My_Table values ( 4 , 'text4' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 24: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 28: query: declare C cursor for select * from My_Table; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 28: query: declare C cursor for select * from My_Table; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 28: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 28: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 32: RESULT: text1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 32: RESULT: text2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 32: RESULT: text3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 32: RESULT: text4 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: fetch 1 in C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 32: no data found on line 32
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 37: query: move backward 2 in C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 37: query: move backward 2 in C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 37: OK: MOVE 2
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: fetch 1 in C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 39: query: fetch 1 in C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 39: RESULT: text4 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 42: query: close C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 42: query: close C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 42: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 42: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 46: query: declare D cursor for select * from My_Table where Item1 = $1; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 46: query: declare D cursor for select * from My_Table where Item1 = $1; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 46: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 46: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 50: query: fetch 1 in D; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 50: query: fetch 1 in D; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 50: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 50: RESULT: text1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 50: query: fetch 1 in D; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 50: query: fetch 1 in D; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 50: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 50: no data found on line 50
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 53: query: close D; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 53: query: close D; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 53: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 55: query: drop table My_Table; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: drop table My_Table; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 55: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 11 "func.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGsetcommit on line 13: action "on"; connection "regress1"
+[NO_PID]: ECPGsetcommit on line 13: action "on"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 17: query: create table My_Table ( Item1 int , Item2 text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 17: query: create table My_Table ( Item1 int , Item2 text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 17: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 17: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 18: query: create table Log ( name text , w text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 18: query: create table Log ( name text , w text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 18: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 18: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 20: query: create function My_Table_Check ( ) returns trigger as $test$ BEGIN INSERT INTO Log VALUES(TG_NAME, TG_WHEN); RETURN NEW; END; $test$ language plpgsql; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 20: query: create function My_Table_Check ( ) returns trigger as $test$ BEGIN INSERT INTO Log VALUES(TG_NAME, TG_WHEN); RETURN NEW; END; $test$ language plpgsql; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 20: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 20: OK: CREATE FUNCTION
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 28: query: create trigger My_Table_Check_Trigger before insert on My_Table for each row execute procedure My_Table_Check ( ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 28: query: create trigger My_Table_Check_Trigger before insert on My_Table for each row execute procedure My_Table_Check ( ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 28: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 28: OK: CREATE TRIGGER
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 34: query: insert into My_Table values ( 1234 , 'Some random text' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 34: query: insert into My_Table values ( 1234 , 'Some random text' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 34: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 34: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 35: query: insert into My_Table values ( 5678 , 'The Quick Brown' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 35: query: insert into My_Table values ( 5678 , 'The Quick Brown' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 35: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 35: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: select name from Log limit 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: select name from Log limit 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 36: RESULT: my_table_check_trigger offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: drop trigger My_Table_Check_Trigger on My_Table; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 39: query: drop trigger My_Table_Check_Trigger on My_Table; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 39: OK: DROP TRIGGER
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 40: query: drop function My_Table_Check ( ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 40: query: drop function My_Table_Check ( ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 40: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 40: OK: DROP FUNCTION
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 41: query: drop table Log; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 41: query: drop table Log; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 41: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 42: query: drop table My_Table; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 42: query: drop table My_Table; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 42: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 42: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1,stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 15 "indicators.pgc"
{ ECPGsetcommit(__LINE__, "off", NULL);}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGsetcommit on line 16: action "off"; connection "regress1"
+[NO_PID]: ECPGsetcommit on line 16: action "off"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 18: query: create table indicator_test ( "id" int primary key , "str" text not null , val int null ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 18: query: create table indicator_test ( "id" int primary key , "str" text not null , val int null ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 18: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 18: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 22: action "commit work"; connection "regress1"
+[NO_PID]: ECPGtrans on line 22: action "commit work"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 24: query: insert into indicator_test ( id , str , val ) values ( 1 , 'Hello' , 0 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 24: query: insert into indicator_test ( id , str , val ) values ( 1 , 'Hello' , 0 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 24: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 27: query: insert into indicator_test ( id , str , val ) values ( 2 , 'Hi there' , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 27: query: insert into indicator_test ( id , str , val ) values ( 2 , 'Hi there' , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 27: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 27: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 29: query: insert into indicator_test ( id , str , val ) values ( 3 , 'Good evening' , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 29: query: insert into indicator_test ( id , str , val ) values ( 3 , 'Good evening' , $1 ); with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 29: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 29: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 30: action "commit work"; connection "regress1"
+[NO_PID]: ECPGtrans on line 30: action "commit work"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 33: query: select val from indicator_test where id = 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 33: query: select val from indicator_test where id = 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 33: RESULT: 0 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 34: query: select val from indicator_test where id = 2; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 34: query: select val from indicator_test where id = 2; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 34: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 34: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 36: query: select val from indicator_test where id = 3; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: select val from indicator_test where id = 3; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 36: RESULT: 5 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 41: query: update indicator_test set val = $1 where id = 1; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 41: query: update indicator_test set val = $1 where id = 1; with 1 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 41: OK: UPDATE 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 42: query: select val from indicator_test where id = 1; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 42: query: select val from indicator_test where id = 1; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 42: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 42: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 45: query: drop table indicator_test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 45: query: drop table indicator_test; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 45: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 45: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 46: action "commit work"; connection "regress1"
+[NO_PID]: ECPGtrans on line 46: action "commit work"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 13 "insupd.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 18: query: create table insupd_test ( a int , b int ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 18: query: create table insupd_test ( a int , b int ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 18: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 18: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 20: query: insert into insupd_test ( a , b ) values ( 1 , 1 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 20: query: insert into insupd_test ( a , b ) values ( 1 , 1 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 20: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 20: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 21: query: insert into insupd_test ( a , b ) values ( 2 , 2 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 21: query: insert into insupd_test ( a , b ) values ( 2 , 2 ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 21: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 21: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 22: query: insert into insupd_test ( a , b ) values ( 3 , 3 ) returning a; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 22: query: insert into insupd_test ( a , b ) values ( 3 , 3 ) returning a; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 22: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 22: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 24: query: update insupd_test set a = a + 1 returning a; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 24: query: update insupd_test set a = a + 1 returning a; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 24: RESULT: 4 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 25: query: update insupd_test set ( a , b ) = ( 5 , 5 ) where a = 4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 25: query: update insupd_test set ( a , b ) = ( 5 , 5 ) where a = 4; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 25: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 25: OK: UPDATE 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: update insupd_test set a = 4 where a = 3; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: update insupd_test set a = 4 where a = 3; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: UPDATE 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 28: query: select a , b from insupd_test order by a; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 28: query: select a , b from insupd_test order by a; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 28: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 28: RESULT: 5 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "main", 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "main", 0);
#line 24 "oldexec.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: query: create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ); with 0 parameter(s) on connection main
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 14 "parser.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGsetcommit on line 16: action "on"; connection "regress1"
+[NO_PID]: ECPGsetcommit on line 16: action "on"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 20: query: create table T ( Item1 int , Item2 int ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 20: query: create table T ( Item1 int , Item2 int ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 20: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 20: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 22: query: insert into t select 1 , nullif ( y - 1 , 0 ) from generate_series ( 1 , 3 ) with ordinality as series ( x , y ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 22: query: insert into t select 1 , nullif ( y - 1 , 0 ) from generate_series ( 1 , 3 ) with ordinality as series ( x , y ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 22: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 22: OK: INSERT 0 3
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: select Item2 from T order by Item2 nulls last; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: select Item2 from T order by Item2 nulls last; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 26: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 31: query: alter table T alter Item1 type bigint; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 31: query: alter table T alter Item1 type bigint; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 31: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 31: OK: ALTER TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: alter table T alter column Item2 set data type smallint; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: alter table T alter column Item2 set data type smallint; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 32: OK: ALTER TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 34: query: drop table T; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 34: query: drop table T; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 34: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 34: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 14 "quote.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGsetcommit on line 16: action "on"; connection "regress1"
+[NO_PID]: ECPGsetcommit on line 16: action "on"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 20: query: create table "My_Table" ( Item1 int , Item2 text ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 20: query: create table "My_Table" ( Item1 int , Item2 text ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 20: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 20: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 22: query: set standard_conforming_strings to off; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 22: query: set standard_conforming_strings to off; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 22: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 22: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 24: query: show standard_conforming_strings; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 24: query: show standard_conforming_strings; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 24: RESULT: off offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 28: query: insert into "My_Table" values ( 1 , 'a\\\\b' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 28: query: insert into "My_Table" values ( 1 , 'a\\\\b' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGnoticeReceiver: nonstandard use of \\ in a string literal
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 28: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 22P06
SQL error: nonstandard use of \\ in a string literal
-[NO_PID]: ecpg_execute on line 30: query: insert into "My_Table" values ( 1 , E'a\\\\b' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: insert into "My_Table" values ( 1 , E'a\\\\b' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 30: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 32: query: set standard_conforming_strings to on; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: set standard_conforming_strings to on; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 32: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 34: query: show standard_conforming_strings; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 34: query: show standard_conforming_strings; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 34: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 34: RESULT: on offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 38: query: insert into "My_Table" values ( 2 , 'a\\\\b' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 38: query: insert into "My_Table" values ( 2 , 'a\\\\b' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 38: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 38: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 40: query: insert into "My_Table" values ( 2 , E'a\\\\b' ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 40: query: insert into "My_Table" values ( 2 , E'a\\\\b' ); with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 40: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 40: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 42: action "begin"; connection "regress1"
+[NO_PID]: ECPGtrans on line 42: action "begin"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 45: query: declare C cursor for select * from "My_Table"; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 45: query: declare C cursor for select * from "My_Table"; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 45: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 45: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 51: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 51: RESULT: a\\b offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 51: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 51: RESULT: a\\b offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 51: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 51: RESULT: a\\\\b offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 51: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 51: RESULT: a\\b offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 51: query: fetch C; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 51: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 on line 51: no data found on line 51
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ECPGtrans on line 55: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 55: action "rollback"; connection "ecpg1_regression"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 56: query: drop table "My_Table"; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 56: query: drop table "My_Table"; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 56: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 56: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 13 "show.pgc"
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 18: query: set search_path to public; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 18: query: set search_path to public; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 18: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 18: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 19: query: show search_path; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 19: query: show search_path; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 19: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 19: RESULT: public offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 22: query: set search_path to 'public'; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 22: query: set search_path to 'public'; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 22: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 22: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: query: show search_path; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 23: query: show search_path; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 23: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 23: RESULT: public offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 26: query: set standard_conforming_strings to off; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 26: query: set standard_conforming_strings to off; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 26: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 27: query: show standard_conforming_strings; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 27: query: show standard_conforming_strings; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 27: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 27: RESULT: off offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 30: query: set time zone PST8PDT; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 30: query: set time zone PST8PDT; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 30: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 31: query: show time zone; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 31: query: show time zone; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 31: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 31: RESULT: PST8PDT offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 34: query: set transaction isolation level read committed; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 34: query: set transaction isolation level read committed; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 34: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_process_output on line 34: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 35: query: show transaction isolation level; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 35: query: show transaction isolation level; with 0 parameter(s) on connection ecpg1_regression
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 35: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 35: RESULT: read committed offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_finish: connection regress1 closed
+[NO_PID]: ecpg_finish: connection ecpg1_regression closed
[NO_PID]: sqlca: code: 0, state: 00000
ECPGdebug(1, stderr);
strcpy(msg, "connect");
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "regress1", 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "regress1", 0);
#line 70 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);}
* on a named connection
*/
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "con2", 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "con2", 0);
#line 199 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 73: query: set datestyle to iso; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: deallocate_one on line 190: name st_id3
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: prepare_common on line 219: name st_id4; query: "SELECT * FROM t1 WHERE id = $1"
[NO_PID]: sqlca: code: 0, state: 00000
value = (long)arg;
sprintf(name, "Connection: %d", value);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , name, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , name, 0);
#line 47 "alloc.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
value = (long)arg;
sprintf(name, "Connection: %d", value);
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , name, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , name, 0);
#line 47 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
pthread_t threads[THREADS];
#endif
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
#line 69 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
/* ECPGdebug(1, stderr); */
/* setup test_thread table */
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 46 "thread.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table test_thread", ECPGt_EOIT, ECPGt_EORT);}
free(threads);
/* and check results */
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 85 "thread.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select count ( * ) from test_thread", ECPGt_EOIT,
/* exec sql whenever sqlerror sqlprint ; */
#line 111 "thread.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , l_connection, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , l_connection, 0);
#line 112 "thread.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
/* ECPGdebug(1, stderr); */
/* setup test_thread table */
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 47 "thread_implicit.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table test_thread", ECPGt_EOIT, ECPGt_EORT);}
free(threads);
/* and check results */
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
#line 86 "thread_implicit.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select count ( * ) from test_thread", ECPGt_EOIT,
/* exec sql whenever sqlerror sqlprint ; */
#line 112 "thread_implicit.pgc"
- { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , l_connection, 0);
+ { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , l_connection, 0);
#line 113 "thread_implicit.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-exec sql define REGRESSDB1 regress1;
-exec sql define REGRESSDB2 connectdb;
+exec sql define REGRESSDB1 ecpg1_regression;
+exec sql define REGRESSDB2 ecpg2_regression;
-exec sql define REGRESSUSER1 regressuser1;
-exec sql define REGRESSUSER2 regressuser2;
+exec sql define REGRESSUSER1 regress_ecpg_user1;
+exec sql define REGRESSUSER2 regress_ecpg_user2;
}
/* set default regression database name */
- add_stringlist_item(&dblist, "isolationtest");
+ add_stringlist_item(&dblist, "isolation_regression");
}
int
CREATE EXTENSION dummy_seclabel;
-- initial setups
SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS dummy_seclabel_user1;
-DROP ROLE IF EXISTS dummy_seclabel_user2;
-DROP TABLE IF EXISTS dummy_seclabel_tbl1;
-DROP TABLE IF EXISTS dummy_seclabel_tbl2;
-DROP TABLE IF EXISTS dummy_seclabel_tbl3;
-CREATE USER dummy_seclabel_user1 WITH CREATEROLE;
-CREATE USER dummy_seclabel_user2;
+DROP ROLE IF EXISTS regress_dummy_seclabel_user1;
+DROP ROLE IF EXISTS regress_dummy_seclabel_user2;
+RESET client_min_messages;
+CREATE USER regress_dummy_seclabel_user1 WITH CREATEROLE;
+CREATE USER regress_dummy_seclabel_user2;
CREATE TABLE dummy_seclabel_tbl1 (a int, b text);
CREATE TABLE dummy_seclabel_tbl2 (x int, y text);
CREATE VIEW dummy_seclabel_view1 AS SELECT * FROM dummy_seclabel_tbl2;
CREATE FUNCTION dummy_seclabel_four() RETURNS integer AS $$SELECT 4$$ language sql;
CREATE DOMAIN dummy_seclabel_domain AS text;
-ALTER TABLE dummy_seclabel_tbl1 OWNER TO dummy_seclabel_user1;
-ALTER TABLE dummy_seclabel_tbl2 OWNER TO dummy_seclabel_user2;
-RESET client_min_messages;
+ALTER TABLE dummy_seclabel_tbl1 OWNER TO regress_dummy_seclabel_user1;
+ALTER TABLE dummy_seclabel_tbl2 OWNER TO regress_dummy_seclabel_user2;
--
-- Test of SECURITY LABEL statement with a plugin
--
-SET SESSION AUTHORIZATION dummy_seclabel_user1;
+SET SESSION AUTHORIZATION regress_dummy_seclabel_user1;
SECURITY LABEL ON TABLE dummy_seclabel_tbl1 IS 'classified'; -- OK
SECURITY LABEL ON COLUMN dummy_seclabel_tbl1.a IS 'unclassified'; -- OK
SECURITY LABEL ON COLUMN dummy_seclabel_tbl1 IS 'unclassified'; -- fail
ERROR: only superuser can set 'secret' label
SECURITY LABEL ON TABLE dummy_seclabel_tbl3 IS 'unclassified'; -- fail (not found)
ERROR: relation "dummy_seclabel_tbl3" does not exist
-SET SESSION AUTHORIZATION dummy_seclabel_user2;
+SET SESSION AUTHORIZATION regress_dummy_seclabel_user2;
SECURITY LABEL ON TABLE dummy_seclabel_tbl1 IS 'unclassified'; -- fail
ERROR: must be owner of relation dummy_seclabel_tbl1
SECURITY LABEL ON TABLE dummy_seclabel_tbl2 IS 'classified'; -- OK
--
-- Test for shared database object
--
-SET SESSION AUTHORIZATION dummy_seclabel_user1;
-SECURITY LABEL ON ROLE dummy_seclabel_user1 IS 'classified'; -- OK
-SECURITY LABEL ON ROLE dummy_seclabel_user1 IS '...invalid label...'; -- fail
+SET SESSION AUTHORIZATION regress_dummy_seclabel_user1;
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user1 IS 'classified'; -- OK
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user1 IS '...invalid label...'; -- fail
ERROR: '...invalid label...' is not a valid security label
-SECURITY LABEL FOR 'dummy' ON ROLE dummy_seclabel_user2 IS 'unclassified'; -- OK
-SECURITY LABEL FOR 'unknown_seclabel' ON ROLE dummy_seclabel_user1 IS 'unclassified'; -- fail
+SECURITY LABEL FOR 'dummy' ON ROLE regress_dummy_seclabel_user2 IS 'unclassified'; -- OK
+SECURITY LABEL FOR 'unknown_seclabel' ON ROLE regress_dummy_seclabel_user1 IS 'unclassified'; -- fail
ERROR: security label provider "unknown_seclabel" is not loaded
-SECURITY LABEL ON ROLE dummy_seclabel_user1 IS 'secret'; -- fail (not superuser)
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user1 IS 'secret'; -- fail (not superuser)
ERROR: only superuser can set 'secret' label
-SECURITY LABEL ON ROLE dummy_seclabel_user3 IS 'unclassified'; -- fail (not found)
-ERROR: role "dummy_seclabel_user3" does not exist
-SET SESSION AUTHORIZATION dummy_seclabel_user2;
-SECURITY LABEL ON ROLE dummy_seclabel_user2 IS 'unclassified'; -- fail (not privileged)
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user3 IS 'unclassified'; -- fail (not found)
+ERROR: role "regress_dummy_seclabel_user3" does not exist
+SET SESSION AUTHORIZATION regress_dummy_seclabel_user2;
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user2 IS 'unclassified'; -- fail (not privileged)
ERROR: must have CREATEROLE privilege
RESET SESSION AUTHORIZATION;
--
SECURITY LABEL ON SCHEMA dummy_seclabel_test IS 'unclassified'; -- OK
SELECT objtype, objname, provider, label FROM pg_seclabels
ORDER BY objtype, objname;
- objtype | objname | provider | label
-----------+-----------------------+----------+--------------
- column | dummy_seclabel_tbl1.a | dummy | unclassified
- domain | dummy_seclabel_domain | dummy | classified
- function | dummy_seclabel_four() | dummy | classified
- role | dummy_seclabel_user1 | dummy | classified
- role | dummy_seclabel_user2 | dummy | unclassified
- schema | dummy_seclabel_test | dummy | unclassified
- table | dummy_seclabel_tbl1 | dummy | top secret
- table | dummy_seclabel_tbl2 | dummy | classified
- view | dummy_seclabel_view1 | dummy | classified
+ objtype | objname | provider | label
+----------+------------------------------+----------+--------------
+ column | dummy_seclabel_tbl1.a | dummy | unclassified
+ domain | dummy_seclabel_domain | dummy | classified
+ function | dummy_seclabel_four() | dummy | classified
+ role | regress_dummy_seclabel_user1 | dummy | classified
+ role | regress_dummy_seclabel_user2 | dummy | unclassified
+ schema | dummy_seclabel_test | dummy | unclassified
+ table | dummy_seclabel_tbl1 | dummy | top secret
+ table | dummy_seclabel_tbl2 | dummy | classified
+ view | dummy_seclabel_view1 | dummy | classified
(9 rows)
-- check for event trigger
SECURITY LABEL ON TABLE dummy_seclabel_tbl1 IS 'classified';
NOTICE: event ddl_command_start: SECURITY LABEL
NOTICE: event ddl_command_end: SECURITY LABEL
+-- clean up
DROP EVENT TRIGGER always_start, always_end, always_drop, always_rewrite;
+DROP VIEW dummy_seclabel_view1;
+DROP TABLE dummy_seclabel_tbl1, dummy_seclabel_tbl2;
+DROP ROLE regress_dummy_seclabel_user1;
+DROP ROLE regress_dummy_seclabel_user2;
-- initial setups
SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS dummy_seclabel_user1;
-DROP ROLE IF EXISTS dummy_seclabel_user2;
+DROP ROLE IF EXISTS regress_dummy_seclabel_user1;
+DROP ROLE IF EXISTS regress_dummy_seclabel_user2;
-DROP TABLE IF EXISTS dummy_seclabel_tbl1;
-DROP TABLE IF EXISTS dummy_seclabel_tbl2;
-DROP TABLE IF EXISTS dummy_seclabel_tbl3;
+RESET client_min_messages;
-CREATE USER dummy_seclabel_user1 WITH CREATEROLE;
-CREATE USER dummy_seclabel_user2;
+CREATE USER regress_dummy_seclabel_user1 WITH CREATEROLE;
+CREATE USER regress_dummy_seclabel_user2;
CREATE TABLE dummy_seclabel_tbl1 (a int, b text);
CREATE TABLE dummy_seclabel_tbl2 (x int, y text);
CREATE FUNCTION dummy_seclabel_four() RETURNS integer AS $$SELECT 4$$ language sql;
CREATE DOMAIN dummy_seclabel_domain AS text;
-ALTER TABLE dummy_seclabel_tbl1 OWNER TO dummy_seclabel_user1;
-ALTER TABLE dummy_seclabel_tbl2 OWNER TO dummy_seclabel_user2;
-
-RESET client_min_messages;
+ALTER TABLE dummy_seclabel_tbl1 OWNER TO regress_dummy_seclabel_user1;
+ALTER TABLE dummy_seclabel_tbl2 OWNER TO regress_dummy_seclabel_user2;
--
-- Test of SECURITY LABEL statement with a plugin
--
-SET SESSION AUTHORIZATION dummy_seclabel_user1;
+SET SESSION AUTHORIZATION regress_dummy_seclabel_user1;
SECURITY LABEL ON TABLE dummy_seclabel_tbl1 IS 'classified'; -- OK
SECURITY LABEL ON COLUMN dummy_seclabel_tbl1.a IS 'unclassified'; -- OK
SECURITY LABEL ON TABLE dummy_seclabel_tbl1 IS 'secret'; -- fail (not superuser)
SECURITY LABEL ON TABLE dummy_seclabel_tbl3 IS 'unclassified'; -- fail (not found)
-SET SESSION AUTHORIZATION dummy_seclabel_user2;
+SET SESSION AUTHORIZATION regress_dummy_seclabel_user2;
SECURITY LABEL ON TABLE dummy_seclabel_tbl1 IS 'unclassified'; -- fail
SECURITY LABEL ON TABLE dummy_seclabel_tbl2 IS 'classified'; -- OK
--
-- Test for shared database object
--
-SET SESSION AUTHORIZATION dummy_seclabel_user1;
+SET SESSION AUTHORIZATION regress_dummy_seclabel_user1;
-SECURITY LABEL ON ROLE dummy_seclabel_user1 IS 'classified'; -- OK
-SECURITY LABEL ON ROLE dummy_seclabel_user1 IS '...invalid label...'; -- fail
-SECURITY LABEL FOR 'dummy' ON ROLE dummy_seclabel_user2 IS 'unclassified'; -- OK
-SECURITY LABEL FOR 'unknown_seclabel' ON ROLE dummy_seclabel_user1 IS 'unclassified'; -- fail
-SECURITY LABEL ON ROLE dummy_seclabel_user1 IS 'secret'; -- fail (not superuser)
-SECURITY LABEL ON ROLE dummy_seclabel_user3 IS 'unclassified'; -- fail (not found)
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user1 IS 'classified'; -- OK
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user1 IS '...invalid label...'; -- fail
+SECURITY LABEL FOR 'dummy' ON ROLE regress_dummy_seclabel_user2 IS 'unclassified'; -- OK
+SECURITY LABEL FOR 'unknown_seclabel' ON ROLE regress_dummy_seclabel_user1 IS 'unclassified'; -- fail
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user1 IS 'secret'; -- fail (not superuser)
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user3 IS 'unclassified'; -- fail (not found)
-SET SESSION AUTHORIZATION dummy_seclabel_user2;
-SECURITY LABEL ON ROLE dummy_seclabel_user2 IS 'unclassified'; -- fail (not privileged)
+SET SESSION AUTHORIZATION regress_dummy_seclabel_user2;
+SECURITY LABEL ON ROLE regress_dummy_seclabel_user2 IS 'unclassified'; -- fail (not privileged)
RESET SESSION AUTHORIZATION;
-- should trigger ddl_command_{start,end}
SECURITY LABEL ON TABLE dummy_seclabel_tbl1 IS 'classified';
+-- clean up
DROP EVENT TRIGGER always_start, always_end, always_drop, always_rewrite;
+
+DROP VIEW dummy_seclabel_view1;
+DROP TABLE dummy_seclabel_tbl1, dummy_seclabel_tbl2;
+
+DROP ROLE regress_dummy_seclabel_user1;
+DROP ROLE regress_dummy_seclabel_user2;
ALTER FUNCTION foo.plpgsql_function_trigger_1()
COST 10;
NOTICE: DDL test: type simple, tag ALTER FUNCTION
-CREATE ROLE tmprole;
+CREATE ROLE regress_alter_function_role;
ALTER FUNCTION plpgsql_function_trigger_2()
- OWNER TO tmprole;
+ OWNER TO regress_alter_function_role;
ERROR: function plpgsql_function_trigger_2() does not exist
-DROP OWNED BY tmprole;
-DROP ROLE tmprole;
+DROP OWNED BY regress_alter_function_role;
+DROP ROLE regress_alter_function_role;
ALTER FUNCTION foo.plpgsql_function_trigger_1()
COST 10;
-CREATE ROLE tmprole;
+CREATE ROLE regress_alter_function_role;
ALTER FUNCTION plpgsql_function_trigger_2()
- OWNER TO tmprole;
+ OWNER TO regress_alter_function_role;
-DROP OWNED BY tmprole;
-DROP ROLE tmprole;
+DROP OWNED BY regress_alter_function_role;
+DROP ROLE regress_alter_function_role;
binary_upgrade => 1,
pg_dumpall_globals => 1,
section_post_data => 1, }, },
- 'CREATE ROLE dump_test' => {
+ 'CREATE ROLE regress_dump_test_role' => {
create_order => 1,
- create_sql => 'CREATE ROLE dump_test;',
- regexp => qr/^CREATE ROLE dump_test;$/m,
+ create_sql => 'CREATE ROLE regress_dump_test_role;',
+ regexp => qr/^CREATE ROLE regress_dump_test_role;$/m,
like => { pg_dumpall_globals => 1, },
unlike => {
binary_upgrade => 1,
'GRANT SELECT ON TABLE regress_pg_dump_table' => {
regexp => qr/^
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(true);\E\n
- \QGRANT SELECT ON TABLE regress_pg_dump_table TO dump_test;\E\n
+ \QGRANT SELECT ON TABLE regress_pg_dump_table TO regress_dump_test_role;\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
$/xms,
like => { binary_upgrade => 1, },
no_privs => 1,
pg_dumpall_globals => 1,
section_post_data => 1, }, },
- 'GRANT SELECT(col2) ON regress_pg_dump_table TO dump_test' => {
+ 'GRANT SELECT(col2) ON regress_pg_dump_table TO regress_dump_test_role' => {
create_order => 4,
create_sql => 'GRANT SELECT(col2) ON regress_pg_dump_table
- TO dump_test;',
+ TO regress_dump_test_role;',
regexp => qr/^
- \QGRANT SELECT(col2) ON TABLE regress_pg_dump_table TO dump_test;\E
+ \QGRANT SELECT(col2) ON TABLE regress_pg_dump_table TO regress_dump_test_role;\E
$/xm,
like => {
binary_upgrade => 1,
col2 int
);
-GRANT SELECT ON regress_pg_dump_table TO dump_test;
+GRANT SELECT ON regress_pg_dump_table TO regress_dump_test_role;
GRANT SELECT(col1) ON regress_pg_dump_table TO public;
-GRANT SELECT(col2) ON regress_pg_dump_table TO dump_test;
-REVOKE SELECT(col2) ON regress_pg_dump_table FROM dump_test;
+GRANT SELECT(col2) ON regress_pg_dump_table TO regress_dump_test_role;
+REVOKE SELECT(col2) ON regress_pg_dump_table FROM regress_dump_test_role;
CREATE ACCESS METHOD regress_test_am TYPE INDEX HANDLER bthandler;
data integer
);
-- initial test data
-INSERT INTO rls_test_permissive VALUES ('r1','s1',4);
-INSERT INTO rls_test_permissive VALUES ('r2','s2',5);
-INSERT INTO rls_test_permissive VALUES ('r3','s3',6);
+INSERT INTO rls_test_permissive VALUES ('regress_r1','regress_s1',4);
+INSERT INTO rls_test_permissive VALUES ('regress_r2','regress_s2',5);
+INSERT INTO rls_test_permissive VALUES ('regress_r3','regress_s3',6);
CREATE TABLE rls_test_restrictive (
username name,
supervisor name,
-- create a simple 'allow all' policy.
CREATE POLICY p1 ON rls_test_restrictive USING (true);
-- initial test data
-INSERT INTO rls_test_restrictive VALUES ('r1','s1',1);
-INSERT INTO rls_test_restrictive VALUES ('r2','s2',2);
-INSERT INTO rls_test_restrictive VALUES ('r3','s3',3);
+INSERT INTO rls_test_restrictive VALUES ('regress_r1','regress_s1',1);
+INSERT INTO rls_test_restrictive VALUES ('regress_r2','regress_s2',2);
+INSERT INTO rls_test_restrictive VALUES ('regress_r3','regress_s3',3);
CREATE TABLE rls_test_both (
username name,
supervisor name,
data integer
);
-- initial test data
-INSERT INTO rls_test_both VALUES ('r1','s1',7);
-INSERT INTO rls_test_both VALUES ('r2','s2',8);
-INSERT INTO rls_test_both VALUES ('r3','s3',9);
+INSERT INTO rls_test_both VALUES ('regress_r1','regress_s1',7);
+INSERT INTO rls_test_both VALUES ('regress_r2','regress_s2',8);
+INSERT INTO rls_test_both VALUES ('regress_r3','regress_s3',9);
ALTER TABLE rls_test_permissive ENABLE ROW LEVEL SECURITY;
ALTER TABLE rls_test_restrictive ENABLE ROW LEVEL SECURITY;
ALTER TABLE rls_test_both ENABLE ROW LEVEL SECURITY;
-CREATE ROLE r1;
-CREATE ROLE s1;
-GRANT SELECT,INSERT ON rls_test_permissive TO r1;
-GRANT SELECT,INSERT ON rls_test_restrictive TO r1;
-GRANT SELECT,INSERT ON rls_test_both TO r1;
-GRANT SELECT,INSERT ON rls_test_permissive TO s1;
-GRANT SELECT,INSERT ON rls_test_restrictive TO s1;
-GRANT SELECT,INSERT ON rls_test_both TO s1;
-SET ROLE r1;
+CREATE ROLE regress_r1;
+CREATE ROLE regress_s1;
+GRANT SELECT,INSERT ON rls_test_permissive TO regress_r1;
+GRANT SELECT,INSERT ON rls_test_restrictive TO regress_r1;
+GRANT SELECT,INSERT ON rls_test_both TO regress_r1;
+GRANT SELECT,INSERT ON rls_test_permissive TO regress_s1;
+GRANT SELECT,INSERT ON rls_test_restrictive TO regress_s1;
+GRANT SELECT,INSERT ON rls_test_both TO regress_s1;
+SET ROLE regress_r1;
-- With only the hook's policies, permissive
-- hook's policy is current_user = username
EXPLAIN (costs off) SELECT * FROM rls_test_permissive;
(2 rows)
SELECT * FROM rls_test_permissive;
- username | supervisor | data
-----------+------------+------
- r1 | s1 | 4
+ username | supervisor | data
+------------+------------+------
+ regress_r1 | regress_s1 | 4
(1 row)
-- success
-INSERT INTO rls_test_permissive VALUES ('r1','s1',10);
+INSERT INTO rls_test_permissive VALUES ('regress_r1','regress_s1',10);
-- failure
-INSERT INTO rls_test_permissive VALUES ('r4','s4',10);
+INSERT INTO rls_test_permissive VALUES ('regress_r4','regress_s4',10);
ERROR: new row violates row-level security policy for table "rls_test_permissive"
-SET ROLE s1;
+SET ROLE regress_s1;
-- With only the hook's policies, restrictive
-- hook's policy is current_user = supervisor
EXPLAIN (costs off) SELECT * FROM rls_test_restrictive;
(2 rows)
SELECT * FROM rls_test_restrictive;
- username | supervisor | data
-----------+------------+------
- r1 | s1 | 1
+ username | supervisor | data
+------------+------------+------
+ regress_r1 | regress_s1 | 1
(1 row)
-- success
-INSERT INTO rls_test_restrictive VALUES ('r1','s1',10);
+INSERT INTO rls_test_restrictive VALUES ('regress_r1','regress_s1',10);
-- failure
-INSERT INTO rls_test_restrictive VALUES ('r4','s4',10);
+INSERT INTO rls_test_restrictive VALUES ('regress_r4','regress_s4',10);
ERROR: new row violates row-level security policy "extension policy" for table "rls_test_restrictive"
-SET ROLE s1;
+SET ROLE regress_s1;
-- With only the hook's policies, both
-- permissive hook's policy is current_user = username
-- restrictive hook's policy is current_user = superuser
(0 rows)
-- failure
-INSERT INTO rls_test_both VALUES ('r1','s1',10);
+INSERT INTO rls_test_both VALUES ('regress_r1','regress_s1',10);
ERROR: new row violates row-level security policy for table "rls_test_both"
-- failure
-INSERT INTO rls_test_both VALUES ('r4','s1',10);
+INSERT INTO rls_test_both VALUES ('regress_r4','regress_s1',10);
ERROR: new row violates row-level security policy for table "rls_test_both"
-- failure
-INSERT INTO rls_test_both VALUES ('r4','s4',10);
+INSERT INTO rls_test_both VALUES ('regress_r4','regress_s4',10);
ERROR: new row violates row-level security policy for table "rls_test_both"
RESET ROLE;
-- Create "internal" policies, to check that the policies from
DROP POLICY p1 ON rls_test_restrictive;
CREATE POLICY p1 ON rls_test_restrictive USING (data % 2 = 0);
CREATE POLICY p1 ON rls_test_both USING (data % 2 = 0);
-SET ROLE r1;
+SET ROLE regress_r1;
-- With both internal and hook policies, permissive
EXPLAIN (costs off) SELECT * FROM rls_test_permissive;
QUERY PLAN
(2 rows)
SELECT * FROM rls_test_permissive;
- username | supervisor | data
-----------+------------+------
- r1 | s1 | 4
- r3 | s3 | 6
- r1 | s1 | 10
+ username | supervisor | data
+------------+------------+------
+ regress_r1 | regress_s1 | 4
+ regress_r3 | regress_s3 | 6
+ regress_r1 | regress_s1 | 10
(3 rows)
-- success
-INSERT INTO rls_test_permissive VALUES ('r1','s1',7);
+INSERT INTO rls_test_permissive VALUES ('regress_r1','regress_s1',7);
-- success
-INSERT INTO rls_test_permissive VALUES ('r3','s3',10);
+INSERT INTO rls_test_permissive VALUES ('regress_r3','regress_s3',10);
-- failure
-INSERT INTO rls_test_permissive VALUES ('r4','s4',7);
+INSERT INTO rls_test_permissive VALUES ('regress_r4','regress_s4',7);
ERROR: new row violates row-level security policy for table "rls_test_permissive"
-SET ROLE s1;
+SET ROLE regress_s1;
-- With both internal and hook policies, restrictive
EXPLAIN (costs off) SELECT * FROM rls_test_restrictive;
QUERY PLAN
(4 rows)
SELECT * FROM rls_test_restrictive;
- username | supervisor | data
-----------+------------+------
- r1 | s1 | 10
+ username | supervisor | data
+------------+------------+------
+ regress_r1 | regress_s1 | 10
(1 row)
-- success
-INSERT INTO rls_test_restrictive VALUES ('r1','s1',8);
+INSERT INTO rls_test_restrictive VALUES ('regress_r1','regress_s1',8);
-- failure
-INSERT INTO rls_test_restrictive VALUES ('r3','s3',10);
+INSERT INTO rls_test_restrictive VALUES ('regress_r3','regress_s3',10);
ERROR: new row violates row-level security policy "extension policy" for table "rls_test_restrictive"
-- failure
-INSERT INTO rls_test_restrictive VALUES ('r1','s1',7);
+INSERT INTO rls_test_restrictive VALUES ('regress_r1','regress_s1',7);
ERROR: new row violates row-level security policy for table "rls_test_restrictive"
-- failure
-INSERT INTO rls_test_restrictive VALUES ('r4','s4',7);
+INSERT INTO rls_test_restrictive VALUES ('regress_r4','regress_s4',7);
ERROR: new row violates row-level security policy for table "rls_test_restrictive"
-- With both internal and hook policies, both permissive
-- and restrictive hook policies
(0 rows)
-- success
-INSERT INTO rls_test_both VALUES ('r1','s1',8);
+INSERT INTO rls_test_both VALUES ('regress_r1','regress_s1',8);
-- failure
-INSERT INTO rls_test_both VALUES ('r3','s3',10);
+INSERT INTO rls_test_both VALUES ('regress_r3','regress_s3',10);
ERROR: new row violates row-level security policy "extension policy" for table "rls_test_both"
-- failure
-INSERT INTO rls_test_both VALUES ('r1','s1',7);
+INSERT INTO rls_test_both VALUES ('regress_r1','regress_s1',7);
ERROR: new row violates row-level security policy for table "rls_test_both"
-- failure
-INSERT INTO rls_test_both VALUES ('r4','s4',7);
+INSERT INTO rls_test_both VALUES ('regress_r4','regress_s4',7);
ERROR: new row violates row-level security policy for table "rls_test_both"
RESET ROLE;
DROP TABLE rls_test_restrictive;
DROP TABLE rls_test_permissive;
DROP TABLE rls_test_both;
-DROP ROLE r1;
-DROP ROLE s1;
+DROP ROLE regress_r1;
+DROP ROLE regress_s1;
);
-- initial test data
-INSERT INTO rls_test_permissive VALUES ('r1','s1',4);
-INSERT INTO rls_test_permissive VALUES ('r2','s2',5);
-INSERT INTO rls_test_permissive VALUES ('r3','s3',6);
+INSERT INTO rls_test_permissive VALUES ('regress_r1','regress_s1',4);
+INSERT INTO rls_test_permissive VALUES ('regress_r2','regress_s2',5);
+INSERT INTO rls_test_permissive VALUES ('regress_r3','regress_s3',6);
CREATE TABLE rls_test_restrictive (
username name,
CREATE POLICY p1 ON rls_test_restrictive USING (true);
-- initial test data
-INSERT INTO rls_test_restrictive VALUES ('r1','s1',1);
-INSERT INTO rls_test_restrictive VALUES ('r2','s2',2);
-INSERT INTO rls_test_restrictive VALUES ('r3','s3',3);
+INSERT INTO rls_test_restrictive VALUES ('regress_r1','regress_s1',1);
+INSERT INTO rls_test_restrictive VALUES ('regress_r2','regress_s2',2);
+INSERT INTO rls_test_restrictive VALUES ('regress_r3','regress_s3',3);
CREATE TABLE rls_test_both (
username name,
);
-- initial test data
-INSERT INTO rls_test_both VALUES ('r1','s1',7);
-INSERT INTO rls_test_both VALUES ('r2','s2',8);
-INSERT INTO rls_test_both VALUES ('r3','s3',9);
+INSERT INTO rls_test_both VALUES ('regress_r1','regress_s1',7);
+INSERT INTO rls_test_both VALUES ('regress_r2','regress_s2',8);
+INSERT INTO rls_test_both VALUES ('regress_r3','regress_s3',9);
ALTER TABLE rls_test_permissive ENABLE ROW LEVEL SECURITY;
ALTER TABLE rls_test_restrictive ENABLE ROW LEVEL SECURITY;
ALTER TABLE rls_test_both ENABLE ROW LEVEL SECURITY;
-CREATE ROLE r1;
-CREATE ROLE s1;
+CREATE ROLE regress_r1;
+CREATE ROLE regress_s1;
-GRANT SELECT,INSERT ON rls_test_permissive TO r1;
-GRANT SELECT,INSERT ON rls_test_restrictive TO r1;
-GRANT SELECT,INSERT ON rls_test_both TO r1;
+GRANT SELECT,INSERT ON rls_test_permissive TO regress_r1;
+GRANT SELECT,INSERT ON rls_test_restrictive TO regress_r1;
+GRANT SELECT,INSERT ON rls_test_both TO regress_r1;
-GRANT SELECT,INSERT ON rls_test_permissive TO s1;
-GRANT SELECT,INSERT ON rls_test_restrictive TO s1;
-GRANT SELECT,INSERT ON rls_test_both TO s1;
+GRANT SELECT,INSERT ON rls_test_permissive TO regress_s1;
+GRANT SELECT,INSERT ON rls_test_restrictive TO regress_s1;
+GRANT SELECT,INSERT ON rls_test_both TO regress_s1;
-SET ROLE r1;
+SET ROLE regress_r1;
-- With only the hook's policies, permissive
-- hook's policy is current_user = username
SELECT * FROM rls_test_permissive;
-- success
-INSERT INTO rls_test_permissive VALUES ('r1','s1',10);
+INSERT INTO rls_test_permissive VALUES ('regress_r1','regress_s1',10);
-- failure
-INSERT INTO rls_test_permissive VALUES ('r4','s4',10);
+INSERT INTO rls_test_permissive VALUES ('regress_r4','regress_s4',10);
-SET ROLE s1;
+SET ROLE regress_s1;
-- With only the hook's policies, restrictive
-- hook's policy is current_user = supervisor
SELECT * FROM rls_test_restrictive;
-- success
-INSERT INTO rls_test_restrictive VALUES ('r1','s1',10);
+INSERT INTO rls_test_restrictive VALUES ('regress_r1','regress_s1',10);
-- failure
-INSERT INTO rls_test_restrictive VALUES ('r4','s4',10);
+INSERT INTO rls_test_restrictive VALUES ('regress_r4','regress_s4',10);
-SET ROLE s1;
+SET ROLE regress_s1;
-- With only the hook's policies, both
-- permissive hook's policy is current_user = username
SELECT * FROM rls_test_both;
-- failure
-INSERT INTO rls_test_both VALUES ('r1','s1',10);
+INSERT INTO rls_test_both VALUES ('regress_r1','regress_s1',10);
-- failure
-INSERT INTO rls_test_both VALUES ('r4','s1',10);
+INSERT INTO rls_test_both VALUES ('regress_r4','regress_s1',10);
-- failure
-INSERT INTO rls_test_both VALUES ('r4','s4',10);
+INSERT INTO rls_test_both VALUES ('regress_r4','regress_s4',10);
RESET ROLE;
CREATE POLICY p1 ON rls_test_both USING (data % 2 = 0);
-SET ROLE r1;
+SET ROLE regress_r1;
-- With both internal and hook policies, permissive
EXPLAIN (costs off) SELECT * FROM rls_test_permissive;
SELECT * FROM rls_test_permissive;
-- success
-INSERT INTO rls_test_permissive VALUES ('r1','s1',7);
+INSERT INTO rls_test_permissive VALUES ('regress_r1','regress_s1',7);
-- success
-INSERT INTO rls_test_permissive VALUES ('r3','s3',10);
+INSERT INTO rls_test_permissive VALUES ('regress_r3','regress_s3',10);
-- failure
-INSERT INTO rls_test_permissive VALUES ('r4','s4',7);
+INSERT INTO rls_test_permissive VALUES ('regress_r4','regress_s4',7);
-SET ROLE s1;
+SET ROLE regress_s1;
-- With both internal and hook policies, restrictive
EXPLAIN (costs off) SELECT * FROM rls_test_restrictive;
SELECT * FROM rls_test_restrictive;
-- success
-INSERT INTO rls_test_restrictive VALUES ('r1','s1',8);
+INSERT INTO rls_test_restrictive VALUES ('regress_r1','regress_s1',8);
-- failure
-INSERT INTO rls_test_restrictive VALUES ('r3','s3',10);
+INSERT INTO rls_test_restrictive VALUES ('regress_r3','regress_s3',10);
-- failure
-INSERT INTO rls_test_restrictive VALUES ('r1','s1',7);
+INSERT INTO rls_test_restrictive VALUES ('regress_r1','regress_s1',7);
-- failure
-INSERT INTO rls_test_restrictive VALUES ('r4','s4',7);
+INSERT INTO rls_test_restrictive VALUES ('regress_r4','regress_s4',7);
-- With both internal and hook policies, both permissive
-- and restrictive hook policies
SELECT * FROM rls_test_both;
-- success
-INSERT INTO rls_test_both VALUES ('r1','s1',8);
+INSERT INTO rls_test_both VALUES ('regress_r1','regress_s1',8);
-- failure
-INSERT INTO rls_test_both VALUES ('r3','s3',10);
+INSERT INTO rls_test_both VALUES ('regress_r3','regress_s3',10);
-- failure
-INSERT INTO rls_test_both VALUES ('r1','s1',7);
+INSERT INTO rls_test_both VALUES ('regress_r1','regress_s1',7);
-- failure
-INSERT INTO rls_test_both VALUES ('r4','s4',7);
+INSERT INTO rls_test_both VALUES ('regress_r4','regress_s4',7);
RESET ROLE;
DROP TABLE rls_test_permissive;
DROP TABLE rls_test_both;
-DROP ROLE r1;
-DROP ROLE s1;
+DROP ROLE regress_r1;
+DROP ROLE regress_s1;
--
-- Clean up in case a prior regression run failed
SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS regtest_alter_user1;
-DROP ROLE IF EXISTS regtest_alter_user2;
-DROP ROLE IF EXISTS regtest_alter_user3;
+DROP ROLE IF EXISTS regress_alter_user1;
+DROP ROLE IF EXISTS regress_alter_user2;
+DROP ROLE IF EXISTS regress_alter_user3;
RESET client_min_messages;
-CREATE USER regtest_alter_user3;
-CREATE USER regtest_alter_user2;
-CREATE USER regtest_alter_user1 IN ROLE regtest_alter_user3;
+CREATE USER regress_alter_user3;
+CREATE USER regress_alter_user2;
+CREATE USER regress_alter_user1 IN ROLE regress_alter_user3;
CREATE SCHEMA alt_nsp1;
CREATE SCHEMA alt_nsp2;
GRANT ALL ON SCHEMA alt_nsp1, alt_nsp2 TO public;
--
-- Function and Aggregate
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE FUNCTION alt_func1(int) RETURNS int LANGUAGE sql
AS 'SELECT $1 + 1';
CREATE FUNCTION alt_func2(int) RETURNS int LANGUAGE sql
);
ALTER AGGREGATE alt_func1(int) RENAME TO alt_func3; -- failed (not aggregate)
ERROR: function alt_func1(integer) is not an aggregate
-ALTER AGGREGATE alt_func1(int) OWNER TO regtest_alter_user3; -- failed (not aggregate)
+ALTER AGGREGATE alt_func1(int) OWNER TO regress_alter_user3; -- failed (not aggregate)
ERROR: function alt_func1(integer) is not an aggregate
ALTER AGGREGATE alt_func1(int) SET SCHEMA alt_nsp2; -- failed (not aggregate)
ERROR: function alt_func1(integer) is not an aggregate
ALTER FUNCTION alt_func1(int) RENAME TO alt_func2; -- failed (name conflict)
ERROR: function alt_func2(integer) already exists in schema "alt_nsp1"
ALTER FUNCTION alt_func1(int) RENAME TO alt_func3; -- OK
-ALTER FUNCTION alt_func2(int) OWNER TO regtest_alter_user2; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
-ALTER FUNCTION alt_func2(int) OWNER TO regtest_alter_user3; -- OK
+ALTER FUNCTION alt_func2(int) OWNER TO regress_alter_user2; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user2"
+ALTER FUNCTION alt_func2(int) OWNER TO regress_alter_user3; -- OK
ALTER FUNCTION alt_func2(int) SET SCHEMA alt_nsp1; -- OK, already there
ALTER FUNCTION alt_func2(int) SET SCHEMA alt_nsp2; -- OK
ALTER AGGREGATE alt_agg1(int) RENAME TO alt_agg2; -- failed (name conflict)
ERROR: function alt_agg2(integer) already exists in schema "alt_nsp1"
ALTER AGGREGATE alt_agg1(int) RENAME TO alt_agg3; -- OK
-ALTER AGGREGATE alt_agg2(int) OWNER TO regtest_alter_user2; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
-ALTER AGGREGATE alt_agg2(int) OWNER TO regtest_alter_user3; -- OK
+ALTER AGGREGATE alt_agg2(int) OWNER TO regress_alter_user2; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user2"
+ALTER AGGREGATE alt_agg2(int) OWNER TO regress_alter_user3; -- OK
ALTER AGGREGATE alt_agg2(int) SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE FUNCTION alt_func1(int) RETURNS int LANGUAGE sql
AS 'SELECT $1 + 2';
CREATE FUNCTION alt_func2(int) RETURNS int LANGUAGE sql
ALTER FUNCTION alt_func3(int) RENAME TO alt_func4; -- failed (not owner)
ERROR: must be owner of function alt_func3
ALTER FUNCTION alt_func1(int) RENAME TO alt_func4; -- OK
-ALTER FUNCTION alt_func3(int) OWNER TO regtest_alter_user2; -- failed (not owner)
+ALTER FUNCTION alt_func3(int) OWNER TO regress_alter_user2; -- failed (not owner)
ERROR: must be owner of function alt_func3
-ALTER FUNCTION alt_func2(int) OWNER TO regtest_alter_user3; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user3"
+ALTER FUNCTION alt_func2(int) OWNER TO regress_alter_user3; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user3"
ALTER FUNCTION alt_func3(int) SET SCHEMA alt_nsp2; -- failed (not owner)
ERROR: must be owner of function alt_func3
ALTER FUNCTION alt_func2(int) SET SCHEMA alt_nsp2; -- failed (name conflicts)
ALTER AGGREGATE alt_agg3(int) RENAME TO alt_agg4; -- failed (not owner)
ERROR: must be owner of function alt_agg3
ALTER AGGREGATE alt_agg1(int) RENAME TO alt_agg4; -- OK
-ALTER AGGREGATE alt_agg3(int) OWNER TO regtest_alter_user2; -- failed (not owner)
+ALTER AGGREGATE alt_agg3(int) OWNER TO regress_alter_user2; -- failed (not owner)
ERROR: must be owner of function alt_agg3
-ALTER AGGREGATE alt_agg2(int) OWNER TO regtest_alter_user3; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user3"
+ALTER AGGREGATE alt_agg2(int) OWNER TO regress_alter_user3; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user3"
ALTER AGGREGATE alt_agg3(int) SET SCHEMA alt_nsp2; -- failed (not owner)
ERROR: must be owner of function alt_agg3
ALTER AGGREGATE alt_agg2(int) SET SCHEMA alt_nsp2; -- failed (name conflict)
ORDER BY nspname, proname;
nspname | proname | prorettype | proisagg | rolname
----------+-----------+------------+----------+---------------------
- alt_nsp1 | alt_agg2 | integer | t | regtest_alter_user2
- alt_nsp1 | alt_agg3 | integer | t | regtest_alter_user1
- alt_nsp1 | alt_agg4 | integer | t | regtest_alter_user2
- alt_nsp1 | alt_func2 | integer | f | regtest_alter_user2
- alt_nsp1 | alt_func3 | integer | f | regtest_alter_user1
- alt_nsp1 | alt_func4 | integer | f | regtest_alter_user2
- alt_nsp2 | alt_agg2 | integer | t | regtest_alter_user3
- alt_nsp2 | alt_func2 | integer | f | regtest_alter_user3
+ alt_nsp1 | alt_agg2 | integer | t | regress_alter_user2
+ alt_nsp1 | alt_agg3 | integer | t | regress_alter_user1
+ alt_nsp1 | alt_agg4 | integer | t | regress_alter_user2
+ alt_nsp1 | alt_func2 | integer | f | regress_alter_user2
+ alt_nsp1 | alt_func3 | integer | f | regress_alter_user1
+ alt_nsp1 | alt_func4 | integer | f | regress_alter_user2
+ alt_nsp2 | alt_agg2 | integer | t | regress_alter_user3
+ alt_nsp2 | alt_func2 | integer | f | regress_alter_user3
(8 rows)
--
--
-- Conversion
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE CONVERSION alt_conv1 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
CREATE CONVERSION alt_conv2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
ALTER CONVERSION alt_conv1 RENAME TO alt_conv2; -- failed (name conflict)
ERROR: conversion "alt_conv2" already exists in schema "alt_nsp1"
ALTER CONVERSION alt_conv1 RENAME TO alt_conv3; -- OK
-ALTER CONVERSION alt_conv2 OWNER TO regtest_alter_user2; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
-ALTER CONVERSION alt_conv2 OWNER TO regtest_alter_user3; -- OK
+ALTER CONVERSION alt_conv2 OWNER TO regress_alter_user2; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user2"
+ALTER CONVERSION alt_conv2 OWNER TO regress_alter_user3; -- OK
ALTER CONVERSION alt_conv2 SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE CONVERSION alt_conv1 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
CREATE CONVERSION alt_conv2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
ALTER CONVERSION alt_conv3 RENAME TO alt_conv4; -- failed (not owner)
ERROR: must be owner of conversion alt_conv3
ALTER CONVERSION alt_conv1 RENAME TO alt_conv4; -- OK
-ALTER CONVERSION alt_conv3 OWNER TO regtest_alter_user2; -- failed (not owner)
+ALTER CONVERSION alt_conv3 OWNER TO regress_alter_user2; -- failed (not owner)
ERROR: must be owner of conversion alt_conv3
-ALTER CONVERSION alt_conv2 OWNER TO regtest_alter_user3; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user3"
+ALTER CONVERSION alt_conv2 OWNER TO regress_alter_user3; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user3"
ALTER CONVERSION alt_conv3 SET SCHEMA alt_nsp2; -- failed (not owner)
ERROR: must be owner of conversion alt_conv3
ALTER CONVERSION alt_conv2 SET SCHEMA alt_nsp2; -- failed (name conflict)
ORDER BY nspname, conname;
nspname | conname | rolname
----------+-----------+---------------------
- alt_nsp1 | alt_conv2 | regtest_alter_user2
- alt_nsp1 | alt_conv3 | regtest_alter_user1
- alt_nsp1 | alt_conv4 | regtest_alter_user2
- alt_nsp2 | alt_conv2 | regtest_alter_user3
+ alt_nsp1 | alt_conv2 | regress_alter_user2
+ alt_nsp1 | alt_conv3 | regress_alter_user1
+ alt_nsp1 | alt_conv4 | regress_alter_user2
+ alt_nsp2 | alt_conv2 | regress_alter_user3
(4 rows)
--
--
CREATE LANGUAGE alt_lang1 HANDLER plpgsql_call_handler;
CREATE LANGUAGE alt_lang2 HANDLER plpgsql_call_handler;
-ALTER LANGUAGE alt_lang1 OWNER TO regtest_alter_user1; -- OK
-ALTER LANGUAGE alt_lang2 OWNER TO regtest_alter_user2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user1;
+ALTER LANGUAGE alt_lang1 OWNER TO regress_alter_user1; -- OK
+ALTER LANGUAGE alt_lang2 OWNER TO regress_alter_user2; -- OK
+SET SESSION AUTHORIZATION regress_alter_user1;
ALTER LANGUAGE alt_lang1 RENAME TO alt_lang2; -- failed (name conflict)
ERROR: language "alt_lang2" already exists
ALTER LANGUAGE alt_lang2 RENAME TO alt_lang3; -- failed (not owner)
ERROR: must be owner of language alt_lang2
ALTER LANGUAGE alt_lang1 RENAME TO alt_lang3; -- OK
-ALTER LANGUAGE alt_lang2 OWNER TO regtest_alter_user3; -- failed (not owner)
+ALTER LANGUAGE alt_lang2 OWNER TO regress_alter_user3; -- failed (not owner)
ERROR: must be owner of language alt_lang2
-ALTER LANGUAGE alt_lang3 OWNER TO regtest_alter_user2; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
-ALTER LANGUAGE alt_lang3 OWNER TO regtest_alter_user3; -- OK
+ALTER LANGUAGE alt_lang3 OWNER TO regress_alter_user2; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user2"
+ALTER LANGUAGE alt_lang3 OWNER TO regress_alter_user3; -- OK
RESET SESSION AUTHORIZATION;
SELECT lanname, a.rolname
FROM pg_language l, pg_authid a
ORDER BY lanname;
lanname | rolname
-----------+---------------------
- alt_lang2 | regtest_alter_user2
- alt_lang3 | regtest_alter_user3
+ alt_lang2 | regress_alter_user2
+ alt_lang3 | regress_alter_user3
(2 rows)
--
-- Operator
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE OPERATOR @-@ ( leftarg = int4, rightarg = int4, procedure = int4mi );
CREATE OPERATOR @+@ ( leftarg = int4, rightarg = int4, procedure = int4pl );
-ALTER OPERATOR @+@(int4, int4) OWNER TO regtest_alter_user2; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
-ALTER OPERATOR @+@(int4, int4) OWNER TO regtest_alter_user3; -- OK
+ALTER OPERATOR @+@(int4, int4) OWNER TO regress_alter_user2; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user2"
+ALTER OPERATOR @+@(int4, int4) OWNER TO regress_alter_user3; -- OK
ALTER OPERATOR @-@(int4, int4) SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE OPERATOR @-@ ( leftarg = int4, rightarg = int4, procedure = int4mi );
-ALTER OPERATOR @+@(int4, int4) OWNER TO regtest_alter_user2; -- failed (not owner)
+ALTER OPERATOR @+@(int4, int4) OWNER TO regress_alter_user2; -- failed (not owner)
ERROR: must be owner of operator @+@
-ALTER OPERATOR @-@(int4, int4) OWNER TO regtest_alter_user3; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user3"
+ALTER OPERATOR @-@(int4, int4) OWNER TO regress_alter_user3; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user3"
ALTER OPERATOR @+@(int4, int4) SET SCHEMA alt_nsp2; -- failed (not owner)
ERROR: must be owner of operator @+@
-- can't test this: the error message includes the raw oid of namespace
ORDER BY nspname, oprname;
nspname | oprname | rolname | oprleft | oprright | oprcode
----------+---------+---------------------+---------+----------+---------
- alt_nsp1 | @+@ | regtest_alter_user3 | integer | integer | int4pl
- alt_nsp1 | @-@ | regtest_alter_user2 | integer | integer | int4mi
- alt_nsp2 | @-@ | regtest_alter_user1 | integer | integer | int4mi
+ alt_nsp1 | @+@ | regress_alter_user3 | integer | integer | int4pl
+ alt_nsp1 | @-@ | regress_alter_user2 | integer | integer | int4mi
+ alt_nsp2 | @-@ | regress_alter_user1 | integer | integer | int4mi
(3 rows)
--
--
CREATE OPERATOR FAMILY alt_opf1 USING hash;
CREATE OPERATOR FAMILY alt_opf2 USING hash;
-ALTER OPERATOR FAMILY alt_opf1 USING hash OWNER TO regtest_alter_user1;
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user1;
+ALTER OPERATOR FAMILY alt_opf1 USING hash OWNER TO regress_alter_user1;
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user1;
CREATE OPERATOR CLASS alt_opc1 FOR TYPE uuid USING hash AS STORAGE uuid;
CREATE OPERATOR CLASS alt_opc2 FOR TYPE uuid USING hash AS STORAGE uuid;
-ALTER OPERATOR CLASS alt_opc1 USING hash OWNER TO regtest_alter_user1;
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user1;
-SET SESSION AUTHORIZATION regtest_alter_user1;
+ALTER OPERATOR CLASS alt_opc1 USING hash OWNER TO regress_alter_user1;
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
ALTER OPERATOR FAMILY alt_opf1 USING hash RENAME TO alt_opf2; -- failed (name conflict)
ERROR: operator family "alt_opf2" for access method "hash" already exists in schema "alt_nsp1"
ALTER OPERATOR FAMILY alt_opf1 USING hash RENAME TO alt_opf3; -- OK
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user2; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user3; -- OK
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user2; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user2"
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user3; -- OK
ALTER OPERATOR FAMILY alt_opf2 USING hash SET SCHEMA alt_nsp2; -- OK
ALTER OPERATOR CLASS alt_opc1 USING hash RENAME TO alt_opc2; -- failed (name conflict)
ERROR: operator class "alt_opc2" for access method "hash" already exists in schema "alt_nsp1"
ALTER OPERATOR CLASS alt_opc1 USING hash RENAME TO alt_opc3; -- OK
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user2; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user3; -- OK
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user2; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user2"
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user3; -- OK
ALTER OPERATOR CLASS alt_opc2 USING hash SET SCHEMA alt_nsp2; -- OK
RESET SESSION AUTHORIZATION;
CREATE OPERATOR FAMILY alt_opf1 USING hash;
CREATE OPERATOR FAMILY alt_opf2 USING hash;
-ALTER OPERATOR FAMILY alt_opf1 USING hash OWNER TO regtest_alter_user2;
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user2;
+ALTER OPERATOR FAMILY alt_opf1 USING hash OWNER TO regress_alter_user2;
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user2;
CREATE OPERATOR CLASS alt_opc1 FOR TYPE macaddr USING hash AS STORAGE macaddr;
CREATE OPERATOR CLASS alt_opc2 FOR TYPE macaddr USING hash AS STORAGE macaddr;
-ALTER OPERATOR CLASS alt_opc1 USING hash OWNER TO regtest_alter_user2;
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user2;
-SET SESSION AUTHORIZATION regtest_alter_user2;
+ALTER OPERATOR CLASS alt_opc1 USING hash OWNER TO regress_alter_user2;
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
ALTER OPERATOR FAMILY alt_opf3 USING hash RENAME TO alt_opf4; -- failed (not owner)
ERROR: must be owner of operator family alt_opf3
ALTER OPERATOR FAMILY alt_opf1 USING hash RENAME TO alt_opf4; -- OK
-ALTER OPERATOR FAMILY alt_opf3 USING hash OWNER TO regtest_alter_user2; -- failed (not owner)
+ALTER OPERATOR FAMILY alt_opf3 USING hash OWNER TO regress_alter_user2; -- failed (not owner)
ERROR: must be owner of operator family alt_opf3
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user3; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user3"
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user3; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user3"
ALTER OPERATOR FAMILY alt_opf3 USING hash SET SCHEMA alt_nsp2; -- failed (not owner)
ERROR: must be owner of operator family alt_opf3
ALTER OPERATOR FAMILY alt_opf2 USING hash SET SCHEMA alt_nsp2; -- failed (name conflict)
ALTER OPERATOR CLASS alt_opc3 USING hash RENAME TO alt_opc4; -- failed (not owner)
ERROR: must be owner of operator class alt_opc3
ALTER OPERATOR CLASS alt_opc1 USING hash RENAME TO alt_opc4; -- OK
-ALTER OPERATOR CLASS alt_opc3 USING hash OWNER TO regtest_alter_user2; -- failed (not owner)
+ALTER OPERATOR CLASS alt_opc3 USING hash OWNER TO regress_alter_user2; -- failed (not owner)
ERROR: must be owner of operator class alt_opc3
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user3; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user3"
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user3; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user3"
ALTER OPERATOR CLASS alt_opc3 USING hash SET SCHEMA alt_nsp2; -- failed (not owner)
ERROR: must be owner of operator class alt_opc3
ALTER OPERATOR CLASS alt_opc2 USING hash SET SCHEMA alt_nsp2; -- failed (name conflict)
ORDER BY nspname, opfname;
nspname | opfname | amname | rolname
----------+----------+--------+---------------------
- alt_nsp1 | alt_opf2 | hash | regtest_alter_user2
- alt_nsp1 | alt_opf3 | hash | regtest_alter_user1
- alt_nsp1 | alt_opf4 | hash | regtest_alter_user2
- alt_nsp2 | alt_opf2 | hash | regtest_alter_user3
+ alt_nsp1 | alt_opf2 | hash | regress_alter_user2
+ alt_nsp1 | alt_opf3 | hash | regress_alter_user1
+ alt_nsp1 | alt_opf4 | hash | regress_alter_user2
+ alt_nsp2 | alt_opf2 | hash | regress_alter_user3
(4 rows)
SELECT nspname, opcname, amname, rolname
ORDER BY nspname, opcname;
nspname | opcname | amname | rolname
----------+----------+--------+---------------------
- alt_nsp1 | alt_opc2 | hash | regtest_alter_user2
- alt_nsp1 | alt_opc3 | hash | regtest_alter_user1
- alt_nsp1 | alt_opc4 | hash | regtest_alter_user2
- alt_nsp2 | alt_opc2 | hash | regtest_alter_user3
+ alt_nsp1 | alt_opc2 | hash | regress_alter_user2
+ alt_nsp1 | alt_opc3 | hash | regress_alter_user1
+ alt_nsp1 | alt_opc4 | hash | regress_alter_user2
+ alt_nsp2 | alt_opc2 | hash | regress_alter_user3
(4 rows)
-- ALTER OPERATOR FAMILY ... ADD/DROP
DROP OPERATOR FAMILY alt_opf4 USING btree;
-- Should fail. Need to be SUPERUSER to do ALTER OPERATOR FAMILY .. ADD / DROP
BEGIN TRANSACTION;
-CREATE ROLE regtest_alter_user5 NOSUPERUSER;
+CREATE ROLE regress_alter_user5 NOSUPERUSER;
CREATE OPERATOR FAMILY alt_opf5 USING btree;
-SET ROLE regtest_alter_user5;
+SET ROLE regress_alter_user5;
ALTER OPERATOR FAMILY alt_opf5 USING btree ADD OPERATOR 1 < (int4, int2), FUNCTION 1 btint42cmp(int4, int2);
ERROR: must be superuser to alter an operator family
RESET ROLE;
ROLLBACK;
-- Should fail. Need rights to namespace for ALTER OPERATOR FAMILY .. ADD / DROP
BEGIN TRANSACTION;
-CREATE ROLE regtest_alter_user6;
+CREATE ROLE regress_alter_user6;
CREATE SCHEMA alt_nsp6;
-REVOKE ALL ON SCHEMA alt_nsp6 FROM regtest_alter_user6;
+REVOKE ALL ON SCHEMA alt_nsp6 FROM regress_alter_user6;
CREATE OPERATOR FAMILY alt_nsp6.alt_opf6 USING btree;
-SET ROLE regtest_alter_user6;
+SET ROLE regress_alter_user6;
ALTER OPERATOR FAMILY alt_nsp6.alt_opf6 USING btree ADD OPERATOR 1 < (int4, int2);
ERROR: permission denied for schema alt_nsp6
ROLLBACK;
--
-- Text Search Dictionary
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE TEXT SEARCH DICTIONARY alt_ts_dict1 (template=simple);
CREATE TEXT SEARCH DICTIONARY alt_ts_dict2 (template=simple);
ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 RENAME TO alt_ts_dict2; -- failed (name conflict)
ERROR: text search dictionary "alt_ts_dict2" already exists in schema "alt_nsp1"
ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 RENAME TO alt_ts_dict3; -- OK
-ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regtest_alter_user2; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
-ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regtest_alter_user3; -- OK
+ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regress_alter_user2; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user2"
+ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regress_alter_user3; -- OK
ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE TEXT SEARCH DICTIONARY alt_ts_dict1 (template=simple);
CREATE TEXT SEARCH DICTIONARY alt_ts_dict2 (template=simple);
ALTER TEXT SEARCH DICTIONARY alt_ts_dict3 RENAME TO alt_ts_dict4; -- failed (not owner)
ERROR: must be owner of text search dictionary alt_ts_dict3
ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 RENAME TO alt_ts_dict4; -- OK
-ALTER TEXT SEARCH DICTIONARY alt_ts_dict3 OWNER TO regtest_alter_user2; -- failed (not owner)
+ALTER TEXT SEARCH DICTIONARY alt_ts_dict3 OWNER TO regress_alter_user2; -- failed (not owner)
ERROR: must be owner of text search dictionary alt_ts_dict3
-ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regtest_alter_user3; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user3"
+ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regress_alter_user3; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user3"
ALTER TEXT SEARCH DICTIONARY alt_ts_dict3 SET SCHEMA alt_nsp2; -- failed (not owner)
ERROR: must be owner of text search dictionary alt_ts_dict3
ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 SET SCHEMA alt_nsp2; -- failed (name conflict)
ORDER BY nspname, dictname;
nspname | dictname | rolname
----------+--------------+---------------------
- alt_nsp1 | alt_ts_dict2 | regtest_alter_user2
- alt_nsp1 | alt_ts_dict3 | regtest_alter_user1
- alt_nsp1 | alt_ts_dict4 | regtest_alter_user2
- alt_nsp2 | alt_ts_dict2 | regtest_alter_user3
+ alt_nsp1 | alt_ts_dict2 | regress_alter_user2
+ alt_nsp1 | alt_ts_dict3 | regress_alter_user1
+ alt_nsp1 | alt_ts_dict4 | regress_alter_user2
+ alt_nsp2 | alt_ts_dict2 | regress_alter_user3
(4 rows)
--
-- Text Search Configuration
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE TEXT SEARCH CONFIGURATION alt_ts_conf1 (copy=english);
CREATE TEXT SEARCH CONFIGURATION alt_ts_conf2 (copy=english);
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 RENAME TO alt_ts_conf2; -- failed (name conflict)
ERROR: text search configuration "alt_ts_conf2" already exists in schema "alt_nsp1"
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 RENAME TO alt_ts_conf3; -- OK
-ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regtest_alter_user2; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
-ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regtest_alter_user3; -- OK
+ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regress_alter_user2; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user2"
+ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regress_alter_user3; -- OK
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE TEXT SEARCH CONFIGURATION alt_ts_conf1 (copy=english);
CREATE TEXT SEARCH CONFIGURATION alt_ts_conf2 (copy=english);
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf3 RENAME TO alt_ts_conf4; -- failed (not owner)
ERROR: must be owner of text search configuration alt_ts_conf3
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 RENAME TO alt_ts_conf4; -- OK
-ALTER TEXT SEARCH CONFIGURATION alt_ts_conf3 OWNER TO regtest_alter_user2; -- failed (not owner)
+ALTER TEXT SEARCH CONFIGURATION alt_ts_conf3 OWNER TO regress_alter_user2; -- failed (not owner)
ERROR: must be owner of text search configuration alt_ts_conf3
-ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regtest_alter_user3; -- failed (no role membership)
-ERROR: must be member of role "regtest_alter_user3"
+ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regress_alter_user3; -- failed (no role membership)
+ERROR: must be member of role "regress_alter_user3"
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf3 SET SCHEMA alt_nsp2; -- failed (not owner)
ERROR: must be owner of text search configuration alt_ts_conf3
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 SET SCHEMA alt_nsp2; -- failed (name conflict)
ORDER BY nspname, cfgname;
nspname | cfgname | rolname
----------+--------------+---------------------
- alt_nsp1 | alt_ts_conf2 | regtest_alter_user2
- alt_nsp1 | alt_ts_conf3 | regtest_alter_user1
- alt_nsp1 | alt_ts_conf4 | regtest_alter_user2
- alt_nsp2 | alt_ts_conf2 | regtest_alter_user3
+ alt_nsp1 | alt_ts_conf2 | regress_alter_user2
+ alt_nsp1 | alt_ts_conf3 | regress_alter_user1
+ alt_nsp1 | alt_ts_conf4 | regress_alter_user2
+ alt_nsp2 | alt_ts_conf2 | regress_alter_user3
(4 rows)
--
drop cascades to text search configuration alt_ts_conf2
drop cascades to text search template alt_ts_temp2
drop cascades to text search parser alt_ts_prs2
-DROP USER regtest_alter_user1;
-DROP USER regtest_alter_user2;
-DROP USER regtest_alter_user3;
+DROP USER regress_alter_user1;
+DROP USER regress_alter_user2;
+DROP USER regress_alter_user3;
--
-- Test permission check. Must be owner to ALTER OPERATOR.
--
-CREATE USER regtest_alter_user;
-SET SESSION AUTHORIZATION regtest_alter_user;
+CREATE USER regress_alter_op_user;
+SET SESSION AUTHORIZATION regress_alter_op_user;
ALTER OPERATOR === (boolean, boolean) SET (RESTRICT = NONE);
ERROR: must be owner of operator ===
-- Clean up
RESET SESSION AUTHORIZATION;
-DROP USER regtest_alter_user;
+DROP USER regress_alter_op_user;
DROP OPERATOR === (boolean, boolean);
DROP FUNCTION customcontsel(internal, oid, internal, integer);
DROP FUNCTION alter_op_test_fn(boolean, boolean);
(0 rows)
-- Verify that clustering all tables does in fact cluster the right ones
-CREATE USER clstr_user;
+CREATE USER regress_clstr_user;
CREATE TABLE clstr_1 (a INT PRIMARY KEY);
CREATE TABLE clstr_2 (a INT PRIMARY KEY);
CREATE TABLE clstr_3 (a INT PRIMARY KEY);
-ALTER TABLE clstr_1 OWNER TO clstr_user;
-ALTER TABLE clstr_3 OWNER TO clstr_user;
-GRANT SELECT ON clstr_2 TO clstr_user;
+ALTER TABLE clstr_1 OWNER TO regress_clstr_user;
+ALTER TABLE clstr_3 OWNER TO regress_clstr_user;
+GRANT SELECT ON clstr_2 TO regress_clstr_user;
INSERT INTO clstr_1 VALUES (2);
INSERT INTO clstr_1 VALUES (1);
INSERT INTO clstr_2 VALUES (2);
INSERT INTO clstr_3 VALUES (1);
-- this user can only cluster clstr_1 and clstr_3, but the latter
-- has not been clustered
-SET SESSION AUTHORIZATION clstr_user;
+SET SESSION AUTHORIZATION regress_clstr_user;
CLUSTER;
SELECT * FROM clstr_1 UNION ALL
SELECT * FROM clstr_2 UNION ALL
DROP TABLE clstr_2;
DROP TABLE clstr_3;
DROP TABLE clstr_4;
-DROP USER clstr_user;
+DROP USER regress_clstr_user;
--
-- create user defined conversion
--
-CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEROLE;
-SET SESSION AUTHORIZATION conversion_test_user;
+CREATE USER regress_conversion_user WITH NOCREATEDB NOCREATEROLE;
+SET SESSION AUTHORIZATION regress_conversion_user;
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
--
-- cannot make same name conversion in same schema
-- return to the super user
--
RESET SESSION AUTHORIZATION;
-DROP USER conversion_test_user;
+DROP USER regress_conversion_user;
--
-- sanity check of pg_proc catalog to the given parameters
--
-CREATE USER regtest_unpriv_user;
+CREATE USER regress_unpriv_user;
CREATE SCHEMA temp_func_test;
GRANT ALL ON SCHEMA temp_func_test TO public;
SET search_path TO temp_func_test, public;
(2 rows)
-- it takes superuser privilege to turn on leakproof, but not for turn off
-ALTER FUNCTION functext_E_1(int) OWNER TO regtest_unpriv_user;
-ALTER FUNCTION functext_E_2(int) OWNER TO regtest_unpriv_user;
-SET SESSION AUTHORIZATION regtest_unpriv_user;
+ALTER FUNCTION functext_E_1(int) OWNER TO regress_unpriv_user;
+ALTER FUNCTION functext_E_2(int) OWNER TO regress_unpriv_user;
+SET SESSION AUTHORIZATION regress_unpriv_user;
SET search_path TO temp_func_test, public;
ALTER FUNCTION functext_E_1(int) NOT LEAKPROOF;
ALTER FUNCTION functext_E_2(int) LEAKPROOF;
drop cascades to function functest_is_1(integer,integer,text)
drop cascades to function functest_is_2(integer)
drop cascades to function functest_is_3(integer)
-DROP USER regtest_unpriv_user;
+DROP USER regress_unpriv_user;
RESET search_path;
ERROR: REINDEX SCHEMA cannot run inside a transaction block
END;
-- Failure for unauthorized user
-CREATE ROLE regression_reindexuser NOLOGIN;
-SET SESSION ROLE regression_reindexuser;
+CREATE ROLE regress_reindexuser NOLOGIN;
+SET SESSION ROLE regress_reindexuser;
REINDEX SCHEMA schema_to_reindex;
ERROR: must be owner of schema schema_to_reindex
-- Clean up
RESET ROLE;
-DROP ROLE regression_reindexuser;
+DROP ROLE regress_reindexuser;
SET client_min_messages TO 'warning';
DROP SCHEMA schema_to_reindex CASCADE;
RESET client_min_messages;
--
-- DEPENDENCIES
--
-CREATE USER regression_user;
-CREATE USER regression_user2;
-CREATE USER regression_user3;
-CREATE GROUP regression_group;
+CREATE USER regress_dep_user;
+CREATE USER regress_dep_user2;
+CREATE USER regress_dep_user3;
+CREATE GROUP regress_dep_group;
CREATE TABLE deptest (f1 serial primary key, f2 text);
-GRANT SELECT ON TABLE deptest TO GROUP regression_group;
-GRANT ALL ON TABLE deptest TO regression_user, regression_user2;
+GRANT SELECT ON TABLE deptest TO GROUP regress_dep_group;
+GRANT ALL ON TABLE deptest TO regress_dep_user, regress_dep_user2;
-- can't drop neither because they have privileges somewhere
-DROP USER regression_user;
-ERROR: role "regression_user" cannot be dropped because some objects depend on it
+DROP USER regress_dep_user;
+ERROR: role "regress_dep_user" cannot be dropped because some objects depend on it
DETAIL: privileges for table deptest
-DROP GROUP regression_group;
-ERROR: role "regression_group" cannot be dropped because some objects depend on it
+DROP GROUP regress_dep_group;
+ERROR: role "regress_dep_group" cannot be dropped because some objects depend on it
DETAIL: privileges for table deptest
-- if we revoke the privileges we can drop the group
-REVOKE SELECT ON deptest FROM GROUP regression_group;
-DROP GROUP regression_group;
+REVOKE SELECT ON deptest FROM GROUP regress_dep_group;
+DROP GROUP regress_dep_group;
-- can't drop the user if we revoke the privileges partially
-REVOKE SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES ON deptest FROM regression_user;
-DROP USER regression_user;
-ERROR: role "regression_user" cannot be dropped because some objects depend on it
+REVOKE SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES ON deptest FROM regress_dep_user;
+DROP USER regress_dep_user;
+ERROR: role "regress_dep_user" cannot be dropped because some objects depend on it
DETAIL: privileges for table deptest
-- now we are OK to drop him
-REVOKE TRIGGER ON deptest FROM regression_user;
-DROP USER regression_user;
+REVOKE TRIGGER ON deptest FROM regress_dep_user;
+DROP USER regress_dep_user;
-- we are OK too if we drop the privileges all at once
-REVOKE ALL ON deptest FROM regression_user2;
-DROP USER regression_user2;
+REVOKE ALL ON deptest FROM regress_dep_user2;
+DROP USER regress_dep_user2;
-- can't drop the owner of an object
-- the error message detail here would include a pg_toast_nnn name that
-- is not constant, so suppress it
\set VERBOSITY terse
-ALTER TABLE deptest OWNER TO regression_user3;
-DROP USER regression_user3;
-ERROR: role "regression_user3" cannot be dropped because some objects depend on it
+ALTER TABLE deptest OWNER TO regress_dep_user3;
+DROP USER regress_dep_user3;
+ERROR: role "regress_dep_user3" cannot be dropped because some objects depend on it
\set VERBOSITY default
-- if we drop the object, we can drop the user too
DROP TABLE deptest;
-DROP USER regression_user3;
+DROP USER regress_dep_user3;
-- Test DROP OWNED
-CREATE USER regression_user0;
-CREATE USER regression_user1;
-CREATE USER regression_user2;
-SET SESSION AUTHORIZATION regression_user0;
+CREATE USER regress_dep_user0;
+CREATE USER regress_dep_user1;
+CREATE USER regress_dep_user2;
+SET SESSION AUTHORIZATION regress_dep_user0;
-- permission denied
-DROP OWNED BY regression_user1;
+DROP OWNED BY regress_dep_user1;
ERROR: permission denied to drop objects
-DROP OWNED BY regression_user0, regression_user2;
+DROP OWNED BY regress_dep_user0, regress_dep_user2;
ERROR: permission denied to drop objects
-REASSIGN OWNED BY regression_user0 TO regression_user1;
+REASSIGN OWNED BY regress_dep_user0 TO regress_dep_user1;
ERROR: permission denied to reassign objects
-REASSIGN OWNED BY regression_user1 TO regression_user0;
+REASSIGN OWNED BY regress_dep_user1 TO regress_dep_user0;
ERROR: permission denied to reassign objects
-- this one is allowed
-DROP OWNED BY regression_user0;
+DROP OWNED BY regress_dep_user0;
CREATE TABLE deptest1 (f1 int unique);
-GRANT ALL ON deptest1 TO regression_user1 WITH GRANT OPTION;
-SET SESSION AUTHORIZATION regression_user1;
+GRANT ALL ON deptest1 TO regress_dep_user1 WITH GRANT OPTION;
+SET SESSION AUTHORIZATION regress_dep_user1;
CREATE TABLE deptest (a serial primary key, b text);
-GRANT ALL ON deptest1 TO regression_user2;
+GRANT ALL ON deptest1 TO regress_dep_user2;
RESET SESSION AUTHORIZATION;
\z deptest1
- Access privileges
- Schema | Name | Type | Access privileges | Column privileges | Policies
---------+----------+-------+--------------------------------------------------+-------------------+----------
- public | deptest1 | table | regression_user0=arwdDxt/regression_user0 +| |
- | | | regression_user1=a*r*w*d*D*x*t*/regression_user0+| |
- | | | regression_user2=arwdDxt/regression_user1 | |
+ Access privileges
+ Schema | Name | Type | Access privileges | Column privileges | Policies
+--------+----------+-------+----------------------------------------------------+-------------------+----------
+ public | deptest1 | table | regress_dep_user0=arwdDxt/regress_dep_user0 +| |
+ | | | regress_dep_user1=a*r*w*d*D*x*t*/regress_dep_user0+| |
+ | | | regress_dep_user2=arwdDxt/regress_dep_user1 | |
(1 row)
-DROP OWNED BY regression_user1;
+DROP OWNED BY regress_dep_user1;
-- all grants revoked
\z deptest1
- Access privileges
- Schema | Name | Type | Access privileges | Column privileges | Policies
---------+----------+-------+-------------------------------------------+-------------------+----------
- public | deptest1 | table | regression_user0=arwdDxt/regression_user0 | |
+ Access privileges
+ Schema | Name | Type | Access privileges | Column privileges | Policies
+--------+----------+-------+---------------------------------------------+-------------------+----------
+ public | deptest1 | table | regress_dep_user0=arwdDxt/regress_dep_user0 | |
(1 row)
-- table was dropped
\d deptest
-- Test REASSIGN OWNED
-GRANT ALL ON deptest1 TO regression_user1;
-GRANT CREATE ON DATABASE regression TO regression_user1;
-SET SESSION AUTHORIZATION regression_user1;
+GRANT ALL ON deptest1 TO regress_dep_user1;
+GRANT CREATE ON DATABASE regression TO regress_dep_user1;
+SET SESSION AUTHORIZATION regress_dep_user1;
CREATE SCHEMA deptest;
CREATE TABLE deptest (a serial primary key, b text);
-ALTER DEFAULT PRIVILEGES FOR ROLE regression_user1 IN SCHEMA deptest
- GRANT ALL ON TABLES TO regression_user2;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_dep_user1 IN SCHEMA deptest
+ GRANT ALL ON TABLES TO regress_dep_user2;
CREATE FUNCTION deptest_func() RETURNS void LANGUAGE plpgsql
AS $$ BEGIN END; $$;
CREATE TYPE deptest_enum AS ENUM ('red');
(1 row)
RESET SESSION AUTHORIZATION;
-REASSIGN OWNED BY regression_user1 TO regression_user2;
+REASSIGN OWNED BY regress_dep_user1 TO regress_dep_user2;
\dt deptest
List of relations
- Schema | Name | Type | Owner
---------+---------+-------+------------------
- public | deptest | table | regression_user2
+ Schema | Name | Type | Owner
+--------+---------+-------+-------------------
+ public | deptest | table | regress_dep_user2
(1 row)
SELECT typowner = relowner
(1 row)
-- doesn't work: grant still exists
-DROP USER regression_user1;
-ERROR: role "regression_user1" cannot be dropped because some objects depend on it
-DETAIL: owner of default privileges on new relations belonging to role regression_user1 in schema deptest
+DROP USER regress_dep_user1;
+ERROR: role "regress_dep_user1" cannot be dropped because some objects depend on it
+DETAIL: owner of default privileges on new relations belonging to role regress_dep_user1 in schema deptest
privileges for database regression
privileges for table deptest1
-DROP OWNED BY regression_user1;
-DROP USER regression_user1;
+DROP OWNED BY regress_dep_user1;
+DROP USER regress_dep_user1;
\set VERBOSITY terse
-DROP USER regression_user2;
-ERROR: role "regression_user2" cannot be dropped because some objects depend on it
-DROP OWNED BY regression_user2, regression_user0;
-DROP USER regression_user2;
-DROP USER regression_user0;
+DROP USER regress_dep_user2;
+ERROR: role "regress_dep_user2" cannot be dropped because some objects depend on it
+DROP OWNED BY regress_dep_user2, regress_dep_user0;
+DROP USER regress_dep_user2;
+DROP USER regress_dep_user0;
---
--- role/user/group
---
-CREATE USER tu1;
-CREATE ROLE tr1;
-CREATE GROUP tg1;
-DROP USER tu2;
-ERROR: role "tu2" does not exist
-DROP USER IF EXISTS tu1, tu2;
-NOTICE: role "tu2" does not exist, skipping
-DROP USER tu1;
-ERROR: role "tu1" does not exist
-DROP ROLE tr2;
-ERROR: role "tr2" does not exist
-DROP ROLE IF EXISTS tr1, tr2;
-NOTICE: role "tr2" does not exist, skipping
-DROP ROLE tr1;
-ERROR: role "tr1" does not exist
-DROP GROUP tg2;
-ERROR: role "tg2" does not exist
-DROP GROUP IF EXISTS tg1, tg2;
-NOTICE: role "tg2" does not exist, skipping
-DROP GROUP tg1;
-ERROR: role "tg1" does not exist
+CREATE USER regress_test_u1;
+CREATE ROLE regress_test_r1;
+CREATE GROUP regress_test_g1;
+DROP USER regress_test_u2;
+ERROR: role "regress_test_u2" does not exist
+DROP USER IF EXISTS regress_test_u1, regress_test_u2;
+NOTICE: role "regress_test_u2" does not exist, skipping
+DROP USER regress_test_u1;
+ERROR: role "regress_test_u1" does not exist
+DROP ROLE regress_test_r2;
+ERROR: role "regress_test_r2" does not exist
+DROP ROLE IF EXISTS regress_test_r1, regress_test_r2;
+NOTICE: role "regress_test_r2" does not exist, skipping
+DROP ROLE regress_test_r1;
+ERROR: role "regress_test_r1" does not exist
+DROP GROUP regress_test_g2;
+ERROR: role "regress_test_g2" does not exist
+DROP GROUP IF EXISTS regress_test_g1, regress_test_g2;
+NOTICE: role "regress_test_g2" does not exist, skipping
+DROP GROUP regress_test_g1;
+ERROR: role "regress_test_g1" does not exist
-- collation
DROP COLLATION IF EXISTS test_collation_exists;
NOTICE: collation "test_collation_exists" does not exist, skipping
comment on event trigger wrong.regress_event_trigger is 'test comment';
ERROR: event trigger name cannot be qualified
-- drop as non-superuser should fail
-create role regression_bob;
-set role regression_bob;
+create role regress_evt_user;
+set role regress_evt_user;
create event trigger regress_event_trigger_noperms on ddl_command_start
execute procedure test_event_trigger();
ERROR: permission denied to create event trigger "regress_event_trigger_noperms"
NOTICE: test_event_trigger: ddl_command_end CREATE FOREIGN DATA WRAPPER
create server useless_server foreign data wrapper useless;
NOTICE: test_event_trigger: ddl_command_end CREATE SERVER
-create user mapping for regression_bob server useless_server;
+create user mapping for regress_evt_user server useless_server;
NOTICE: test_event_trigger: ddl_command_end CREATE USER MAPPING
-alter default privileges for role regression_bob
- revoke delete on tables from regression_bob;
+alter default privileges for role regress_evt_user
+ revoke delete on tables from regress_evt_user;
NOTICE: test_event_trigger: ddl_command_end ALTER DEFAULT PRIVILEGES
-- alter owner to non-superuser should fail
-alter event trigger regress_event_trigger owner to regression_bob;
+alter event trigger regress_event_trigger owner to regress_evt_user;
ERROR: permission denied to change owner of event trigger "regress_event_trigger"
HINT: The owner of an event trigger must be a superuser.
-- alter owner to superuser should work
-alter role regression_bob superuser;
-alter event trigger regress_event_trigger owner to regression_bob;
+alter role regress_evt_user superuser;
+alter event trigger regress_event_trigger owner to regress_evt_user;
-- should fail, name collision
alter event trigger regress_event_trigger rename to regress_event_trigger2;
ERROR: event trigger "regress_event_trigger2" already exists
-- should fail, doesn't exist any more
drop event trigger regress_event_trigger;
ERROR: event trigger "regress_event_trigger" does not exist
--- should fail, regression_bob owns some objects
-drop role regression_bob;
-ERROR: role "regression_bob" cannot be dropped because some objects depend on it
+-- should fail, regress_evt_user owns some objects
+drop role regress_evt_user;
+ERROR: role "regress_evt_user" cannot be dropped because some objects depend on it
DETAIL: owner of event trigger regress_event_trigger3
-owner of default privileges on new relations belonging to role regression_bob
-owner of user mapping for regression_bob on server useless_server
+owner of default privileges on new relations belonging to role regress_evt_user
+owner of user mapping for regress_evt_user on server useless_server
-- cleanup before next test
-- these are all OK; the second one should emit a NOTICE
drop event trigger if exists regress_event_trigger2;
drop event trigger regress_event_trigger3;
drop event trigger regress_event_trigger_end;
-- test support for dropped objects
-CREATE SCHEMA schema_one authorization regression_bob;
-CREATE SCHEMA schema_two authorization regression_bob;
-CREATE SCHEMA audit_tbls authorization regression_bob;
+CREATE SCHEMA schema_one authorization regress_evt_user;
+CREATE SCHEMA schema_two authorization regress_evt_user;
+CREATE SCHEMA audit_tbls authorization regress_evt_user;
CREATE TEMP TABLE a_temp_tbl ();
-SET SESSION AUTHORIZATION regression_bob;
+SET SESSION AUTHORIZATION regress_evt_user;
CREATE TABLE schema_one.table_one(a int);
CREATE TABLE schema_one."table two"(a int);
CREATE TABLE schema_one.table_three(a int);
type | schema_one | schema_one.table_three[]
(23 rows)
-DROP OWNED BY regression_bob;
+DROP OWNED BY regress_evt_user;
NOTICE: schema "audit_tbls" does not exist, skipping
SELECT * FROM dropped_objects WHERE type = 'schema';
type | schema | object
schema | | audit_tbls
(3 rows)
-DROP ROLE regression_bob;
+DROP ROLE regress_evt_user;
DROP EVENT TRIGGER regress_event_trigger_drop_objects;
DROP EVENT TRIGGER undroppable;
CREATE OR REPLACE FUNCTION event_trigger_report_dropped()
--
-- Clean up in case a prior regression run failed
-- Suppress NOTICE messages when roles don't exist
-SET client_min_messages TO 'error';
-DROP ROLE IF EXISTS foreign_data_user, regress_test_role, regress_test_role2, regress_test_role_super, regress_test_indirect, unpriviled_role;
+SET client_min_messages TO 'warning';
+DROP ROLE IF EXISTS regress_foreign_data_user, regress_test_role, regress_test_role2, regress_test_role_super, regress_test_indirect, regress_unprivileged_role;
RESET client_min_messages;
-CREATE ROLE foreign_data_user LOGIN SUPERUSER;
-SET SESSION AUTHORIZATION 'foreign_data_user';
+CREATE ROLE regress_foreign_data_user LOGIN SUPERUSER;
+SET SESSION AUTHORIZATION 'regress_foreign_data_user';
CREATE ROLE regress_test_role;
CREATE ROLE regress_test_role2;
CREATE ROLE regress_test_role_super SUPERUSER;
CREATE ROLE regress_test_indirect;
-CREATE ROLE unprivileged_role;
+CREATE ROLE regress_unprivileged_role;
CREATE FOREIGN DATA WRAPPER dummy;
COMMENT ON FOREIGN DATA WRAPPER dummy IS 'useless';
CREATE FOREIGN DATA WRAPPER postgresql VALIDATOR postgresql_fdw_validator;
ERROR: function bar(text[], oid) does not exist
CREATE FOREIGN DATA WRAPPER foo;
\dew
- List of foreign-data wrappers
- Name | Owner | Handler | Validator
-------------+-------------------+---------+--------------------------
- dummy | foreign_data_user | - | -
- foo | foreign_data_user | - | -
- postgresql | foreign_data_user | - | postgresql_fdw_validator
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator
+------------+---------------------------+---------+--------------------------
+ dummy | regress_foreign_data_user | - | -
+ foo | regress_foreign_data_user | - | -
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator
(3 rows)
CREATE FOREIGN DATA WRAPPER foo; -- duplicate
DROP FOREIGN DATA WRAPPER foo;
CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1');
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+---------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | foreign_data_user | - | - | | (testing '1') |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+---------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (testing '1') |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
DROP FOREIGN DATA WRAPPER foo;
ERROR: option "testing" provided more than once
CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1', another '2');
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+----------------------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | foreign_data_user | - | - | | (testing '1', another '2') |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+----------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (testing '1', another '2') |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
DROP FOREIGN DATA WRAPPER foo;
RESET ROLE;
CREATE FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator;
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | foreign_data_user | - | postgresql_fdw_validator | | |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
-- ALTER FOREIGN DATA WRAPPER
ERROR: function bar(text[], oid) does not exist
ALTER FOREIGN DATA WRAPPER foo NO VALIDATOR;
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | foreign_data_user | - | - | | |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo OPTIONS (a '1', b '2');
ERROR: option "c" not found
ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD x '1', DROP x);
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+----------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | foreign_data_user | - | - | | (a '1', b '2') |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+----------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (a '1', b '2') |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo OPTIONS (DROP a, SET b '3', ADD c '4');
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+----------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | foreign_data_user | - | - | | (b '3', c '4') |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+----------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (b '3', c '4') |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo OPTIONS (a '2');
ALTER FOREIGN DATA WRAPPER foo OPTIONS (b '4'); -- ERROR
ERROR: option "b" provided more than once
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+-----------------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | foreign_data_user | - | - | | (b '3', c '4', a '2') |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+-----------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (b '3', c '4', a '2') |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
SET ROLE regress_test_role;
SET ROLE regress_test_role_super;
ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD d '5');
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+------------------------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | foreign_data_user | - | - | | (b '3', c '4', a '2', d '5') |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+------------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (b '3', c '4', a '2', d '5') |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo OWNER TO regress_test_role; -- ERROR
HINT: Must be superuser to alter a foreign-data wrapper.
RESET ROLE;
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------------+---------+--------------------------+-------------------+------------------------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+------------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo RENAME TO foo1;
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------------+---------+--------------------------+-------------------+------------------------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo1 | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+------------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo1 | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo1 RENAME TO foo;
DROP FOREIGN DATA WRAPPER IF EXISTS nonexistent;
NOTICE: foreign-data wrapper "nonexistent" does not exist, skipping
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------------+---------+--------------------------+-------------------+------------------------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+------------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
DROP ROLE regress_test_role_super; -- ERROR
RESET ROLE;
DROP ROLE regress_test_role_super;
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(2 rows)
CREATE FOREIGN DATA WRAPPER foo;
COMMENT ON SERVER s1 IS 'foreign server';
CREATE USER MAPPING FOR current_user SERVER s1;
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- foo | foreign_data_user | - | - | | |
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | |
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(3 rows)
\des+
- List of foreign servers
- Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
-------+-------------------+----------------------+-------------------+------+---------+-------------+----------------
- s1 | foreign_data_user | foo | | | | | foreign server
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
+------+---------------------------+----------------------+-------------------+------+---------+-------------+----------------
+ s1 | regress_foreign_data_user | foo | | | | | foreign server
(1 row)
\deu+
- List of user mappings
- Server | User name | FDW Options
---------+-------------------+-------------
- s1 | foreign_data_user |
+ List of user mappings
+ Server | User name | FDW Options
+--------+---------------------------+-------------
+ s1 | regress_foreign_data_user |
(1 row)
DROP FOREIGN DATA WRAPPER foo; -- ERROR
ERROR: cannot drop foreign-data wrapper foo because other objects depend on it
DETAIL: server s1 depends on foreign-data wrapper foo
-user mapping for foreign_data_user on server s1 depends on server s1
+user mapping for regress_foreign_data_user on server s1 depends on server s1
HINT: Use DROP ... CASCADE to drop the dependent objects too.
SET ROLE regress_test_role;
DROP FOREIGN DATA WRAPPER foo CASCADE; -- ERROR
DROP FOREIGN DATA WRAPPER foo CASCADE;
NOTICE: drop cascades to 2 other objects
DETAIL: drop cascades to server s1
-drop cascades to user mapping for foreign_data_user on server s1
+drop cascades to user mapping for regress_foreign_data_user on server s1
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
-------------+-------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | foreign_data_user | - | - | | | useless
- postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW Options | Description
+------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
(2 rows)
\des+
HINT: Valid options in this context are: authtype, service, connect_timeout, dbname, host, hostaddr, port, tty, options, requiressl, sslmode, gsslib
CREATE SERVER s8 FOREIGN DATA WRAPPER postgresql OPTIONS (host 'localhost', dbname 's8db');
\des+
- List of foreign servers
- Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
-------+-------------------+----------------------+-------------------+--------+---------+-----------------------------------+-------------
- s1 | foreign_data_user | foo | | | | |
- s2 | foreign_data_user | foo | | | | (host 'a', dbname 'b') |
- s3 | foreign_data_user | foo | | oracle | | |
- s4 | foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
- s5 | foreign_data_user | foo | | | 15.0 | |
- s6 | foreign_data_user | foo | | | 16.0 | (host 'a', dbname 'b') |
- s7 | foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
- s8 | foreign_data_user | postgresql | | | | (host 'localhost', dbname 's8db') |
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
+------+---------------------------+----------------------+-------------------+--------+---------+-----------------------------------+-------------
+ s1 | regress_foreign_data_user | foo | | | | |
+ s2 | regress_foreign_data_user | foo | | | | (host 'a', dbname 'b') |
+ s3 | regress_foreign_data_user | foo | | oracle | | |
+ s4 | regress_foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
+ s5 | regress_foreign_data_user | foo | | | 15.0 | |
+ s6 | regress_foreign_data_user | foo | | | 16.0 | (host 'a', dbname 'b') |
+ s7 | regress_foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
+ s8 | regress_foreign_data_user | postgresql | | | | (host 'localhost', dbname 's8db') |
(8 rows)
SET ROLE regress_test_role;
CREATE SERVER t1 FOREIGN DATA WRAPPER foo;
RESET ROLE;
\des+
- List of foreign servers
- Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
-------+-------------------+----------------------+-------------------+--------+---------+-----------------------------------+-------------
- s1 | foreign_data_user | foo | | | | |
- s2 | foreign_data_user | foo | | | | (host 'a', dbname 'b') |
- s3 | foreign_data_user | foo | | oracle | | |
- s4 | foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
- s5 | foreign_data_user | foo | | | 15.0 | |
- s6 | foreign_data_user | foo | | | 16.0 | (host 'a', dbname 'b') |
- s7 | foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
- s8 | foreign_data_user | postgresql | | | | (host 'localhost', dbname 's8db') |
- t1 | regress_test_role | foo | | | | |
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
+------+---------------------------+----------------------+-------------------+--------+---------+-----------------------------------+-------------
+ s1 | regress_foreign_data_user | foo | | | | |
+ s2 | regress_foreign_data_user | foo | | | | (host 'a', dbname 'b') |
+ s3 | regress_foreign_data_user | foo | | oracle | | |
+ s4 | regress_foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
+ s5 | regress_foreign_data_user | foo | | | 15.0 | |
+ s6 | regress_foreign_data_user | foo | | | 16.0 | (host 'a', dbname 'b') |
+ s7 | regress_foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
+ s8 | regress_foreign_data_user | postgresql | | | | (host 'localhost', dbname 's8db') |
+ t1 | regress_test_role | foo | | | | |
(9 rows)
REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM regress_test_role;
SET ROLE regress_test_role;
CREATE SERVER t2 FOREIGN DATA WRAPPER foo;
\des+
- List of foreign servers
- Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
-------+-------------------+----------------------+-------------------+--------+---------+-----------------------------------+-------------
- s1 | foreign_data_user | foo | | | | |
- s2 | foreign_data_user | foo | | | | (host 'a', dbname 'b') |
- s3 | foreign_data_user | foo | | oracle | | |
- s4 | foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
- s5 | foreign_data_user | foo | | | 15.0 | |
- s6 | foreign_data_user | foo | | | 16.0 | (host 'a', dbname 'b') |
- s7 | foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
- s8 | foreign_data_user | postgresql | | | | (host 'localhost', dbname 's8db') |
- t1 | regress_test_role | foo | | | | |
- t2 | regress_test_role | foo | | | | |
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
+------+---------------------------+----------------------+-------------------+--------+---------+-----------------------------------+-------------
+ s1 | regress_foreign_data_user | foo | | | | |
+ s2 | regress_foreign_data_user | foo | | | | (host 'a', dbname 'b') |
+ s3 | regress_foreign_data_user | foo | | oracle | | |
+ s4 | regress_foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
+ s5 | regress_foreign_data_user | foo | | | 15.0 | |
+ s6 | regress_foreign_data_user | foo | | | 16.0 | (host 'a', dbname 'b') |
+ s7 | regress_foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
+ s8 | regress_foreign_data_user | postgresql | | | | (host 'localhost', dbname 's8db') |
+ t1 | regress_test_role | foo | | | | |
+ t2 | regress_test_role | foo | | | | |
(10 rows)
RESET ROLE;
GRANT USAGE ON FOREIGN SERVER s1 TO regress_test_role;
GRANT USAGE ON FOREIGN SERVER s6 TO regress_test_role2 WITH GRANT OPTION;
\des+
- List of foreign servers
- Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
-------+-------------------+----------------------+-----------------------------------------+--------+---------+-----------------------------------+-------------
- s1 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 1.0 | (servername 's1') |
- | | | regress_test_role=U/foreign_data_user | | | |
- s2 | foreign_data_user | foo | | | 1.1 | (host 'a', dbname 'b') |
- s3 | foreign_data_user | foo | | oracle | | ("tns name" 'orcl', port '1521') |
- s4 | foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
- s5 | foreign_data_user | foo | | | 15.0 | |
- s6 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 16.0 | (host 'a', dbname 'b') |
- | | | regress_test_role2=U*/foreign_data_user | | | |
- s7 | foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
- s8 | foreign_data_user | postgresql | | | | (host 'localhost', dbname 's8db') |
- t1 | regress_test_role | foo | | | | |
- t2 | regress_test_role | foo | | | | |
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
+------+---------------------------+----------------------+-------------------------------------------------------+--------+---------+-----------------------------------+-------------
+ s1 | regress_foreign_data_user | foo | regress_foreign_data_user=U/regress_foreign_data_user+| | 1.0 | (servername 's1') |
+ | | | regress_test_role=U/regress_foreign_data_user | | | |
+ s2 | regress_foreign_data_user | foo | | | 1.1 | (host 'a', dbname 'b') |
+ s3 | regress_foreign_data_user | foo | | oracle | | ("tns name" 'orcl', port '1521') |
+ s4 | regress_foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
+ s5 | regress_foreign_data_user | foo | | | 15.0 | |
+ s6 | regress_foreign_data_user | foo | regress_foreign_data_user=U/regress_foreign_data_user+| | 16.0 | (host 'a', dbname 'b') |
+ | | | regress_test_role2=U*/regress_foreign_data_user | | | |
+ s7 | regress_foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
+ s8 | regress_foreign_data_user | postgresql | | | | (host 'localhost', dbname 's8db') |
+ t1 | regress_test_role | foo | | | | |
+ t2 | regress_test_role | foo | | | | |
(10 rows)
SET ROLE regress_test_role;
DETAIL: owner of server s1
privileges for foreign-data wrapper foo
\des+
- List of foreign servers
- Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
-------+-----------------------+----------------------+-----------------------------------------------+--------+---------+--------------------------------------+-------------
- s1 | regress_test_indirect | foo | regress_test_indirect=U/regress_test_indirect | | 1.1 | (servername 's1') |
- s2 | foreign_data_user | foo | | | 1.1 | (host 'a', dbname 'b') |
- s3 | foreign_data_user | foo | | oracle | | ("tns name" 'orcl', port '1521') |
- s4 | foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
- s5 | foreign_data_user | foo | | | 15.0 | |
- s6 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 16.0 | (host 'a', dbname 'b') |
- | | | regress_test_role2=U*/foreign_data_user | | | |
- s7 | foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
- s8 | foreign_data_user | postgresql | | | | (dbname 'db1', connect_timeout '30') |
- t1 | regress_test_role | foo | | | | |
- t2 | regress_test_role | foo | | | | |
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
+------+---------------------------+----------------------+-------------------------------------------------------+--------+---------+--------------------------------------+-------------
+ s1 | regress_test_indirect | foo | regress_test_indirect=U/regress_test_indirect | | 1.1 | (servername 's1') |
+ s2 | regress_foreign_data_user | foo | | | 1.1 | (host 'a', dbname 'b') |
+ s3 | regress_foreign_data_user | foo | | oracle | | ("tns name" 'orcl', port '1521') |
+ s4 | regress_foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
+ s5 | regress_foreign_data_user | foo | | | 15.0 | |
+ s6 | regress_foreign_data_user | foo | regress_foreign_data_user=U/regress_foreign_data_user+| | 16.0 | (host 'a', dbname 'b') |
+ | | | regress_test_role2=U*/regress_foreign_data_user | | | |
+ s7 | regress_foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
+ s8 | regress_foreign_data_user | postgresql | | | | (dbname 'db1', connect_timeout '30') |
+ t1 | regress_test_role | foo | | | | |
+ t2 | regress_test_role | foo | | | | |
(10 rows)
ALTER SERVER s8 RENAME to s8new;
\des+
- List of foreign servers
- Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
--------+-----------------------+----------------------+-----------------------------------------------+--------+---------+--------------------------------------+-------------
- s1 | regress_test_indirect | foo | regress_test_indirect=U/regress_test_indirect | | 1.1 | (servername 's1') |
- s2 | foreign_data_user | foo | | | 1.1 | (host 'a', dbname 'b') |
- s3 | foreign_data_user | foo | | oracle | | ("tns name" 'orcl', port '1521') |
- s4 | foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
- s5 | foreign_data_user | foo | | | 15.0 | |
- s6 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 16.0 | (host 'a', dbname 'b') |
- | | | regress_test_role2=U*/foreign_data_user | | | |
- s7 | foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
- s8new | foreign_data_user | postgresql | | | | (dbname 'db1', connect_timeout '30') |
- t1 | regress_test_role | foo | | | | |
- t2 | regress_test_role | foo | | | | |
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW Options | Description
+-------+---------------------------+----------------------+-------------------------------------------------------+--------+---------+--------------------------------------+-------------
+ s1 | regress_test_indirect | foo | regress_test_indirect=U/regress_test_indirect | | 1.1 | (servername 's1') |
+ s2 | regress_foreign_data_user | foo | | | 1.1 | (host 'a', dbname 'b') |
+ s3 | regress_foreign_data_user | foo | | oracle | | ("tns name" 'orcl', port '1521') |
+ s4 | regress_foreign_data_user | foo | | oracle | | (host 'a', dbname 'b') |
+ s5 | regress_foreign_data_user | foo | | | 15.0 | |
+ s6 | regress_foreign_data_user | foo | regress_foreign_data_user=U/regress_foreign_data_user+| | 16.0 | (host 'a', dbname 'b') |
+ | | | regress_test_role2=U*/regress_foreign_data_user | | | |
+ s7 | regress_foreign_data_user | foo | | oracle | 17.0 | (host 'a', dbname 'b') |
+ s8new | regress_foreign_data_user | postgresql | | | | (dbname 'db1', connect_timeout '30') |
+ t1 | regress_test_role | foo | | | | |
+ t2 | regress_test_role | foo | | | | |
(10 rows)
ALTER SERVER s8new RENAME to s8;
DROP SERVER IF EXISTS nonexistent;
NOTICE: server "nonexistent" does not exist, skipping
\des
- List of foreign servers
- Name | Owner | Foreign-data wrapper
-------+-----------------------+----------------------
- s1 | regress_test_indirect | foo
- s2 | foreign_data_user | foo
- s3 | foreign_data_user | foo
- s4 | foreign_data_user | foo
- s5 | foreign_data_user | foo
- s6 | foreign_data_user | foo
- s7 | foreign_data_user | foo
- s8 | foreign_data_user | postgresql
- t1 | regress_test_role | foo
- t2 | regress_test_role | foo
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper
+------+---------------------------+----------------------
+ s1 | regress_test_indirect | foo
+ s2 | regress_foreign_data_user | foo
+ s3 | regress_foreign_data_user | foo
+ s4 | regress_foreign_data_user | foo
+ s5 | regress_foreign_data_user | foo
+ s6 | regress_foreign_data_user | foo
+ s7 | regress_foreign_data_user | foo
+ s8 | regress_foreign_data_user | postgresql
+ t1 | regress_test_role | foo
+ t2 | regress_test_role | foo
(10 rows)
SET ROLE regress_test_role;
DROP SERVER s1;
RESET ROLE;
\des
- List of foreign servers
- Name | Owner | Foreign-data wrapper
-------+-------------------+----------------------
- s2 | foreign_data_user | foo
- s3 | foreign_data_user | foo
- s4 | foreign_data_user | foo
- s5 | foreign_data_user | foo
- s6 | foreign_data_user | foo
- s7 | foreign_data_user | foo
- s8 | foreign_data_user | postgresql
- t1 | regress_test_role | foo
- t2 | regress_test_role | foo
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper
+------+---------------------------+----------------------
+ s2 | regress_foreign_data_user | foo
+ s3 | regress_foreign_data_user | foo
+ s4 | regress_foreign_data_user | foo
+ s5 | regress_foreign_data_user | foo
+ s6 | regress_foreign_data_user | foo
+ s7 | regress_foreign_data_user | foo
+ s8 | regress_foreign_data_user | postgresql
+ t1 | regress_test_role | foo
+ t2 | regress_test_role | foo
(9 rows)
ALTER SERVER s2 OWNER TO regress_test_role;
DROP SERVER s2;
RESET ROLE;
\des
- List of foreign servers
- Name | Owner | Foreign-data wrapper
-------+-------------------+----------------------
- s3 | foreign_data_user | foo
- s4 | foreign_data_user | foo
- s5 | foreign_data_user | foo
- s6 | foreign_data_user | foo
- s7 | foreign_data_user | foo
- s8 | foreign_data_user | postgresql
- t1 | regress_test_role | foo
- t2 | regress_test_role | foo
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper
+------+---------------------------+----------------------
+ s3 | regress_foreign_data_user | foo
+ s4 | regress_foreign_data_user | foo
+ s5 | regress_foreign_data_user | foo
+ s6 | regress_foreign_data_user | foo
+ s7 | regress_foreign_data_user | foo
+ s8 | regress_foreign_data_user | postgresql
+ t1 | regress_test_role | foo
+ t2 | regress_test_role | foo
(8 rows)
CREATE USER MAPPING FOR current_user SERVER s3;
\deu
- List of user mappings
- Server | User name
---------+-------------------
- s3 | foreign_data_user
+ List of user mappings
+ Server | User name
+--------+---------------------------
+ s3 | regress_foreign_data_user
(1 row)
DROP SERVER s3; -- ERROR
ERROR: cannot drop server s3 because other objects depend on it
-DETAIL: user mapping for foreign_data_user on server s3 depends on server s3
+DETAIL: user mapping for regress_foreign_data_user on server s3 depends on server s3
HINT: Use DROP ... CASCADE to drop the dependent objects too.
DROP SERVER s3 CASCADE;
-NOTICE: drop cascades to user mapping for foreign_data_user on server s3
+NOTICE: drop cascades to user mapping for regress_foreign_data_user on server s3
\des
- List of foreign servers
- Name | Owner | Foreign-data wrapper
-------+-------------------+----------------------
- s4 | foreign_data_user | foo
- s5 | foreign_data_user | foo
- s6 | foreign_data_user | foo
- s7 | foreign_data_user | foo
- s8 | foreign_data_user | postgresql
- t1 | regress_test_role | foo
- t2 | regress_test_role | foo
+ List of foreign servers
+ Name | Owner | Foreign-data wrapper
+------+---------------------------+----------------------
+ s4 | regress_foreign_data_user | foo
+ s5 | regress_foreign_data_user | foo
+ s6 | regress_foreign_data_user | foo
+ s7 | regress_foreign_data_user | foo
+ s8 | regress_foreign_data_user | postgresql
+ t1 | regress_test_role | foo
+ t2 | regress_test_role | foo
(7 rows)
\deu
ERROR: server "s1" does not exist
CREATE USER MAPPING FOR current_user SERVER s4;
CREATE USER MAPPING FOR user SERVER s4; -- ERROR duplicate
-ERROR: user mapping "foreign_data_user" already exists for server s4
+ERROR: user mapping "regress_foreign_data_user" already exists for server s4
CREATE USER MAPPING FOR public SERVER s4 OPTIONS ("this mapping" 'is public');
CREATE USER MAPPING FOR user SERVER s8 OPTIONS (username 'test', password 'secret'); -- ERROR
ERROR: invalid option "username"
CREATE USER MAPPING FOR public SERVER t1;
RESET ROLE;
\deu
- List of user mappings
- Server | User name
---------+-------------------
- s4 | foreign_data_user
+ List of user mappings
+ Server | User name
+--------+---------------------------
s4 | public
+ s4 | regress_foreign_data_user
s5 | regress_test_role
s6 | regress_test_role
- s8 | foreign_data_user
+ s8 | regress_foreign_data_user
t1 | public
t1 | regress_test_role
(7 rows)
ALTER USER MAPPING FOR public SERVER t1 OPTIONS (ADD modified '1');
RESET ROLE;
\deu+
- List of user mappings
- Server | User name | FDW Options
---------+-------------------+----------------------------------
- s4 | foreign_data_user |
- s4 | public | ("this mapping" 'is public')
- s5 | regress_test_role | (modified '1')
- s6 | regress_test_role | (username 'test')
- s8 | foreign_data_user | (password 'public')
- t1 | public | (modified '1')
- t1 | regress_test_role | (username 'bob', password 'boo')
+ List of user mappings
+ Server | User name | FDW Options
+--------+---------------------------+----------------------------------
+ s4 | public | ("this mapping" 'is public')
+ s4 | regress_foreign_data_user |
+ s5 | regress_test_role | (modified '1')
+ s6 | regress_test_role | (username 'test')
+ s8 | regress_foreign_data_user | (password 'public')
+ t1 | public | (modified '1')
+ t1 | regress_test_role | (username 'bob', password 'boo')
(7 rows)
-- DROP USER MAPPING
RESET ROLE;
DROP SERVER s7;
\deu
- List of user mappings
- Server | User name
---------+-------------------
- s4 | foreign_data_user
+ List of user mappings
+ Server | User name
+--------+---------------------------
s4 | public
+ s4 | regress_foreign_data_user
s5 | regress_test_role
s6 | regress_test_role
- s8 | foreign_data_user
s8 | public
+ s8 | regress_foreign_data_user
t1 | public
t1 | regress_test_role
(8 rows)
NOTICE: relation "doesnt_exist_ft1" does not exist, skipping
-- Information schema
SELECT * FROM information_schema.foreign_data_wrappers ORDER BY 1, 2;
- foreign_data_wrapper_catalog | foreign_data_wrapper_name | authorization_identifier | library_name | foreign_data_wrapper_language
-------------------------------+---------------------------+--------------------------+--------------+-------------------------------
- regression | dummy | foreign_data_user | | c
- regression | foo | foreign_data_user | | c
- regression | postgresql | foreign_data_user | | c
+ foreign_data_wrapper_catalog | foreign_data_wrapper_name | authorization_identifier | library_name | foreign_data_wrapper_language
+------------------------------+---------------------------+---------------------------+--------------+-------------------------------
+ regression | dummy | regress_foreign_data_user | | c
+ regression | foo | regress_foreign_data_user | | c
+ regression | postgresql | regress_foreign_data_user | | c
(3 rows)
SELECT * FROM information_schema.foreign_data_wrapper_options ORDER BY 1, 2, 3;
(1 row)
SELECT * FROM information_schema.foreign_servers ORDER BY 1, 2;
- foreign_server_catalog | foreign_server_name | foreign_data_wrapper_catalog | foreign_data_wrapper_name | foreign_server_type | foreign_server_version | authorization_identifier
-------------------------+---------------------+------------------------------+---------------------------+---------------------+------------------------+--------------------------
- regression | s0 | regression | dummy | | | foreign_data_user
- regression | s4 | regression | foo | oracle | | foreign_data_user
+ foreign_server_catalog | foreign_server_name | foreign_data_wrapper_catalog | foreign_data_wrapper_name | foreign_server_type | foreign_server_version | authorization_identifier
+------------------------+---------------------+------------------------------+---------------------------+---------------------+------------------------+---------------------------
+ regression | s0 | regression | dummy | | | regress_foreign_data_user
+ regression | s4 | regression | foo | oracle | | regress_foreign_data_user
regression | s5 | regression | foo | | 15.0 | regress_test_role
regression | s6 | regression | foo | | 16.0 | regress_test_indirect
- regression | s8 | regression | postgresql | | | foreign_data_user
+ regression | s8 | regression | postgresql | | | regress_foreign_data_user
regression | t1 | regression | foo | | | regress_test_indirect
regression | t2 | regression | foo | | | regress_test_role
(7 rows)
(6 rows)
SELECT * FROM information_schema.user_mappings ORDER BY lower(authorization_identifier), 2, 3;
- authorization_identifier | foreign_server_catalog | foreign_server_name
---------------------------+------------------------+---------------------
- foreign_data_user | regression | s4
- foreign_data_user | regression | s8
- PUBLIC | regression | s4
- PUBLIC | regression | s8
- PUBLIC | regression | t1
- regress_test_role | regression | s5
- regress_test_role | regression | s6
- regress_test_role | regression | t1
+ authorization_identifier | foreign_server_catalog | foreign_server_name
+---------------------------+------------------------+---------------------
+ PUBLIC | regression | s4
+ PUBLIC | regression | s8
+ PUBLIC | regression | t1
+ regress_foreign_data_user | regression | s4
+ regress_foreign_data_user | regression | s8
+ regress_test_role | regression | s5
+ regress_test_role | regression | s6
+ regress_test_role | regression | t1
(8 rows)
SELECT * FROM information_schema.user_mapping_options ORDER BY lower(authorization_identifier), 2, 3, 4;
- authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
---------------------------+------------------------+---------------------+--------------+--------------
- foreign_data_user | regression | s8 | password | public
- PUBLIC | regression | s4 | this mapping | is public
- PUBLIC | regression | t1 | modified | 1
- regress_test_role | regression | s5 | modified | 1
- regress_test_role | regression | s6 | username | test
- regress_test_role | regression | t1 | password | boo
- regress_test_role | regression | t1 | username | bob
+ authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
+---------------------------+------------------------+---------------------+--------------+--------------
+ PUBLIC | regression | s4 | this mapping | is public
+ PUBLIC | regression | t1 | modified | 1
+ regress_foreign_data_user | regression | s8 | password | public
+ regress_test_role | regression | s5 | modified | 1
+ regress_test_role | regression | s6 | username | test
+ regress_test_role | regression | t1 | password | boo
+ regress_test_role | regression | t1 | username | bob
(7 rows)
SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' AND object_name IN ('s6', 'foo') ORDER BY 1, 2, 3, 4, 5;
- grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
------------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
- foreign_data_user | foreign_data_user | regression | | foo | FOREIGN DATA WRAPPER | USAGE | YES
- foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
- regress_test_indirect | regress_test_indirect | regression | | s6 | FOREIGN SERVER | USAGE | YES
- regress_test_indirect | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
+ grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
+---------------------------+---------------------------+----------------+---------------+-------------+----------------------+----------------+--------------
+ regress_foreign_data_user | regress_foreign_data_user | regression | | foo | FOREIGN DATA WRAPPER | USAGE | YES
+ regress_foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
+ regress_test_indirect | regress_test_indirect | regression | | s6 | FOREIGN SERVER | USAGE | YES
+ regress_test_indirect | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
(4 rows)
SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' AND object_name IN ('s6', 'foo') ORDER BY 1, 2, 3, 4, 5;
- grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
------------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
- foreign_data_user | foreign_data_user | regression | | foo | FOREIGN DATA WRAPPER | USAGE | YES
- foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
- regress_test_indirect | regress_test_indirect | regression | | s6 | FOREIGN SERVER | USAGE | YES
- regress_test_indirect | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
+ grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
+---------------------------+---------------------------+----------------+---------------+-------------+----------------------+----------------+--------------
+ regress_foreign_data_user | regress_foreign_data_user | regression | | foo | FOREIGN DATA WRAPPER | USAGE | YES
+ regress_foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
+ regress_test_indirect | regress_test_indirect | regression | | s6 | FOREIGN SERVER | USAGE | YES
+ regress_test_indirect | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
(4 rows)
SELECT * FROM information_schema.foreign_tables ORDER BY 1, 2, 3;
(5 rows)
SELECT * FROM information_schema.usage_privileges WHERE object_type LIKE 'FOREIGN%' AND object_name IN ('s6', 'foo') ORDER BY 1, 2, 3, 4, 5;
- grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
------------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
- foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
- regress_test_indirect | regress_test_indirect | regression | | s6 | FOREIGN SERVER | USAGE | YES
- regress_test_indirect | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
+ grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
+---------------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
+ regress_foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
+ regress_test_indirect | regress_test_indirect | regression | | s6 | FOREIGN SERVER | USAGE | YES
+ regress_test_indirect | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
(3 rows)
SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' AND object_name IN ('s6', 'foo') ORDER BY 1, 2, 3, 4, 5;
- grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
------------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
- foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
- regress_test_indirect | regress_test_indirect | regression | | s6 | FOREIGN SERVER | USAGE | YES
- regress_test_indirect | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
+ grantor | grantee | object_catalog | object_schema | object_name | object_type | privilege_type | is_grantable
+---------------------------+-----------------------+----------------+---------------+-------------+----------------------+----------------+--------------
+ regress_foreign_data_user | regress_test_indirect | regression | | foo | FOREIGN DATA WRAPPER | USAGE | NO
+ regress_test_indirect | regress_test_indirect | regression | | s6 | FOREIGN SERVER | USAGE | YES
+ regress_test_indirect | regress_test_role2 | regression | | s6 | FOREIGN SERVER | USAGE | YES
(3 rows)
DROP USER MAPPING FOR current_user SERVER t1;
ALTER FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator;
WARNING: changing the foreign-data wrapper validator can cause the options for dependent objects to become invalid
-- Privileges
-SET ROLE unprivileged_role;
+SET ROLE regress_unprivileged_role;
CREATE FOREIGN DATA WRAPPER foobar; -- ERROR
ERROR: permission denied to create foreign-data wrapper "foobar"
HINT: Must be superuser to create a foreign-data wrapper.
ALTER FOREIGN DATA WRAPPER foo OPTIONS (gotcha 'true'); -- ERROR
ERROR: permission denied to alter foreign-data wrapper "foo"
HINT: Must be superuser to alter a foreign-data wrapper.
-ALTER FOREIGN DATA WRAPPER foo OWNER TO unprivileged_role; -- ERROR
+ALTER FOREIGN DATA WRAPPER foo OWNER TO regress_unprivileged_role; -- ERROR
ERROR: permission denied to change owner of foreign-data wrapper "foo"
HINT: Must be superuser to change owner of a foreign-data wrapper.
DROP FOREIGN DATA WRAPPER foo; -- ERROR
ERROR: permission denied for foreign-data wrapper foo
ALTER SERVER s4 VERSION '0.5'; -- ERROR
ERROR: must be owner of foreign server s4
-ALTER SERVER s4 OWNER TO unprivileged_role; -- ERROR
+ALTER SERVER s4 OWNER TO regress_unprivileged_role; -- ERROR
ERROR: must be owner of foreign server s4
DROP SERVER s4; -- ERROR
ERROR: must be owner of foreign server s4
DROP USER MAPPING FOR regress_test_role SERVER s6; -- ERROR
ERROR: must be owner of foreign server s6
RESET ROLE;
-GRANT USAGE ON FOREIGN DATA WRAPPER postgresql TO unprivileged_role;
-GRANT USAGE ON FOREIGN DATA WRAPPER foo TO unprivileged_role WITH GRANT OPTION;
-SET ROLE unprivileged_role;
+GRANT USAGE ON FOREIGN DATA WRAPPER postgresql TO regress_unprivileged_role;
+GRANT USAGE ON FOREIGN DATA WRAPPER foo TO regress_unprivileged_role WITH GRANT OPTION;
+SET ROLE regress_unprivileged_role;
CREATE FOREIGN DATA WRAPPER foobar; -- ERROR
ERROR: permission denied to create foreign-data wrapper "foobar"
HINT: Must be superuser to create a foreign-data wrapper.
DROP USER MAPPING FOR regress_test_role SERVER s6; -- ERROR
ERROR: must be owner of foreign server s6
RESET ROLE;
-REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM unprivileged_role; -- ERROR
+REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM regress_unprivileged_role; -- ERROR
ERROR: dependent privileges exist
HINT: Use CASCADE to revoke them too.
-REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM unprivileged_role CASCADE;
-SET ROLE unprivileged_role;
+REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM regress_unprivileged_role CASCADE;
+SET ROLE regress_unprivileged_role;
GRANT USAGE ON FOREIGN DATA WRAPPER foo TO regress_test_role; -- ERROR
ERROR: permission denied for foreign-data wrapper foo
CREATE SERVER s10 FOREIGN DATA WRAPPER foo; -- ERROR
DROP SERVER s9 CASCADE;
NOTICE: drop cascades to 2 other objects
DETAIL: drop cascades to user mapping for public on server s9
-drop cascades to user mapping for unprivileged_role on server s9
+drop cascades to user mapping for regress_unprivileged_role on server s9
RESET ROLE;
CREATE SERVER s9 FOREIGN DATA WRAPPER foo;
-GRANT USAGE ON FOREIGN SERVER s9 TO unprivileged_role;
-SET ROLE unprivileged_role;
+GRANT USAGE ON FOREIGN SERVER s9 TO regress_unprivileged_role;
+SET ROLE regress_unprivileged_role;
ALTER SERVER s9 VERSION '1.2'; -- ERROR
ERROR: must be owner of foreign server s9
GRANT USAGE ON FOREIGN SERVER s9 TO regress_test_role; -- WARNING
\set VERBOSITY default
DROP SERVER s8 CASCADE;
NOTICE: drop cascades to 2 other objects
-DETAIL: drop cascades to user mapping for foreign_data_user on server s8
+DETAIL: drop cascades to user mapping for regress_foreign_data_user on server s8
drop cascades to user mapping for public on server s8
DROP ROLE regress_test_indirect;
DROP ROLE regress_test_role;
-DROP ROLE unprivileged_role; -- ERROR
-ERROR: role "unprivileged_role" cannot be dropped because some objects depend on it
+DROP ROLE regress_unprivileged_role; -- ERROR
+ERROR: role "regress_unprivileged_role" cannot be dropped because some objects depend on it
DETAIL: privileges for foreign-data wrapper postgresql
-REVOKE ALL ON FOREIGN DATA WRAPPER postgresql FROM unprivileged_role;
-DROP ROLE unprivileged_role;
+REVOKE ALL ON FOREIGN DATA WRAPPER postgresql FROM regress_unprivileged_role;
+DROP ROLE regress_unprivileged_role;
DROP ROLE regress_test_role2;
DROP FOREIGN DATA WRAPPER postgresql CASCADE;
DROP FOREIGN DATA WRAPPER dummy CASCADE;
NOTICE: drop cascades to server s0
\c
-DROP ROLE foreign_data_user;
+DROP ROLE regress_foreign_data_user;
-- At this point we should have no wrappers, no servers, and no mappings.
SELECT fdwname, fdwhandler, fdwvalidator, fdwoptions FROM pg_foreign_data_wrapper;
fdwname | fdwhandler | fdwvalidator | fdwoptions
LISTEN foo_event;
SET vacuum_cost_delay = 13;
CREATE TEMP TABLE tmp_foo (data text) ON COMMIT DELETE ROWS;
-CREATE ROLE temp_reset_user;
-SET SESSION AUTHORIZATION temp_reset_user;
+CREATE ROLE regress_guc_user;
+SET SESSION AUTHORIZATION regress_guc_user;
-- look changes
SELECT pg_listening_channels();
pg_listening_channels
tmp_foo
(1 row)
-SELECT current_user = 'temp_reset_user';
+SELECT current_user = 'regress_guc_user';
?column?
----------
t
---------
(0 rows)
-SELECT current_user = 'temp_reset_user';
+SELECT current_user = 'regress_guc_user';
?column?
----------
f
(1 row)
-DROP ROLE temp_reset_user;
+DROP ROLE regress_guc_user;
--
-- search_path should react to changes in pg_namespace
--
--
-- Clean up in case a prior regression run failed
SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS regtest_addr_user;
-CREATE USER regtest_addr_user;
+DROP ROLE IF EXISTS regress_addr_user;
+RESET client_min_messages;
+CREATE USER regress_addr_user;
-- Test generic object addressing/identification functions
CREATE SCHEMA addr_nsp;
SET search_path TO 'addr_nsp';
CREATE TRIGGER t BEFORE INSERT ON addr_nsp.gentable FOR EACH ROW EXECUTE PROCEDURE addr_nsp.trig();
CREATE POLICY genpol ON addr_nsp.gentable;
CREATE SERVER "integer" FOREIGN DATA WRAPPER addr_fdw;
-CREATE USER MAPPING FOR regtest_addr_user SERVER "integer";
-ALTER DEFAULT PRIVILEGES FOR ROLE regtest_addr_user IN SCHEMA public GRANT ALL ON TABLES TO regtest_addr_user;
-ALTER DEFAULT PRIVILEGES FOR ROLE regtest_addr_user REVOKE DELETE ON TABLES FROM regtest_addr_user;
+CREATE USER MAPPING FOR regress_addr_user SERVER "integer";
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user IN SCHEMA public GRANT ALL ON TABLES TO regress_addr_user;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user REVOKE DELETE ON TABLES FROM regress_addr_user;
CREATE TRANSFORM FOR int LANGUAGE SQL (
FROM SQL WITH FUNCTION varchar_transform(internal),
TO SQL WITH FUNCTION int4recv(internal));
('text search dictionary', '{addr_ts_dict}', '{}'),
('text search template', '{addr_ts_temp}', '{}'),
('text search configuration', '{addr_ts_conf}', '{}'),
- ('role', '{regtest_addr_user}', '{}'),
+ ('role', '{regress_addr_user}', '{}'),
-- database
-- tablespace
('foreign-data wrapper', '{addr_fdw}', '{}'),
('server', '{addr_fserv}', '{}'),
- ('user mapping', '{regtest_addr_user}', '{integer}'),
- ('default acl', '{regtest_addr_user,public}', '{r}'),
- ('default acl', '{regtest_addr_user}', '{r}'),
+ ('user mapping', '{regress_addr_user}', '{integer}'),
+ ('default acl', '{regress_addr_user,public}', '{r}'),
+ ('default acl', '{regress_addr_user}', '{r}'),
-- extension
-- event trigger
('policy', '{addr_nsp, gentable, genpol}', '{}'),
ORDER BY addr1.classid, addr1.objid, addr1.subobjid;
type | schema | name | identity | ?column?
---------------------------+------------+-------------------+----------------------------------------------------------------------+----------
- default acl | | | for role regtest_addr_user in schema public on tables | t
- default acl | | | for role regtest_addr_user on tables | t
+ default acl | | | for role regress_addr_user in schema public on tables | t
+ default acl | | | for role regress_addr_user on tables | t
type | pg_catalog | _int4 | integer[] | t
type | addr_nsp | gencomptype | addr_nsp.gencomptype | t
type | addr_nsp | genenum | addr_nsp.genenum | t
materialized view | addr_nsp | genmatview | addr_nsp.genmatview | t
foreign table | addr_nsp | genftable | addr_nsp.genftable | t
foreign table column | addr_nsp | genftable | addr_nsp.genftable.a | t
- role | | regtest_addr_user | regtest_addr_user | t
+ role | | regress_addr_user | regress_addr_user | t
server | | addr_fserv | addr_fserv | t
- user mapping | | | regtest_addr_user on server integer | t
+ user mapping | | | regress_addr_user on server integer | t
foreign-data wrapper | | addr_fdw | addr_fdw | t
access method | | btree | btree | t
operator of access method | | | operator 1 (integer, integer) of pg_catalog.integer_ops USING btree | t
---
--- Cleanup resources
---
+SET client_min_messages TO 'warning';
DROP FOREIGN DATA WRAPPER addr_fdw CASCADE;
DROP SCHEMA addr_nsp CASCADE;
-DROP OWNED BY regtest_addr_user;
-DROP USER regtest_addr_user;
+DROP OWNED BY regress_addr_user;
+DROP USER regress_addr_user;
-- Clean up in case a prior regression run failed
-- Suppress NOTICE messages when users/groups don't exist
SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS regressgroup1;
-DROP ROLE IF EXISTS regressgroup2;
-DROP ROLE IF EXISTS regressuser1;
-DROP ROLE IF EXISTS regressuser2;
-DROP ROLE IF EXISTS regressuser3;
-DROP ROLE IF EXISTS regressuser4;
-DROP ROLE IF EXISTS regressuser5;
-DROP ROLE IF EXISTS regressuser6;
+DROP ROLE IF EXISTS regress_group1;
+DROP ROLE IF EXISTS regress_group2;
+DROP ROLE IF EXISTS regress_user1;
+DROP ROLE IF EXISTS regress_user2;
+DROP ROLE IF EXISTS regress_user3;
+DROP ROLE IF EXISTS regress_user4;
+DROP ROLE IF EXISTS regress_user5;
+DROP ROLE IF EXISTS regress_user6;
SELECT lo_unlink(oid) FROM pg_largeobject_metadata;
lo_unlink
-----------
RESET client_min_messages;
-- test proper begins here
-CREATE USER regressuser1;
-CREATE USER regressuser2;
-CREATE USER regressuser3;
-CREATE USER regressuser4;
-CREATE USER regressuser5;
-CREATE USER regressuser5; -- duplicate
-ERROR: role "regressuser5" already exists
-CREATE GROUP regressgroup1;
-CREATE GROUP regressgroup2 WITH USER regressuser1, regressuser2;
-ALTER GROUP regressgroup1 ADD USER regressuser4;
-ALTER GROUP regressgroup2 ADD USER regressuser2; -- duplicate
-NOTICE: role "regressuser2" is already a member of role "regressgroup2"
-ALTER GROUP regressgroup2 DROP USER regressuser2;
-GRANT regressgroup2 TO regressuser4 WITH ADMIN OPTION;
+CREATE USER regress_user1;
+CREATE USER regress_user2;
+CREATE USER regress_user3;
+CREATE USER regress_user4;
+CREATE USER regress_user5;
+CREATE USER regress_user5; -- duplicate
+ERROR: role "regress_user5" already exists
+CREATE GROUP regress_group1;
+CREATE GROUP regress_group2 WITH USER regress_user1, regress_user2;
+ALTER GROUP regress_group1 ADD USER regress_user4;
+ALTER GROUP regress_group2 ADD USER regress_user2; -- duplicate
+NOTICE: role "regress_user2" is already a member of role "regress_group2"
+ALTER GROUP regress_group2 DROP USER regress_user2;
+GRANT regress_group2 TO regress_user4 WITH ADMIN OPTION;
-- test owner privileges
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
SELECT session_user, current_user;
- session_user | current_user
---------------+--------------
- regressuser1 | regressuser1
+ session_user | current_user
+---------------+---------------
+ regress_user1 | regress_user1
(1 row)
CREATE TABLE atest1 ( a int, b text );
---+---
(0 rows)
-GRANT ALL ON atest1 TO regressuser2;
-GRANT SELECT ON atest1 TO regressuser3, regressuser4;
+GRANT ALL ON atest1 TO regress_user2;
+GRANT SELECT ON atest1 TO regress_user3, regress_user4;
SELECT * FROM atest1;
a | b
---+---
(0 rows)
CREATE TABLE atest2 (col1 varchar(10), col2 boolean);
-GRANT SELECT ON atest2 TO regressuser2;
-GRANT UPDATE ON atest2 TO regressuser3;
-GRANT INSERT ON atest2 TO regressuser4;
-GRANT TRUNCATE ON atest2 TO regressuser5;
-SET SESSION AUTHORIZATION regressuser2;
+GRANT SELECT ON atest2 TO regress_user2;
+GRANT UPDATE ON atest2 TO regress_user3;
+GRANT INSERT ON atest2 TO regress_user4;
+GRANT TRUNCATE ON atest2 TO regress_user5;
+SET SESSION AUTHORIZATION regress_user2;
SELECT session_user, current_user;
- session_user | current_user
---------------+--------------
- regressuser2 | regressuser2
+ session_user | current_user
+---------------+---------------
+ regress_user2 | regress_user2
(1 row)
-- try various combinations of queries on atest1 and atest2
------+------
(0 rows)
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
SELECT session_user, current_user;
- session_user | current_user
---------------+--------------
- regressuser3 | regressuser3
+ session_user | current_user
+---------------+---------------
+ regress_user3 | regress_user3
(1 row)
SELECT * FROM atest1; -- ok
ERROR: permission denied for relation atest2
SELECT * FROM atest2 WHERE ( col1 IN ( SELECT b FROM atest1 ) );
ERROR: permission denied for relation atest2
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
COPY atest2 FROM stdin; -- ok
SELECT * FROM atest1; -- ok
a | b
(2 rows)
-- groups
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
CREATE TABLE atest3 (one int, two int, three int);
-GRANT DELETE ON atest3 TO GROUP regressgroup2;
-SET SESSION AUTHORIZATION regressuser1;
+GRANT DELETE ON atest3 TO GROUP regress_group2;
+SET SESSION AUTHORIZATION regress_user1;
SELECT * FROM atest3; -- fail
ERROR: permission denied for relation atest3
DELETE FROM atest3; -- ok
-- views
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
CREATE VIEW atestv1 AS SELECT * FROM atest1; -- ok
/* The next *should* fail, but it's not implemented that way yet. */
CREATE VIEW atestv2 AS SELECT * FROM atest2;
SELECT * FROM atestv2; -- fail
ERROR: permission denied for relation atest2
-GRANT SELECT ON atestv1, atestv3 TO regressuser4;
-GRANT SELECT ON atestv2 TO regressuser2;
-SET SESSION AUTHORIZATION regressuser4;
+GRANT SELECT ON atestv1, atestv3 TO regress_user4;
+GRANT SELECT ON atestv2 TO regress_user2;
+SET SESSION AUTHORIZATION regress_user4;
SELECT * FROM atestv1; -- ok
a | b
---+-----
-----+-----+-------
(0 rows)
-GRANT SELECT ON atestv4 TO regressuser2;
-SET SESSION AUTHORIZATION regressuser2;
+GRANT SELECT ON atestv4 TO regress_user2;
+SET SESSION AUTHORIZATION regress_user2;
-- Two complex cases:
SELECT * FROM atestv3; -- fail
ERROR: permission denied for relation atestv3
-SELECT * FROM atestv4; -- ok (even though regressuser2 cannot access underlying atestv3)
+SELECT * FROM atestv4; -- ok (even though regress_user2 cannot access underlying atestv3)
one | two | three
-----+-----+-------
(0 rows)
bar | t
(1 row)
-SELECT * FROM atestv2; -- fail (even though regressuser2 can access underlying atest2)
+SELECT * FROM atestv2; -- fail (even though regress_user2 can access underlying atest2)
ERROR: permission denied for relation atest2
-- Test column level permissions
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
CREATE TABLE atest5 (one int, two int unique, three int, four int unique);
CREATE TABLE atest6 (one int, two int, blue int);
-GRANT SELECT (one), INSERT (two), UPDATE (three) ON atest5 TO regressuser4;
-GRANT ALL (one) ON atest5 TO regressuser3;
+GRANT SELECT (one), INSERT (two), UPDATE (three) ON atest5 TO regress_user4;
+GRANT ALL (one) ON atest5 TO regress_user3;
INSERT INTO atest5 VALUES (1,2,3);
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT * FROM atest5; -- fail
ERROR: permission denied for relation atest5
SELECT one FROM atest5; -- ok
SELECT one, two FROM atest5; -- fail
ERROR: permission denied for relation atest5
-SET SESSION AUTHORIZATION regressuser1;
-GRANT SELECT (one,two) ON atest6 TO regressuser4;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user1;
+GRANT SELECT (one,two) ON atest6 TO regress_user4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT one, two FROM atest5 NATURAL JOIN atest6; -- fail still
ERROR: permission denied for relation atest5
-SET SESSION AUTHORIZATION regressuser1;
-GRANT SELECT (two) ON atest5 TO regressuser4;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user1;
+GRANT SELECT (two) ON atest5 TO regress_user4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT one, two FROM atest5 NATURAL JOIN atest6; -- ok now
one | two
-----+-----
-- Error. No privs on four
INSERT INTO atest5(three) VALUES (4) ON CONFLICT (four) DO UPDATE set three = 10;
ERROR: permission denied for relation atest5
-SET SESSION AUTHORIZATION regressuser1;
-REVOKE ALL (one) ON atest5 FROM regressuser4;
-GRANT SELECT (one,two,blue) ON atest6 TO regressuser4;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user1;
+REVOKE ALL (one) ON atest5 FROM regress_user4;
+GRANT SELECT (one,two,blue) ON atest6 TO regress_user4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT one FROM atest5; -- fail
ERROR: permission denied for relation atest5
UPDATE atest5 SET one = 1; -- fail
COPY atest6 TO stdout; -- ok
-- check error reporting with column privs
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
CREATE TABLE t1 (c1 int, c2 int, c3 int check (c3 < 5), primary key (c1, c2));
-GRANT SELECT (c1) ON t1 TO regressuser2;
-GRANT INSERT (c1, c2, c3) ON t1 TO regressuser2;
-GRANT UPDATE (c1, c2, c3) ON t1 TO regressuser2;
+GRANT SELECT (c1) ON t1 TO regress_user2;
+GRANT INSERT (c1, c2, c3) ON t1 TO regress_user2;
+GRANT UPDATE (c1, c2, c3) ON t1 TO regress_user2;
-- seed data
INSERT INTO t1 VALUES (1, 1, 1);
INSERT INTO t1 VALUES (1, 2, 1);
INSERT INTO t1 VALUES (2, 1, 2);
INSERT INTO t1 VALUES (2, 2, 2);
INSERT INTO t1 VALUES (3, 1, 3);
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
INSERT INTO t1 (c1, c2) VALUES (1, 1); -- fail, but row not shown
ERROR: duplicate key value violates unique constraint "t1_pkey"
UPDATE t1 SET c2 = 1; -- fail, but row not shown
UPDATE t1 SET c3 = 10; -- fail, but see columns with SELECT rights, or being modified
ERROR: new row for relation "t1" violates check constraint "t1_c3_check"
DETAIL: Failing row contains (c1, c3) = (1, 10).
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
DROP TABLE t1;
-- test column-level privileges when involved with DELETE
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
ALTER TABLE atest6 ADD COLUMN three integer;
-GRANT DELETE ON atest5 TO regressuser3;
-GRANT SELECT (two) ON atest5 TO regressuser3;
-REVOKE ALL (one) ON atest5 FROM regressuser3;
-GRANT SELECT (one) ON atest5 TO regressuser4;
-SET SESSION AUTHORIZATION regressuser4;
+GRANT DELETE ON atest5 TO regress_user3;
+GRANT SELECT (two) ON atest5 TO regress_user3;
+REVOKE ALL (one) ON atest5 FROM regress_user3;
+GRANT SELECT (one) ON atest5 TO regress_user4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT atest6 FROM atest6; -- fail
ERROR: permission denied for relation atest6
SELECT one FROM atest5 NATURAL JOIN atest6; -- fail
ERROR: permission denied for relation atest5
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
ALTER TABLE atest6 DROP COLUMN three;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT atest6 FROM atest6; -- ok
atest6
--------
-----
(0 rows)
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
ALTER TABLE atest6 DROP COLUMN two;
-REVOKE SELECT (one,blue) ON atest6 FROM regressuser4;
-SET SESSION AUTHORIZATION regressuser4;
+REVOKE SELECT (one,blue) ON atest6 FROM regress_user4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT * FROM atest6; -- fail
ERROR: permission denied for relation atest6
SELECT 1 FROM atest6; -- fail
ERROR: permission denied for relation atest6
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
DELETE FROM atest5 WHERE one = 1; -- fail
ERROR: permission denied for relation atest5
DELETE FROM atest5 WHERE two = 2; -- ok
-- check inheritance cases
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
CREATE TABLE atestp1 (f1 int, f2 int) WITH OIDS;
CREATE TABLE atestp2 (fx int, fy int) WITH OIDS;
CREATE TABLE atestc (fz int) INHERITS (atestp1, atestp2);
-GRANT SELECT(fx,fy,oid) ON atestp2 TO regressuser2;
-GRANT SELECT(fx) ON atestc TO regressuser2;
-SET SESSION AUTHORIZATION regressuser2;
+GRANT SELECT(fx,fy,oid) ON atestp2 TO regress_user2;
+GRANT SELECT(fx) ON atestc TO regress_user2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT fx FROM atestp2; -- ok
fx
----
SELECT fy FROM atestc; -- fail
ERROR: permission denied for relation atestc
-SET SESSION AUTHORIZATION regressuser1;
-GRANT SELECT(fy,oid) ON atestc TO regressuser2;
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user1;
+GRANT SELECT(fy,oid) ON atestc TO regress_user2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT fx FROM atestp2; -- still ok
fx
----
-- switch to superuser
\c -
REVOKE ALL PRIVILEGES ON LANGUAGE sql FROM PUBLIC;
-GRANT USAGE ON LANGUAGE sql TO regressuser1; -- ok
+GRANT USAGE ON LANGUAGE sql TO regress_user1; -- ok
GRANT USAGE ON LANGUAGE c TO PUBLIC; -- fail
ERROR: language "c" is not trusted
DETAIL: GRANT and REVOKE are not allowed on untrusted languages, because only superusers can use untrusted languages.
-SET SESSION AUTHORIZATION regressuser1;
-GRANT USAGE ON LANGUAGE sql TO regressuser2; -- fail
+SET SESSION AUTHORIZATION regress_user1;
+GRANT USAGE ON LANGUAGE sql TO regress_user2; -- fail
WARNING: no privileges were granted for "sql"
CREATE FUNCTION testfunc1(int) RETURNS int AS 'select 2 * $1;' LANGUAGE sql;
CREATE FUNCTION testfunc2(int) RETURNS int AS 'select 3 * $1;' LANGUAGE sql;
REVOKE ALL ON FUNCTION testfunc1(int), testfunc2(int) FROM PUBLIC;
-GRANT EXECUTE ON FUNCTION testfunc1(int), testfunc2(int) TO regressuser2;
-GRANT USAGE ON FUNCTION testfunc1(int) TO regressuser3; -- semantic error
+GRANT EXECUTE ON FUNCTION testfunc1(int), testfunc2(int) TO regress_user2;
+GRANT USAGE ON FUNCTION testfunc1(int) TO regress_user3; -- semantic error
ERROR: invalid privilege type USAGE for function
-GRANT ALL PRIVILEGES ON FUNCTION testfunc1(int) TO regressuser4;
-GRANT ALL PRIVILEGES ON FUNCTION testfunc_nosuch(int) TO regressuser4;
+GRANT ALL PRIVILEGES ON FUNCTION testfunc1(int) TO regress_user4;
+GRANT ALL PRIVILEGES ON FUNCTION testfunc_nosuch(int) TO regress_user4;
ERROR: function testfunc_nosuch(integer) does not exist
CREATE FUNCTION testfunc4(boolean) RETURNS text
AS 'select col1 from atest2 where col2 = $1;'
LANGUAGE sql SECURITY DEFINER;
-GRANT EXECUTE ON FUNCTION testfunc4(boolean) TO regressuser3;
-SET SESSION AUTHORIZATION regressuser2;
+GRANT EXECUTE ON FUNCTION testfunc4(boolean) TO regress_user3;
+SET SESSION AUTHORIZATION regress_user2;
SELECT testfunc1(5), testfunc2(5); -- ok
testfunc1 | testfunc2
-----------+-----------
CREATE FUNCTION testfunc3(int) RETURNS int AS 'select 2 * $1;' LANGUAGE sql; -- fail
ERROR: permission denied for language sql
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
SELECT testfunc1(5); -- fail
ERROR: permission denied for function testfunc1
SELECT col1 FROM atest2 WHERE col2 = true; -- fail
bar
(1 row)
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT testfunc1(5); -- ok
testfunc1
-----------
\c -
CREATE TYPE testtype1 AS (a int, b text);
REVOKE USAGE ON TYPE testtype1 FROM PUBLIC;
-GRANT USAGE ON TYPE testtype1 TO regressuser2;
-GRANT USAGE ON TYPE _testtype1 TO regressuser2; -- fail
+GRANT USAGE ON TYPE testtype1 TO regress_user2;
+GRANT USAGE ON TYPE _testtype1 TO regress_user2; -- fail
ERROR: cannot set privileges of array types
HINT: Set the privileges of the element type instead.
-GRANT USAGE ON DOMAIN testtype1 TO regressuser2; -- fail
+GRANT USAGE ON DOMAIN testtype1 TO regress_user2; -- fail
ERROR: "testtype1" is not a domain
CREATE DOMAIN testdomain1 AS int;
REVOKE USAGE on DOMAIN testdomain1 FROM PUBLIC;
-GRANT USAGE ON DOMAIN testdomain1 TO regressuser2;
-GRANT USAGE ON TYPE testdomain1 TO regressuser2; -- ok
-SET SESSION AUTHORIZATION regressuser1;
+GRANT USAGE ON DOMAIN testdomain1 TO regress_user2;
+GRANT USAGE ON TYPE testdomain1 TO regress_user2; -- ok
+SET SESSION AUTHORIZATION regress_user1;
-- commands that should fail
CREATE AGGREGATE testagg1a(testdomain1) (sfunc = int4_sum, stype = bigint);
ERROR: permission denied for type testdomain1
ERROR: permission denied for type testdomain1
REVOKE ALL ON TYPE testtype1 FROM PUBLIC;
ERROR: permission denied for type testtype1
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
-- commands that should succeed
CREATE AGGREGATE testagg1b(testdomain1) (sfunc = int4_sum, stype = bigint);
CREATE DOMAIN testdomain2b AS testdomain1;
DROP TYPE testtype1; -- ok
DROP DOMAIN testdomain1; -- ok
-- truncate
-SET SESSION AUTHORIZATION regressuser5;
+SET SESSION AUTHORIZATION regress_user5;
TRUNCATE atest2; -- ok
TRUNCATE atest3; -- fail
ERROR: permission denied for relation atest3
(1 row)
-- non-superuser
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
select has_table_privilege(current_user,'pg_class','select');
has_table_privilege
---------------------
(1 row)
-- Grant options
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
CREATE TABLE atest4 (a int);
-GRANT SELECT ON atest4 TO regressuser2 WITH GRANT OPTION;
-GRANT UPDATE ON atest4 TO regressuser2;
-GRANT SELECT ON atest4 TO GROUP regressgroup1 WITH GRANT OPTION;
-SET SESSION AUTHORIZATION regressuser2;
-GRANT SELECT ON atest4 TO regressuser3;
-GRANT UPDATE ON atest4 TO regressuser3; -- fail
+GRANT SELECT ON atest4 TO regress_user2 WITH GRANT OPTION;
+GRANT UPDATE ON atest4 TO regress_user2;
+GRANT SELECT ON atest4 TO GROUP regress_group1 WITH GRANT OPTION;
+SET SESSION AUTHORIZATION regress_user2;
+GRANT SELECT ON atest4 TO regress_user3;
+GRANT UPDATE ON atest4 TO regress_user3; -- fail
WARNING: no privileges were granted for "atest4"
-SET SESSION AUTHORIZATION regressuser1;
-REVOKE SELECT ON atest4 FROM regressuser3; -- does nothing
-SELECT has_table_privilege('regressuser3', 'atest4', 'SELECT'); -- true
+SET SESSION AUTHORIZATION regress_user1;
+REVOKE SELECT ON atest4 FROM regress_user3; -- does nothing
+SELECT has_table_privilege('regress_user3', 'atest4', 'SELECT'); -- true
has_table_privilege
---------------------
t
(1 row)
-REVOKE SELECT ON atest4 FROM regressuser2; -- fail
+REVOKE SELECT ON atest4 FROM regress_user2; -- fail
ERROR: dependent privileges exist
HINT: Use CASCADE to revoke them too.
-REVOKE GRANT OPTION FOR SELECT ON atest4 FROM regressuser2 CASCADE; -- ok
-SELECT has_table_privilege('regressuser2', 'atest4', 'SELECT'); -- true
+REVOKE GRANT OPTION FOR SELECT ON atest4 FROM regress_user2 CASCADE; -- ok
+SELECT has_table_privilege('regress_user2', 'atest4', 'SELECT'); -- true
has_table_privilege
---------------------
t
(1 row)
-SELECT has_table_privilege('regressuser3', 'atest4', 'SELECT'); -- false
+SELECT has_table_privilege('regress_user3', 'atest4', 'SELECT'); -- false
has_table_privilege
---------------------
f
(1 row)
-SELECT has_table_privilege('regressuser1', 'atest4', 'SELECT WITH GRANT OPTION'); -- true
+SELECT has_table_privilege('regress_user1', 'atest4', 'SELECT WITH GRANT OPTION'); -- true
has_table_privilege
---------------------
t
(1 row)
-- Admin options
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
CREATE FUNCTION dogrant_ok() RETURNS void LANGUAGE sql SECURITY DEFINER AS
- 'GRANT regressgroup2 TO regressuser5';
-GRANT regressgroup2 TO regressuser5; -- ok: had ADMIN OPTION
-SET ROLE regressgroup2;
-GRANT regressgroup2 TO regressuser5; -- fails: SET ROLE suspended privilege
-ERROR: must have admin option on role "regressgroup2"
-SET SESSION AUTHORIZATION regressuser1;
-GRANT regressgroup2 TO regressuser5; -- fails: no ADMIN OPTION
-ERROR: must have admin option on role "regressgroup2"
+ 'GRANT regress_group2 TO regress_user5';
+GRANT regress_group2 TO regress_user5; -- ok: had ADMIN OPTION
+SET ROLE regress_group2;
+GRANT regress_group2 TO regress_user5; -- fails: SET ROLE suspended privilege
+ERROR: must have admin option on role "regress_group2"
+SET SESSION AUTHORIZATION regress_user1;
+GRANT regress_group2 TO regress_user5; -- fails: no ADMIN OPTION
+ERROR: must have admin option on role "regress_group2"
SELECT dogrant_ok(); -- ok: SECURITY DEFINER conveys ADMIN
-NOTICE: role "regressuser5" is already a member of role "regressgroup2"
+NOTICE: role "regress_user5" is already a member of role "regress_group2"
dogrant_ok
------------
(1 row)
-SET ROLE regressgroup2;
-GRANT regressgroup2 TO regressuser5; -- fails: SET ROLE did not help
-ERROR: must have admin option on role "regressgroup2"
-SET SESSION AUTHORIZATION regressgroup2;
-GRANT regressgroup2 TO regressuser5; -- ok: a role can self-admin
-NOTICE: role "regressuser5" is already a member of role "regressgroup2"
+SET ROLE regress_group2;
+GRANT regress_group2 TO regress_user5; -- fails: SET ROLE did not help
+ERROR: must have admin option on role "regress_group2"
+SET SESSION AUTHORIZATION regress_group2;
+GRANT regress_group2 TO regress_user5; -- ok: a role can self-admin
+NOTICE: role "regress_user5" is already a member of role "regress_group2"
CREATE FUNCTION dogrant_fails() RETURNS void LANGUAGE sql SECURITY DEFINER AS
- 'GRANT regressgroup2 TO regressuser5';
+ 'GRANT regress_group2 TO regress_user5';
SELECT dogrant_fails(); -- fails: no self-admin in SECURITY DEFINER
-ERROR: must have admin option on role "regressgroup2"
+ERROR: must have admin option on role "regress_group2"
CONTEXT: SQL function "dogrant_fails" statement 1
DROP FUNCTION dogrant_fails();
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
DROP FUNCTION dogrant_ok();
-REVOKE regressgroup2 FROM regressuser5;
+REVOKE regress_group2 FROM regress_user5;
-- has_sequence_privilege tests
\c -
CREATE SEQUENCE x_seq;
-GRANT USAGE on x_seq to regressuser2;
-SELECT has_sequence_privilege('regressuser1', 'atest1', 'SELECT');
+GRANT USAGE on x_seq to regress_user2;
+SELECT has_sequence_privilege('regress_user1', 'atest1', 'SELECT');
ERROR: "atest1" is not a sequence
-SELECT has_sequence_privilege('regressuser1', 'x_seq', 'INSERT');
+SELECT has_sequence_privilege('regress_user1', 'x_seq', 'INSERT');
ERROR: unrecognized privilege type: "INSERT"
-SELECT has_sequence_privilege('regressuser1', 'x_seq', 'SELECT');
+SELECT has_sequence_privilege('regress_user1', 'x_seq', 'SELECT');
has_sequence_privilege
------------------------
f
(1 row)
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT has_sequence_privilege('x_seq', 'USAGE');
has_sequence_privilege
------------------------
-- largeobject privilege tests
\c -
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
SELECT lo_create(1001);
lo_create
-----------
(1 row)
GRANT ALL ON LARGE OBJECT 1001 TO PUBLIC;
-GRANT SELECT ON LARGE OBJECT 1003 TO regressuser2;
-GRANT SELECT,UPDATE ON LARGE OBJECT 1004 TO regressuser2;
-GRANT ALL ON LARGE OBJECT 1005 TO regressuser2;
-GRANT SELECT ON LARGE OBJECT 1005 TO regressuser2 WITH GRANT OPTION;
+GRANT SELECT ON LARGE OBJECT 1003 TO regress_user2;
+GRANT SELECT,UPDATE ON LARGE OBJECT 1004 TO regress_user2;
+GRANT ALL ON LARGE OBJECT 1005 TO regress_user2;
+GRANT SELECT ON LARGE OBJECT 1005 TO regress_user2 WITH GRANT OPTION;
GRANT SELECT, INSERT ON LARGE OBJECT 1001 TO PUBLIC; -- to be failed
ERROR: invalid privilege type INSERT for large object
GRANT SELECT, UPDATE ON LARGE OBJECT 1001 TO nosuchuser; -- to be failed
GRANT SELECT, UPDATE ON LARGE OBJECT 999 TO PUBLIC; -- to be failed
ERROR: large object 999 does not exist
\c -
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT lo_create(2001);
lo_create
-----------
4
(1 row)
-GRANT SELECT ON LARGE OBJECT 1005 TO regressuser3;
-GRANT UPDATE ON LARGE OBJECT 1006 TO regressuser3; -- to be denied
+GRANT SELECT ON LARGE OBJECT 1005 TO regress_user3;
+GRANT UPDATE ON LARGE OBJECT 1006 TO regress_user3; -- to be denied
ERROR: large object 1006 does not exist
REVOKE ALL ON LARGE OBJECT 2001, 2002 FROM PUBLIC;
-GRANT ALL ON LARGE OBJECT 2001 TO regressuser3;
+GRANT ALL ON LARGE OBJECT 2001 TO regress_user3;
SELECT lo_unlink(1001); -- to be denied
ERROR: must be owner of large object 1001
SELECT lo_unlink(2002);
\c -
-- confirm ACL setting
SELECT oid, pg_get_userbyid(lomowner) ownername, lomacl FROM pg_largeobject_metadata;
- oid | ownername | lomacl
-------+--------------+------------------------------------------------------------------------------------------
- 1002 | regressuser1 |
- 1001 | regressuser1 | {regressuser1=rw/regressuser1,=rw/regressuser1}
- 1003 | regressuser1 | {regressuser1=rw/regressuser1,regressuser2=r/regressuser1}
- 1004 | regressuser1 | {regressuser1=rw/regressuser1,regressuser2=rw/regressuser1}
- 1005 | regressuser1 | {regressuser1=rw/regressuser1,regressuser2=r*w/regressuser1,regressuser3=r/regressuser2}
- 2001 | regressuser2 | {regressuser2=rw/regressuser2,regressuser3=rw/regressuser2}
+ oid | ownername | lomacl
+------+---------------+------------------------------------------------------------------------------------------------
+ 1002 | regress_user1 |
+ 1001 | regress_user1 | {regress_user1=rw/regress_user1,=rw/regress_user1}
+ 1003 | regress_user1 | {regress_user1=rw/regress_user1,regress_user2=r/regress_user1}
+ 1004 | regress_user1 | {regress_user1=rw/regress_user1,regress_user2=rw/regress_user1}
+ 1005 | regress_user1 | {regress_user1=rw/regress_user1,regress_user2=r*w/regress_user1,regress_user3=r/regress_user2}
+ 2001 | regress_user2 | {regress_user2=rw/regress_user2,regress_user3=rw/regress_user2}
(6 rows)
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
SELECT loread(lo_open(1001, x'40000'::int), 32);
loread
------------
-- compatibility mode in largeobject permission
\c -
SET lo_compat_privileges = false; -- default setting
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT loread(lo_open(1002, x'40000'::int), 32); -- to be denied
ERROR: permission denied for large object 1002
SELECT lowrite(lo_open(1002, x'20000'::int), 'abcd'); -- to be denied
HINT: Anyone can use the client-side lo_export() provided by libpq.
\c -
SET lo_compat_privileges = true; -- compatibility mode
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT loread(lo_open(1002, x'40000'::int), 32);
loread
--------
------+--------+------
(0 rows)
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
SELECT * FROM pg_largeobject LIMIT 0; -- to be denied
ERROR: permission denied for relation pg_largeobject
-- test default ACLs
\c -
CREATE SCHEMA testns;
-GRANT ALL ON SCHEMA testns TO regressuser1;
+GRANT ALL ON SCHEMA testns TO regress_user1;
CREATE TABLE testns.acltest1 (x int);
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- no
has_table_privilege
---------------------
f
(1 row)
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- no
has_table_privilege
---------------------
f
(1 row)
ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT SELECT ON TABLES TO public;
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- no
has_table_privilege
---------------------
f
(1 row)
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- no
has_table_privilege
---------------------
f
DROP TABLE testns.acltest1;
CREATE TABLE testns.acltest1 (x int);
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- yes
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- yes
has_table_privilege
---------------------
t
(1 row)
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- no
has_table_privilege
---------------------
f
(1 row)
-ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT INSERT ON TABLES TO regressuser1;
+ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT INSERT ON TABLES TO regress_user1;
DROP TABLE testns.acltest1;
CREATE TABLE testns.acltest1 (x int);
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- yes
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- yes
has_table_privilege
---------------------
t
(1 row)
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- yes
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- yes
has_table_privilege
---------------------
t
(1 row)
-ALTER DEFAULT PRIVILEGES IN SCHEMA testns REVOKE INSERT ON TABLES FROM regressuser1;
+ALTER DEFAULT PRIVILEGES IN SCHEMA testns REVOKE INSERT ON TABLES FROM regress_user1;
DROP TABLE testns.acltest1;
CREATE TABLE testns.acltest1 (x int);
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- yes
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- yes
has_table_privilege
---------------------
t
(1 row)
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- no
has_table_privilege
---------------------
f
(1 row)
-ALTER DEFAULT PRIVILEGES FOR ROLE regressuser1 REVOKE EXECUTE ON FUNCTIONS FROM public;
-SET ROLE regressuser1;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_user1 REVOKE EXECUTE ON FUNCTIONS FROM public;
+SET ROLE regress_user1;
CREATE FUNCTION testns.foo() RETURNS int AS 'select 1' LANGUAGE sql;
-SELECT has_function_privilege('regressuser2', 'testns.foo()', 'EXECUTE'); -- no
+SELECT has_function_privilege('regress_user2', 'testns.foo()', 'EXECUTE'); -- no
has_function_privilege
------------------------
f
ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT EXECUTE ON FUNCTIONS to public;
DROP FUNCTION testns.foo();
CREATE FUNCTION testns.foo() RETURNS int AS 'select 1' LANGUAGE sql;
-SELECT has_function_privilege('regressuser2', 'testns.foo()', 'EXECUTE'); -- yes
+SELECT has_function_privilege('regress_user2', 'testns.foo()', 'EXECUTE'); -- yes
has_function_privilege
------------------------
t
(1 row)
DROP FUNCTION testns.foo();
-ALTER DEFAULT PRIVILEGES FOR ROLE regressuser1 REVOKE USAGE ON TYPES FROM public;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_user1 REVOKE USAGE ON TYPES FROM public;
CREATE DOMAIN testns.testdomain1 AS int;
-SELECT has_type_privilege('regressuser2', 'testns.testdomain1', 'USAGE'); -- no
+SELECT has_type_privilege('regress_user2', 'testns.testdomain1', 'USAGE'); -- no
has_type_privilege
--------------------
f
ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT USAGE ON TYPES to public;
DROP DOMAIN testns.testdomain1;
CREATE DOMAIN testns.testdomain1 AS int;
-SELECT has_type_privilege('regressuser2', 'testns.testdomain1', 'USAGE'); -- yes
+SELECT has_type_privilege('regress_user2', 'testns.testdomain1', 'USAGE'); -- yes
has_type_privilege
--------------------
t
CREATE SCHEMA testns;
CREATE TABLE testns.t1 (f1 int);
CREATE TABLE testns.t2 (f1 int);
-SELECT has_table_privilege('regressuser1', 'testns.t1', 'SELECT'); -- false
+SELECT has_table_privilege('regress_user1', 'testns.t1', 'SELECT'); -- false
has_table_privilege
---------------------
f
(1 row)
-GRANT ALL ON ALL TABLES IN SCHEMA testns TO regressuser1;
-SELECT has_table_privilege('regressuser1', 'testns.t1', 'SELECT'); -- true
+GRANT ALL ON ALL TABLES IN SCHEMA testns TO regress_user1;
+SELECT has_table_privilege('regress_user1', 'testns.t1', 'SELECT'); -- true
has_table_privilege
---------------------
t
(1 row)
-SELECT has_table_privilege('regressuser1', 'testns.t2', 'SELECT'); -- true
+SELECT has_table_privilege('regress_user1', 'testns.t2', 'SELECT'); -- true
has_table_privilege
---------------------
t
(1 row)
-REVOKE ALL ON ALL TABLES IN SCHEMA testns FROM regressuser1;
-SELECT has_table_privilege('regressuser1', 'testns.t1', 'SELECT'); -- false
+REVOKE ALL ON ALL TABLES IN SCHEMA testns FROM regress_user1;
+SELECT has_table_privilege('regress_user1', 'testns.t1', 'SELECT'); -- false
has_table_privilege
---------------------
f
(1 row)
-SELECT has_table_privilege('regressuser1', 'testns.t2', 'SELECT'); -- false
+SELECT has_table_privilege('regress_user1', 'testns.t2', 'SELECT'); -- false
has_table_privilege
---------------------
f
(1 row)
CREATE FUNCTION testns.testfunc(int) RETURNS int AS 'select 3 * $1;' LANGUAGE sql;
-SELECT has_function_privilege('regressuser1', 'testns.testfunc(int)', 'EXECUTE'); -- true by default
+SELECT has_function_privilege('regress_user1', 'testns.testfunc(int)', 'EXECUTE'); -- true by default
has_function_privilege
------------------------
t
(1 row)
REVOKE ALL ON ALL FUNCTIONS IN SCHEMA testns FROM PUBLIC;
-SELECT has_function_privilege('regressuser1', 'testns.testfunc(int)', 'EXECUTE'); -- false
+SELECT has_function_privilege('regress_user1', 'testns.testfunc(int)', 'EXECUTE'); -- false
has_function_privilege
------------------------
f
RESET client_min_messages;
-- Change owner of the schema & and rename of new schema owner
\c -
-CREATE ROLE schemauser1 superuser login;
-CREATE ROLE schemauser2 superuser login;
-SET SESSION ROLE schemauser1;
+CREATE ROLE regress_schemauser1 superuser login;
+CREATE ROLE regress_schemauser2 superuser login;
+SET SESSION ROLE regress_schemauser1;
CREATE SCHEMA testns;
SELECT nspname, rolname FROM pg_namespace, pg_roles WHERE pg_namespace.nspname = 'testns' AND pg_namespace.nspowner = pg_roles.oid;
- nspname | rolname
----------+-------------
- testns | schemauser1
+ nspname | rolname
+---------+---------------------
+ testns | regress_schemauser1
(1 row)
-ALTER SCHEMA testns OWNER TO schemauser2;
-ALTER ROLE schemauser2 RENAME TO schemauser_renamed;
+ALTER SCHEMA testns OWNER TO regress_schemauser2;
+ALTER ROLE regress_schemauser2 RENAME TO regress_schemauser_renamed;
SELECT nspname, rolname FROM pg_namespace, pg_roles WHERE pg_namespace.nspname = 'testns' AND pg_namespace.nspowner = pg_roles.oid;
- nspname | rolname
----------+--------------------
- testns | schemauser_renamed
+ nspname | rolname
+---------+----------------------------
+ testns | regress_schemauser_renamed
(1 row)
-set session role schemauser_renamed;
+set session role regress_schemauser_renamed;
SET client_min_messages TO 'warning';
DROP SCHEMA testns CASCADE;
RESET client_min_messages;
-- clean up
\c -
-DROP ROLE schemauser1;
-DROP ROLE schemauser_renamed;
+DROP ROLE regress_schemauser1;
+DROP ROLE regress_schemauser_renamed;
-- test that dependent privileges are revoked (or not) properly
\c -
-set session role regressuser1;
+set session role regress_user1;
create table dep_priv_test (a int);
-grant select on dep_priv_test to regressuser2 with grant option;
-grant select on dep_priv_test to regressuser3 with grant option;
-set session role regressuser2;
-grant select on dep_priv_test to regressuser4 with grant option;
-set session role regressuser3;
-grant select on dep_priv_test to regressuser4 with grant option;
-set session role regressuser4;
-grant select on dep_priv_test to regressuser5;
+grant select on dep_priv_test to regress_user2 with grant option;
+grant select on dep_priv_test to regress_user3 with grant option;
+set session role regress_user2;
+grant select on dep_priv_test to regress_user4 with grant option;
+set session role regress_user3;
+grant select on dep_priv_test to regress_user4 with grant option;
+set session role regress_user4;
+grant select on dep_priv_test to regress_user5;
\dp dep_priv_test
- Access privileges
- Schema | Name | Type | Access privileges | Column privileges | Policies
---------+---------------+-------+-----------------------------------+-------------------+----------
- public | dep_priv_test | table | regressuser1=arwdDxt/regressuser1+| |
- | | | regressuser2=r*/regressuser1 +| |
- | | | regressuser3=r*/regressuser1 +| |
- | | | regressuser4=r*/regressuser2 +| |
- | | | regressuser4=r*/regressuser3 +| |
- | | | regressuser5=r/regressuser4 | |
-(1 row)
-
-set session role regressuser2;
-revoke select on dep_priv_test from regressuser4 cascade;
+ Access privileges
+ Schema | Name | Type | Access privileges | Column privileges | Policies
+--------+---------------+-------+-------------------------------------+-------------------+----------
+ public | dep_priv_test | table | regress_user1=arwdDxt/regress_user1+| |
+ | | | regress_user2=r*/regress_user1 +| |
+ | | | regress_user3=r*/regress_user1 +| |
+ | | | regress_user4=r*/regress_user2 +| |
+ | | | regress_user4=r*/regress_user3 +| |
+ | | | regress_user5=r/regress_user4 | |
+(1 row)
+
+set session role regress_user2;
+revoke select on dep_priv_test from regress_user4 cascade;
\dp dep_priv_test
- Access privileges
- Schema | Name | Type | Access privileges | Column privileges | Policies
---------+---------------+-------+-----------------------------------+-------------------+----------
- public | dep_priv_test | table | regressuser1=arwdDxt/regressuser1+| |
- | | | regressuser2=r*/regressuser1 +| |
- | | | regressuser3=r*/regressuser1 +| |
- | | | regressuser4=r*/regressuser3 +| |
- | | | regressuser5=r/regressuser4 | |
-(1 row)
-
-set session role regressuser3;
-revoke select on dep_priv_test from regressuser4 cascade;
+ Access privileges
+ Schema | Name | Type | Access privileges | Column privileges | Policies
+--------+---------------+-------+-------------------------------------+-------------------+----------
+ public | dep_priv_test | table | regress_user1=arwdDxt/regress_user1+| |
+ | | | regress_user2=r*/regress_user1 +| |
+ | | | regress_user3=r*/regress_user1 +| |
+ | | | regress_user4=r*/regress_user3 +| |
+ | | | regress_user5=r/regress_user4 | |
+(1 row)
+
+set session role regress_user3;
+revoke select on dep_priv_test from regress_user4 cascade;
\dp dep_priv_test
- Access privileges
- Schema | Name | Type | Access privileges | Column privileges | Policies
---------+---------------+-------+-----------------------------------+-------------------+----------
- public | dep_priv_test | table | regressuser1=arwdDxt/regressuser1+| |
- | | | regressuser2=r*/regressuser1 +| |
- | | | regressuser3=r*/regressuser1 | |
+ Access privileges
+ Schema | Name | Type | Access privileges | Column privileges | Policies
+--------+---------------+-------+-------------------------------------+-------------------+----------
+ public | dep_priv_test | table | regress_user1=arwdDxt/regress_user1+| |
+ | | | regress_user2=r*/regress_user1 +| |
+ | | | regress_user3=r*/regress_user1 | |
(1 row)
-set session role regressuser1;
+set session role regress_user1;
drop table dep_priv_test;
-- clean up
\c
1
(5 rows)
-DROP GROUP regressgroup1;
-DROP GROUP regressgroup2;
+DROP GROUP regress_group1;
+DROP GROUP regress_group2;
-- these are needed to clean up permissions
-REVOKE USAGE ON LANGUAGE sql FROM regressuser1;
-DROP OWNED BY regressuser1;
-DROP USER regressuser1;
-DROP USER regressuser2;
-DROP USER regressuser3;
-DROP USER regressuser4;
-DROP USER regressuser5;
-DROP USER regressuser6;
-ERROR: role "regressuser6" does not exist
+REVOKE USAGE ON LANGUAGE sql FROM regress_user1;
+DROP OWNED BY regress_user1;
+DROP USER regress_user1;
+DROP USER regress_user2;
+DROP USER regress_user3;
+DROP USER regress_user4;
+DROP USER regress_user5;
+DROP USER regress_user6;
+ERROR: role "regress_user6" does not exist
-- permissions with LOCK TABLE
-CREATE USER locktable_user;
+CREATE USER regress_locktable_user;
CREATE TABLE lock_table (a int);
-- LOCK TABLE and SELECT permission
-GRANT SELECT ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT SELECT ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should fail
ERROR: permission denied for relation lock_table
ERROR: permission denied for relation lock_table
ROLLBACK;
\c
-REVOKE SELECT ON lock_table FROM locktable_user;
+REVOKE SELECT ON lock_table FROM regress_locktable_user;
-- LOCK TABLE and INSERT permission
-GRANT INSERT ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT INSERT ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
COMMIT;
ERROR: permission denied for relation lock_table
ROLLBACK;
\c
-REVOKE INSERT ON lock_table FROM locktable_user;
+REVOKE INSERT ON lock_table FROM regress_locktable_user;
-- LOCK TABLE and UPDATE permission
-GRANT UPDATE ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT UPDATE ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
COMMIT;
LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
COMMIT;
\c
-REVOKE UPDATE ON lock_table FROM locktable_user;
+REVOKE UPDATE ON lock_table FROM regress_locktable_user;
-- LOCK TABLE and DELETE permission
-GRANT DELETE ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT DELETE ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
COMMIT;
LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
COMMIT;
\c
-REVOKE DELETE ON lock_table FROM locktable_user;
+REVOKE DELETE ON lock_table FROM regress_locktable_user;
-- LOCK TABLE and TRUNCATE permission
-GRANT TRUNCATE ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT TRUNCATE ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
COMMIT;
LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
COMMIT;
\c
-REVOKE TRUNCATE ON lock_table FROM locktable_user;
+REVOKE TRUNCATE ON lock_table FROM regress_locktable_user;
-- clean up
DROP TABLE lock_table;
-DROP USER locktable_user;
+DROP USER regress_locktable_user;
-- regproc
--
/* If objects exist, return oids */
-CREATE ROLE regtestrole;
+CREATE ROLE regress_regrole_test;
-- without schemaname
SELECT regoper('||/');
regoper
(1 row)
-- schemaname not applicable
-SELECT regrole('regtestrole');
- regrole
--------------
- regtestrole
+SELECT regrole('regress_regrole_test');
+ regrole
+----------------------
+ regress_regrole_test
(1 row)
-SELECT regrole('"regtestrole"');
- regrole
--------------
- regtestrole
+SELECT regrole('"regress_regrole_test"');
+ regrole
+----------------------
+ regress_regrole_test
(1 row)
SELECT regnamespace('pg_catalog');
pg_catalog
(1 row)
-SELECT to_regrole('regtestrole');
- to_regrole
--------------
- regtestrole
+SELECT to_regrole('regress_regrole_test');
+ to_regrole
+----------------------
+ regress_regrole_test
(1 row)
-SELECT to_regrole('"regtestrole"');
- to_regrole
--------------
- regtestrole
+SELECT to_regrole('"regress_regrole_test"');
+ to_regrole
+----------------------
+ regress_regrole_test
(1 row)
SELECT to_regnamespace('pg_catalog');
(1 row)
/* If objects don't exist, raise errors. */
-DROP ROLE regtestrole;
+DROP ROLE regress_regrole_test;
-- without schemaname
SELECT regoper('||//');
ERROR: operator does not exist: ||//
LINE 1: SELECT regtype('ng_catalog.int4');
^
-- schemaname not applicable
-SELECT regrole('regtestrole');
-ERROR: role "regtestrole" does not exist
-LINE 1: SELECT regrole('regtestrole');
+SELECT regrole('regress_regrole_test');
+ERROR: role "regress_regrole_test" does not exist
+LINE 1: SELECT regrole('regress_regrole_test');
^
-SELECT regrole('"regtestrole"');
-ERROR: role "regtestrole" does not exist
-LINE 1: SELECT regrole('"regtestrole"');
+SELECT regrole('"regress_regrole_test"');
+ERROR: role "regress_regrole_test" does not exist
+LINE 1: SELECT regrole('"regress_regrole_test"');
^
SELECT regrole('Nonexistent');
ERROR: role "nonexistent" does not exist
(1 row)
-- schemaname not applicable
-SELECT to_regrole('regtestrole');
+SELECT to_regrole('regress_regrole_test');
to_regrole
------------
(1 row)
-SELECT to_regrole('"regtestrole"');
+SELECT to_regrole('"regress_regrole_test"');
to_regrole
------------
-- default for superuser is false
-CREATE ROLE test_def_superuser;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_superuser';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_def_superuser | f | t | f | f | f | f | f | -1 | |
+CREATE ROLE regress_test_def_superuser;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_superuser';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_def_superuser | f | t | f | f | f | f | f | -1 | |
(1 row)
-CREATE ROLE test_superuser WITH SUPERUSER;
-SELECT * FROM pg_authid WHERE rolname = 'test_superuser';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-----------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_superuser | t | t | f | f | f | f | f | -1 | |
+CREATE ROLE regress_test_superuser WITH SUPERUSER;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_superuser';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_superuser | t | t | f | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_superuser WITH NOSUPERUSER;
-SELECT * FROM pg_authid WHERE rolname = 'test_superuser';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-----------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_superuser | f | t | f | f | f | f | f | -1 | |
+ALTER ROLE regress_test_superuser WITH NOSUPERUSER;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_superuser';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_superuser | f | t | f | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_superuser WITH SUPERUSER;
-SELECT * FROM pg_authid WHERE rolname = 'test_superuser';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-----------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_superuser | t | t | f | f | f | f | f | -1 | |
+ALTER ROLE regress_test_superuser WITH SUPERUSER;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_superuser';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_superuser | t | t | f | f | f | f | f | -1 | |
(1 row)
-- default for inherit is true
-CREATE ROLE test_def_inherit;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_inherit';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_def_inherit | f | t | f | f | f | f | f | -1 | |
+CREATE ROLE regress_test_def_inherit;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_inherit';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+--------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_def_inherit | f | t | f | f | f | f | f | -1 | |
(1 row)
-CREATE ROLE test_inherit WITH NOINHERIT;
-SELECT * FROM pg_authid WHERE rolname = 'test_inherit';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_inherit | f | f | f | f | f | f | f | -1 | |
+CREATE ROLE regress_test_inherit WITH NOINHERIT;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_inherit';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_inherit | f | f | f | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_inherit WITH INHERIT;
-SELECT * FROM pg_authid WHERE rolname = 'test_inherit';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_inherit | f | t | f | f | f | f | f | -1 | |
+ALTER ROLE regress_test_inherit WITH INHERIT;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_inherit';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_inherit | f | t | f | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_inherit WITH NOINHERIT;
-SELECT * FROM pg_authid WHERE rolname = 'test_inherit';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_inherit | f | f | f | f | f | f | f | -1 | |
+ALTER ROLE regress_test_inherit WITH NOINHERIT;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_inherit';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_inherit | f | f | f | f | f | f | f | -1 | |
(1 row)
-- default for create role is false
-CREATE ROLE test_def_createrole;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_createrole';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
----------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_def_createrole | f | t | f | f | f | f | f | -1 | |
+CREATE ROLE regress_test_def_createrole;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_createrole';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+-----------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_def_createrole | f | t | f | f | f | f | f | -1 | |
(1 row)
-CREATE ROLE test_createrole WITH CREATEROLE;
-SELECT * FROM pg_authid WHERE rolname = 'test_createrole';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_createrole | f | t | t | f | f | f | f | -1 | |
+CREATE ROLE regress_test_createrole WITH CREATEROLE;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createrole';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+-------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_createrole | f | t | t | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_createrole WITH NOCREATEROLE;
-SELECT * FROM pg_authid WHERE rolname = 'test_createrole';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_createrole | f | t | f | f | f | f | f | -1 | |
+ALTER ROLE regress_test_createrole WITH NOCREATEROLE;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createrole';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+-------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_createrole | f | t | f | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_createrole WITH CREATEROLE;
-SELECT * FROM pg_authid WHERE rolname = 'test_createrole';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_createrole | f | t | t | f | f | f | f | -1 | |
+ALTER ROLE regress_test_createrole WITH CREATEROLE;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createrole';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+-------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_createrole | f | t | t | f | f | f | f | -1 | |
(1 row)
-- default for create database is false
-CREATE ROLE test_def_createdb;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_createdb';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
--------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_def_createdb | f | t | f | f | f | f | f | -1 | |
+CREATE ROLE regress_test_def_createdb;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_createdb';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+---------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_def_createdb | f | t | f | f | f | f | f | -1 | |
(1 row)
-CREATE ROLE test_createdb WITH CREATEDB;
-SELECT * FROM pg_authid WHERE rolname = 'test_createdb';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
----------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_createdb | f | t | f | t | f | f | f | -1 | |
+CREATE ROLE regress_test_createdb WITH CREATEDB;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createdb';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+-----------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_createdb | f | t | f | t | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_createdb WITH NOCREATEDB;
-SELECT * FROM pg_authid WHERE rolname = 'test_createdb';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
----------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_createdb | f | t | f | f | f | f | f | -1 | |
+ALTER ROLE regress_test_createdb WITH NOCREATEDB;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createdb';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+-----------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_createdb | f | t | f | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_createdb WITH CREATEDB;
-SELECT * FROM pg_authid WHERE rolname = 'test_createdb';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
----------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_createdb | f | t | f | t | f | f | f | -1 | |
+ALTER ROLE regress_test_createdb WITH CREATEDB;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createdb';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+-----------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_createdb | f | t | f | t | f | f | f | -1 | |
(1 row)
-- default for can login is false for role
-CREATE ROLE test_def_role_canlogin;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_role_canlogin';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_def_role_canlogin | f | t | f | f | f | f | f | -1 | |
+CREATE ROLE regress_test_def_role_canlogin;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_role_canlogin';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+--------------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_def_role_canlogin | f | t | f | f | f | f | f | -1 | |
(1 row)
-CREATE ROLE test_role_canlogin WITH LOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_role_canlogin';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_role_canlogin | f | t | f | f | t | f | f | -1 | |
+CREATE ROLE regress_test_role_canlogin WITH LOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_role_canlogin';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_role_canlogin | f | t | f | f | t | f | f | -1 | |
(1 row)
-ALTER ROLE test_role_canlogin WITH NOLOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_role_canlogin';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_role_canlogin | f | t | f | f | f | f | f | -1 | |
+ALTER ROLE regress_test_role_canlogin WITH NOLOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_role_canlogin';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_role_canlogin | f | t | f | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_role_canlogin WITH LOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_role_canlogin';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_role_canlogin | f | t | f | f | t | f | f | -1 | |
+ALTER ROLE regress_test_role_canlogin WITH LOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_role_canlogin';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_role_canlogin | f | t | f | f | t | f | f | -1 | |
(1 row)
-- default for can login is true for user
-CREATE USER test_def_user_canlogin;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_user_canlogin';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_def_user_canlogin | f | t | f | f | t | f | f | -1 | |
+CREATE USER regress_test_def_user_canlogin;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_user_canlogin';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+--------------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_def_user_canlogin | f | t | f | f | t | f | f | -1 | |
(1 row)
-CREATE USER test_user_canlogin WITH NOLOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_user_canlogin';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_user_canlogin | f | t | f | f | f | f | f | -1 | |
+CREATE USER regress_test_user_canlogin WITH NOLOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_user_canlogin';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_user_canlogin | f | t | f | f | f | f | f | -1 | |
(1 row)
-ALTER USER test_user_canlogin WITH LOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_user_canlogin';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_user_canlogin | f | t | f | f | t | f | f | -1 | |
+ALTER USER regress_test_user_canlogin WITH LOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_user_canlogin';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_user_canlogin | f | t | f | f | t | f | f | -1 | |
(1 row)
-ALTER USER test_user_canlogin WITH NOLOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_user_canlogin';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_user_canlogin | f | t | f | f | f | f | f | -1 | |
+ALTER USER regress_test_user_canlogin WITH NOLOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_user_canlogin';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_user_canlogin | f | t | f | f | f | f | f | -1 | |
(1 row)
-- default for replication is false
-CREATE ROLE test_def_replication;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_replication';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-----------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_def_replication | f | t | f | f | f | f | f | -1 | |
+CREATE ROLE regress_test_def_replication;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_replication';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+------------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_def_replication | f | t | f | f | f | f | f | -1 | |
(1 row)
-CREATE ROLE test_replication WITH REPLICATION;
-SELECT * FROM pg_authid WHERE rolname = 'test_replication';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_replication | f | t | f | f | f | t | f | -1 | |
+CREATE ROLE regress_test_replication WITH REPLICATION;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_replication';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+--------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_replication | f | t | f | f | f | t | f | -1 | |
(1 row)
-ALTER ROLE test_replication WITH NOREPLICATION;
-SELECT * FROM pg_authid WHERE rolname = 'test_replication';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_replication | f | t | f | f | f | f | f | -1 | |
+ALTER ROLE regress_test_replication WITH NOREPLICATION;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_replication';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+--------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_replication | f | t | f | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_replication WITH REPLICATION;
-SELECT * FROM pg_authid WHERE rolname = 'test_replication';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_replication | f | t | f | f | f | t | f | -1 | |
+ALTER ROLE regress_test_replication WITH REPLICATION;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_replication';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+--------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_replication | f | t | f | f | f | t | f | -1 | |
(1 row)
-- default for bypassrls is false
-CREATE ROLE test_def_bypassrls;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_bypassrls';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
---------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_def_bypassrls | f | t | f | f | f | f | f | -1 | |
+CREATE ROLE regress_test_def_bypassrls;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_bypassrls';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+----------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_def_bypassrls | f | t | f | f | f | f | f | -1 | |
(1 row)
-CREATE ROLE test_bypassrls WITH BYPASSRLS;
-SELECT * FROM pg_authid WHERE rolname = 'test_bypassrls';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-----------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_bypassrls | f | t | f | f | f | f | t | -1 | |
+CREATE ROLE regress_test_bypassrls WITH BYPASSRLS;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_bypassrls';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_bypassrls | f | t | f | f | f | f | t | -1 | |
(1 row)
-ALTER ROLE test_bypassrls WITH NOBYPASSRLS;
-SELECT * FROM pg_authid WHERE rolname = 'test_bypassrls';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-----------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_bypassrls | f | t | f | f | f | f | f | -1 | |
+ALTER ROLE regress_test_bypassrls WITH NOBYPASSRLS;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_bypassrls';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_bypassrls | f | t | f | f | f | f | f | -1 | |
(1 row)
-ALTER ROLE test_bypassrls WITH BYPASSRLS;
-SELECT * FROM pg_authid WHERE rolname = 'test_bypassrls';
- rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
-----------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
- test_bypassrls | f | t | f | f | f | f | t | -1 | |
+ALTER ROLE regress_test_bypassrls WITH BYPASSRLS;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_bypassrls';
+ rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvaliduntil
+------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+---------------
+ regress_test_bypassrls | f | t | f | f | f | f | t | -1 | |
(1 row)
-- clean up roles
-DROP ROLE test_def_superuser;
-DROP ROLE test_superuser;
-DROP ROLE test_def_inherit;
-DROP ROLE test_inherit;
-DROP ROLE test_def_createrole;
-DROP ROLE test_createrole;
-DROP ROLE test_def_createdb;
-DROP ROLE test_createdb;
-DROP ROLE test_def_role_canlogin;
-DROP ROLE test_role_canlogin;
-DROP USER test_def_user_canlogin;
-DROP USER test_user_canlogin;
-DROP ROLE test_def_replication;
-DROP ROLE test_replication;
-DROP ROLE test_def_bypassrls;
-DROP ROLE test_bypassrls;
+DROP ROLE regress_test_def_superuser;
+DROP ROLE regress_test_superuser;
+DROP ROLE regress_test_def_inherit;
+DROP ROLE regress_test_inherit;
+DROP ROLE regress_test_def_createrole;
+DROP ROLE regress_test_createrole;
+DROP ROLE regress_test_def_createdb;
+DROP ROLE regress_test_createdb;
+DROP ROLE regress_test_def_role_canlogin;
+DROP ROLE regress_test_role_canlogin;
+DROP USER regress_test_def_user_canlogin;
+DROP USER regress_test_user_canlogin;
+DROP ROLE regress_test_def_replication;
+DROP ROLE regress_test_replication;
+DROP ROLE regress_test_def_bypassrls;
+DROP ROLE regress_test_bypassrls;
(SESSION_USER, 'session_user'))
AS v(uname, keyword)
ON (r.rolname = v.uname)
- WHERE (r.rolname) IN ('Public', 'current_user', 'testrol1', 'testrol2')
+ WHERE (r.rolname) IN ('Public', 'current_user', 'regress_testrol1', 'regress_testrol2')
ORDER BY 1, 2;
$$ LANGUAGE SQL;
CREATE OR REPLACE FUNCTION chkumapping()
CREATE ROLE "pg_abcdef"; -- error
ERROR: role name "pg_abcdef" is reserved
DETAIL: Role names starting with "pg_" are reserved.
-CREATE ROLE testrol0 SUPERUSER LOGIN;
-CREATE ROLE testrolx SUPERUSER LOGIN;
-CREATE ROLE testrol2 SUPERUSER;
-CREATE ROLE testrol1 SUPERUSER LOGIN IN ROLE testrol2;
+CREATE ROLE regress_testrol0 SUPERUSER LOGIN;
+CREATE ROLE regress_testrolx SUPERUSER LOGIN;
+CREATE ROLE regress_testrol2 SUPERUSER;
+CREATE ROLE regress_testrol1 SUPERUSER LOGIN IN ROLE regress_testrol2;
\c -
-SET SESSION AUTHORIZATION testrol1;
-SET ROLE testrol2;
+SET SESSION AUTHORIZATION regress_testrol1;
+SET ROLE regress_testrol2;
-- ALTER ROLE
BEGIN;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | f
- session_user | - | f | f
- testrol1 | session_user | t | f
- testrol2 | current_user | f | f
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | f
+ regress_testrol1 | session_user | t | f
+ regress_testrol2 | current_user | f | f
+ session_user | - | f | f
(6 rows)
ALTER ROLE CURRENT_USER WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | f
- session_user | - | f | f
- testrol1 | session_user | t | f
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | f
+ regress_testrol1 | session_user | t | f
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | f
(6 rows)
ALTER ROLE "current_user" WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | t
- session_user | - | f | f
- testrol1 | session_user | t | f
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | f
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | f
(6 rows)
ALTER ROLE SESSION_USER WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | t
- session_user | - | f | f
- testrol1 | session_user | t | t
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | t
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | f
(6 rows)
ALTER ROLE "session_user" WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | t
- session_user | - | f | t
- testrol1 | session_user | t | t
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | t
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | t
(6 rows)
ALTER USER "Public" WITH REPLICATION;
ALTER USER "None" WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | t
- Public | - | f | t
- current_user | - | f | t
- session_user | - | f | t
- testrol1 | session_user | t | t
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | t
+ Public | - | f | t
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | t
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | t
(6 rows)
-ALTER USER testrol1 WITH NOREPLICATION;
-ALTER USER testrol2 WITH NOREPLICATION;
+ALTER USER regress_testrol1 WITH NOREPLICATION;
+ALTER USER regress_testrol2 WITH NOREPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | t
- Public | - | f | t
- current_user | - | f | t
- session_user | - | f | t
- testrol1 | session_user | t | f
- testrol2 | current_user | f | f
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | t
+ Public | - | f | t
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | f
+ regress_testrol2 | current_user | f | f
+ session_user | - | f | t
(6 rows)
ROLLBACK;
-- ALTER USER
BEGIN;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | f
- session_user | - | f | f
- testrol1 | session_user | t | f
- testrol2 | current_user | f | f
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | f
+ regress_testrol1 | session_user | t | f
+ regress_testrol2 | current_user | f | f
+ session_user | - | f | f
(6 rows)
ALTER USER CURRENT_USER WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | f
- session_user | - | f | f
- testrol1 | session_user | t | f
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | f
+ regress_testrol1 | session_user | t | f
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | f
(6 rows)
ALTER USER "current_user" WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | t
- session_user | - | f | f
- testrol1 | session_user | t | f
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | f
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | f
(6 rows)
ALTER USER SESSION_USER WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | t
- session_user | - | f | f
- testrol1 | session_user | t | t
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | t
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | f
(6 rows)
ALTER USER "session_user" WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | f
- Public | - | f | f
- current_user | - | f | t
- session_user | - | f | t
- testrol1 | session_user | t | t
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | f
+ Public | - | f | f
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | t
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | t
(6 rows)
ALTER USER "Public" WITH REPLICATION;
ALTER USER "None" WITH REPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | t
- Public | - | f | t
- current_user | - | f | t
- session_user | - | f | t
- testrol1 | session_user | t | t
- testrol2 | current_user | f | t
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | t
+ Public | - | f | t
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | t
+ regress_testrol2 | current_user | f | t
+ session_user | - | f | t
(6 rows)
-ALTER USER testrol1 WITH NOREPLICATION;
-ALTER USER testrol2 WITH NOREPLICATION;
+ALTER USER regress_testrol1 WITH NOREPLICATION;
+ALTER USER regress_testrol2 WITH NOREPLICATION;
SELECT * FROM chkrolattr();
- role | rolekeyword | canlogin | replication
---------------+--------------+----------+-------------
- None | - | f | t
- Public | - | f | t
- current_user | - | f | t
- session_user | - | f | t
- testrol1 | session_user | t | f
- testrol2 | current_user | f | f
+ role | rolekeyword | canlogin | replication
+------------------+--------------+----------+-------------
+ None | - | f | t
+ Public | - | f | t
+ current_user | - | f | t
+ regress_testrol1 | session_user | t | f
+ regress_testrol2 | current_user | f | f
+ session_user | - | f | t
(6 rows)
ROLLBACK;
ALTER ROLE "Public" SET application_name to 'BARBAR';
ALTER ROLE ALL SET application_name to 'SLAP';
SELECT * FROM chksetconfig();
- db | role | rolkeyword | setconfig
------+--------------+--------------+---------------------------
- ALL | Public | - | {application_name=BARBAR}
- ALL | current_user | - | {application_name=FOOFOO}
- ALL | testrol1 | session_user | {application_name=BAR}
- ALL | testrol2 | current_user | {application_name=FOO}
+ db | role | rolkeyword | setconfig
+-----+------------------+--------------+---------------------------
+ ALL | Public | - | {application_name=BARBAR}
+ ALL | current_user | - | {application_name=FOOFOO}
+ ALL | regress_testrol1 | session_user | {application_name=BAR}
+ ALL | regress_testrol2 | current_user | {application_name=FOO}
(4 rows)
-ALTER ROLE testrol1 SET application_name to 'SLAM';
+ALTER ROLE regress_testrol1 SET application_name to 'SLAM';
SELECT * FROM chksetconfig();
- db | role | rolkeyword | setconfig
------+--------------+--------------+---------------------------
- ALL | Public | - | {application_name=BARBAR}
- ALL | current_user | - | {application_name=FOOFOO}
- ALL | testrol1 | session_user | {application_name=SLAM}
- ALL | testrol2 | current_user | {application_name=FOO}
+ db | role | rolkeyword | setconfig
+-----+------------------+--------------+---------------------------
+ ALL | Public | - | {application_name=BARBAR}
+ ALL | current_user | - | {application_name=FOOFOO}
+ ALL | regress_testrol1 | session_user | {application_name=SLAM}
+ ALL | regress_testrol2 | current_user | {application_name=FOO}
(4 rows)
ALTER ROLE CURRENT_USER RESET application_name;
LINE 1: ALTER USER ALL SET application_name to 'SLAP';
^
SELECT * FROM chksetconfig();
- db | role | rolkeyword | setconfig
------+--------------+--------------+---------------------------
- ALL | Public | - | {application_name=BARBAR}
- ALL | current_user | - | {application_name=FOOFOO}
- ALL | testrol1 | session_user | {application_name=BAR}
- ALL | testrol2 | current_user | {application_name=FOO}
+ db | role | rolkeyword | setconfig
+-----+------------------+--------------+---------------------------
+ ALL | Public | - | {application_name=BARBAR}
+ ALL | current_user | - | {application_name=FOOFOO}
+ ALL | regress_testrol1 | session_user | {application_name=BAR}
+ ALL | regress_testrol2 | current_user | {application_name=FOO}
(4 rows)
-ALTER USER testrol1 SET application_name to 'SLAM';
+ALTER USER regress_testrol1 SET application_name to 'SLAM';
SELECT * FROM chksetconfig();
- db | role | rolkeyword | setconfig
------+--------------+--------------+---------------------------
- ALL | Public | - | {application_name=BARBAR}
- ALL | current_user | - | {application_name=FOOFOO}
- ALL | testrol1 | session_user | {application_name=SLAM}
- ALL | testrol2 | current_user | {application_name=FOO}
+ db | role | rolkeyword | setconfig
+-----+------------------+--------------+---------------------------
+ ALL | Public | - | {application_name=BARBAR}
+ ALL | current_user | - | {application_name=FOOFOO}
+ ALL | regress_testrol1 | session_user | {application_name=SLAM}
+ ALL | regress_testrol2 | current_user | {application_name=FOO}
(4 rows)
ALTER USER CURRENT_USER RESET application_name;
CREATE SCHEMA newschema1 AUTHORIZATION CURRENT_USER;
CREATE SCHEMA newschema2 AUTHORIZATION "current_user";
CREATE SCHEMA newschema3 AUTHORIZATION SESSION_USER;
-CREATE SCHEMA newschema4 AUTHORIZATION testrolx;
+CREATE SCHEMA newschema4 AUTHORIZATION regress_testrolx;
CREATE SCHEMA newschema5 AUTHORIZATION "Public";
CREATE SCHEMA newschema6 AUTHORIZATION USER; -- error
ERROR: syntax error at or near "USER"
SELECT n.nspname, r.rolname FROM pg_namespace n
JOIN pg_roles r ON (r.oid = n.nspowner)
WHERE n.nspname LIKE 'newschema_' ORDER BY 1;
- nspname | rolname
-------------+--------------
- newschema1 | testrol2
+ nspname | rolname
+------------+------------------
+ newschema1 | regress_testrol2
newschema2 | current_user
- newschema3 | testrol1
- newschema4 | testrolx
+ newschema3 | regress_testrol1
+ newschema4 | regress_testrolx
newschema5 | Public
(5 rows)
CREATE SCHEMA IF NOT EXISTS newschema1 AUTHORIZATION CURRENT_USER;
CREATE SCHEMA IF NOT EXISTS newschema2 AUTHORIZATION "current_user";
CREATE SCHEMA IF NOT EXISTS newschema3 AUTHORIZATION SESSION_USER;
-CREATE SCHEMA IF NOT EXISTS newschema4 AUTHORIZATION testrolx;
+CREATE SCHEMA IF NOT EXISTS newschema4 AUTHORIZATION regress_testrolx;
CREATE SCHEMA IF NOT EXISTS newschema5 AUTHORIZATION "Public";
CREATE SCHEMA IF NOT EXISTS newschema6 AUTHORIZATION USER; -- error
ERROR: syntax error at or near "USER"
SELECT n.nspname, r.rolname FROM pg_namespace n
JOIN pg_roles r ON (r.oid = n.nspowner)
WHERE n.nspname LIKE 'newschema_' ORDER BY 1;
- nspname | rolname
-------------+--------------
- newschema1 | testrol2
+ nspname | rolname
+------------+------------------
+ newschema1 | regress_testrol2
newschema2 | current_user
- newschema3 | testrol1
- newschema4 | testrolx
+ newschema3 | regress_testrol1
+ newschema4 | regress_testrolx
newschema5 | Public
(5 rows)
-- ALTER TABLE OWNER TO
\c -
-SET SESSION AUTHORIZATION testrol0;
+SET SESSION AUTHORIZATION regress_testrol0;
set client_min_messages to error;
CREATE TABLE testtab1 (a int);
CREATE TABLE testtab2 (a int);
CREATE TABLE testtab5 (a int);
CREATE TABLE testtab6 (a int);
\c -
-SET SESSION AUTHORIZATION testrol1;
-SET ROLE testrol2;
+SET SESSION AUTHORIZATION regress_testrol1;
+SET ROLE regress_testrol2;
ALTER TABLE testtab1 OWNER TO CURRENT_USER;
ALTER TABLE testtab2 OWNER TO "current_user";
ALTER TABLE testtab3 OWNER TO SESSION_USER;
-ALTER TABLE testtab4 OWNER TO testrolx;
+ALTER TABLE testtab4 OWNER TO regress_testrolx;
ALTER TABLE testtab5 OWNER TO "Public";
ALTER TABLE testtab6 OWNER TO CURRENT_ROLE; -- error
ERROR: syntax error at or near "CURRENT_ROLE"
FROM pg_class c JOIN pg_roles r ON (r.oid = c.relowner)
WHERE relname LIKE 'testtab_'
ORDER BY 1;
- relname | rolname
-----------+--------------
- testtab1 | testrol2
+ relname | rolname
+----------+------------------
+ testtab1 | regress_testrol2
testtab2 | current_user
- testtab3 | testrol1
- testtab4 | testrolx
+ testtab3 | regress_testrol1
+ testtab4 | regress_testrolx
testtab5 | Public
- testtab6 | testrol0
+ testtab6 | regress_testrol0
(6 rows)
-- ALTER TABLE, VIEW, MATERIALIZED VIEW, FOREIGN TABLE, SEQUENCE are
-- changed their owner in the same way.
-- ALTER AGGREGATE
\c -
-SET SESSION AUTHORIZATION testrol0;
+SET SESSION AUTHORIZATION regress_testrol0;
CREATE AGGREGATE testagg1(int2) (SFUNC = int2_sum, STYPE = int8);
CREATE AGGREGATE testagg2(int2) (SFUNC = int2_sum, STYPE = int8);
CREATE AGGREGATE testagg3(int2) (SFUNC = int2_sum, STYPE = int8);
CREATE AGGREGATE testagg8(int2) (SFUNC = int2_sum, STYPE = int8);
CREATE AGGREGATE testagg9(int2) (SFUNC = int2_sum, STYPE = int8);
\c -
-SET SESSION AUTHORIZATION testrol1;
-SET ROLE testrol2;
+SET SESSION AUTHORIZATION regress_testrol1;
+SET ROLE regress_testrol2;
ALTER AGGREGATE testagg1(int2) OWNER TO CURRENT_USER;
ALTER AGGREGATE testagg2(int2) OWNER TO "current_user";
ALTER AGGREGATE testagg3(int2) OWNER TO SESSION_USER;
-ALTER AGGREGATE testagg4(int2) OWNER TO testrolx;
+ALTER AGGREGATE testagg4(int2) OWNER TO regress_testrolx;
ALTER AGGREGATE testagg5(int2) OWNER TO "Public";
ALTER AGGREGATE testagg5(int2) OWNER TO CURRENT_ROLE; -- error
ERROR: syntax error at or near "CURRENT_ROLE"
FROM pg_proc p JOIN pg_roles r ON (r.oid = p.proowner)
WHERE proname LIKE 'testagg_'
ORDER BY 1;
- proname | rolname
-----------+--------------
- testagg1 | testrol2
+ proname | rolname
+----------+------------------
+ testagg1 | regress_testrol2
testagg2 | current_user
- testagg3 | testrol1
- testagg4 | testrolx
+ testagg3 | regress_testrol1
+ testagg4 | regress_testrolx
testagg5 | Public
- testagg6 | testrol0
- testagg7 | testrol0
- testagg8 | testrol0
- testagg9 | testrol0
+ testagg6 | regress_testrol0
+ testagg7 | regress_testrol0
+ testagg8 | regress_testrol0
+ testagg9 | regress_testrol0
(9 rows)
-- CREATE USER MAPPING
CREATE USER MAPPING FOR SESSION_USER SERVER sv5 OPTIONS (user 'SESSION_USER');
CREATE USER MAPPING FOR PUBLIC SERVER sv6 OPTIONS (user 'PUBLIC');
CREATE USER MAPPING FOR "Public" SERVER sv7 OPTIONS (user '"Public"');
-CREATE USER MAPPING FOR testrolx SERVER sv8 OPTIONS (user 'testrolx');
+CREATE USER MAPPING FOR regress_testrolx SERVER sv8 OPTIONS (user 'regress_testrolx');
CREATE USER MAPPING FOR CURRENT_ROLE SERVER sv9
OPTIONS (user 'CURRENT_ROLE'); -- error
ERROR: syntax error at or near "CURRENT_ROLE"
OPTIONS (user 'nonexistent'); -- error;
ERROR: role "nonexistent" does not exist
SELECT * FROM chkumapping();
- umname | umserver | umoptions
---------------+----------+---------------------------
- testrol2 | sv1 | {user=CURRENT_USER}
- current_user | sv2 | {"user=\"current_user\""}
- testrol2 | sv3 | {user=USER}
- user | sv4 | {"user=\"USER\""}
- testrol1 | sv5 | {user=SESSION_USER}
- | sv6 | {user=PUBLIC}
- Public | sv7 | {"user=\"Public\""}
- testrolx | sv8 | {user=testrolx}
+ umname | umserver | umoptions
+------------------+----------+---------------------------
+ regress_testrol2 | sv1 | {user=CURRENT_USER}
+ current_user | sv2 | {"user=\"current_user\""}
+ regress_testrol2 | sv3 | {user=USER}
+ user | sv4 | {"user=\"USER\""}
+ regress_testrol1 | sv5 | {user=SESSION_USER}
+ | sv6 | {user=PUBLIC}
+ Public | sv7 | {"user=\"Public\""}
+ regress_testrolx | sv8 | {user=regress_testrolx}
(8 rows)
-- ALTER USER MAPPING
OPTIONS (SET user 'public_alt');
ALTER USER MAPPING FOR "Public" SERVER sv7
OPTIONS (SET user '"Public"_alt');
-ALTER USER MAPPING FOR testrolx SERVER sv8
- OPTIONS (SET user 'testrolx_alt');
+ALTER USER MAPPING FOR regress_testrolx SERVER sv8
+ OPTIONS (SET user 'regress_testrolx_alt');
ALTER USER MAPPING FOR CURRENT_ROLE SERVER sv9
OPTIONS (SET user 'CURRENT_ROLE_alt');
ERROR: syntax error at or near "CURRENT_ROLE"
OPTIONS (SET user 'nonexistent_alt'); -- error
ERROR: role "nonexistent" does not exist
SELECT * FROM chkumapping();
- umname | umserver | umoptions
---------------+----------+-------------------------------
- testrol2 | sv1 | {user=CURRENT_USER_alt}
- current_user | sv2 | {"user=\"current_user\"_alt"}
- testrol2 | sv3 | {user=USER_alt}
- user | sv4 | {"user=\"user\"_alt"}
- testrol1 | sv5 | {user=SESSION_USER_alt}
- | sv6 | {user=public_alt}
- Public | sv7 | {"user=\"Public\"_alt"}
- testrolx | sv8 | {user=testrolx_alt}
+ umname | umserver | umoptions
+------------------+----------+-------------------------------
+ regress_testrol2 | sv1 | {user=CURRENT_USER_alt}
+ current_user | sv2 | {"user=\"current_user\"_alt"}
+ regress_testrol2 | sv3 | {user=USER_alt}
+ user | sv4 | {"user=\"user\"_alt"}
+ regress_testrol1 | sv5 | {user=SESSION_USER_alt}
+ | sv6 | {user=public_alt}
+ Public | sv7 | {"user=\"Public\"_alt"}
+ regress_testrolx | sv8 | {user=regress_testrolx_alt}
(8 rows)
-- DROP USER MAPPING
DROP USER MAPPING FOR SESSION_USER SERVER sv5;
DROP USER MAPPING FOR PUBLIC SERVER sv6;
DROP USER MAPPING FOR "Public" SERVER sv7;
-DROP USER MAPPING FOR testrolx SERVER sv8;
+DROP USER MAPPING FOR regress_testrolx SERVER sv8;
DROP USER MAPPING FOR CURRENT_ROLE SERVER sv9; -- error
ERROR: syntax error at or near "CURRENT_ROLE"
LINE 1: DROP USER MAPPING FOR CURRENT_ROLE SERVER sv9;
CREATE USER MAPPING FOR SESSION_USER SERVER sv5 OPTIONS (user 'SESSION_USER');
CREATE USER MAPPING FOR PUBLIC SERVER sv6 OPTIONS (user 'PUBLIC');
CREATE USER MAPPING FOR "Public" SERVER sv7 OPTIONS (user '"Public"');
-CREATE USER MAPPING FOR testrolx SERVER sv8 OPTIONS (user 'testrolx');
+CREATE USER MAPPING FOR regress_testrolx SERVER sv8 OPTIONS (user 'regress_testrolx');
SELECT * FROM chkumapping();
- umname | umserver | umoptions
---------------+----------+---------------------------
- testrol2 | sv1 | {user=CURRENT_USER}
- current_user | sv2 | {"user=\"current_user\""}
- testrol2 | sv3 | {user=USER}
- user | sv4 | {"user=\"USER\""}
- testrol1 | sv5 | {user=SESSION_USER}
- | sv6 | {user=PUBLIC}
- Public | sv7 | {"user=\"Public\""}
- testrolx | sv8 | {user=testrolx}
+ umname | umserver | umoptions
+------------------+----------+---------------------------
+ regress_testrol2 | sv1 | {user=CURRENT_USER}
+ current_user | sv2 | {"user=\"current_user\""}
+ regress_testrol2 | sv3 | {user=USER}
+ user | sv4 | {"user=\"USER\""}
+ regress_testrol1 | sv5 | {user=SESSION_USER}
+ | sv6 | {user=PUBLIC}
+ Public | sv7 | {"user=\"Public\""}
+ regress_testrolx | sv8 | {user=regress_testrolx}
(8 rows)
-- DROP USER MAPPING IF EXISTS
DROP USER MAPPING IF EXISTS FOR CURRENT_USER SERVER sv1;
SELECT * FROM chkumapping();
- umname | umserver | umoptions
---------------+----------+---------------------------
- current_user | sv2 | {"user=\"current_user\""}
- testrol2 | sv3 | {user=USER}
- user | sv4 | {"user=\"USER\""}
- testrol1 | sv5 | {user=SESSION_USER}
- | sv6 | {user=PUBLIC}
- Public | sv7 | {"user=\"Public\""}
- testrolx | sv8 | {user=testrolx}
+ umname | umserver | umoptions
+------------------+----------+---------------------------
+ current_user | sv2 | {"user=\"current_user\""}
+ regress_testrol2 | sv3 | {user=USER}
+ user | sv4 | {"user=\"USER\""}
+ regress_testrol1 | sv5 | {user=SESSION_USER}
+ | sv6 | {user=PUBLIC}
+ Public | sv7 | {"user=\"Public\""}
+ regress_testrolx | sv8 | {user=regress_testrolx}
(7 rows)
DROP USER MAPPING IF EXISTS FOR "current_user" SERVER sv2;
SELECT * FROM chkumapping();
- umname | umserver | umoptions
-----------+----------+---------------------
- testrol2 | sv3 | {user=USER}
- user | sv4 | {"user=\"USER\""}
- testrol1 | sv5 | {user=SESSION_USER}
- | sv6 | {user=PUBLIC}
- Public | sv7 | {"user=\"Public\""}
- testrolx | sv8 | {user=testrolx}
+ umname | umserver | umoptions
+------------------+----------+-------------------------
+ regress_testrol2 | sv3 | {user=USER}
+ user | sv4 | {"user=\"USER\""}
+ regress_testrol1 | sv5 | {user=SESSION_USER}
+ | sv6 | {user=PUBLIC}
+ Public | sv7 | {"user=\"Public\""}
+ regress_testrolx | sv8 | {user=regress_testrolx}
(6 rows)
DROP USER MAPPING IF EXISTS FOR USER SERVER sv3;
SELECT * FROM chkumapping();
- umname | umserver | umoptions
-----------+----------+---------------------
- user | sv4 | {"user=\"USER\""}
- testrol1 | sv5 | {user=SESSION_USER}
- | sv6 | {user=PUBLIC}
- Public | sv7 | {"user=\"Public\""}
- testrolx | sv8 | {user=testrolx}
+ umname | umserver | umoptions
+------------------+----------+-------------------------
+ user | sv4 | {"user=\"USER\""}
+ regress_testrol1 | sv5 | {user=SESSION_USER}
+ | sv6 | {user=PUBLIC}
+ Public | sv7 | {"user=\"Public\""}
+ regress_testrolx | sv8 | {user=regress_testrolx}
(5 rows)
DROP USER MAPPING IF EXISTS FOR "user" SERVER sv4;
SELECT * FROM chkumapping();
- umname | umserver | umoptions
-----------+----------+---------------------
- testrol1 | sv5 | {user=SESSION_USER}
- | sv6 | {user=PUBLIC}
- Public | sv7 | {"user=\"Public\""}
- testrolx | sv8 | {user=testrolx}
+ umname | umserver | umoptions
+------------------+----------+-------------------------
+ regress_testrol1 | sv5 | {user=SESSION_USER}
+ | sv6 | {user=PUBLIC}
+ Public | sv7 | {"user=\"Public\""}
+ regress_testrolx | sv8 | {user=regress_testrolx}
(4 rows)
DROP USER MAPPING IF EXISTS FOR SESSION_USER SERVER sv5;
SELECT * FROM chkumapping();
- umname | umserver | umoptions
-----------+----------+---------------------
- | sv6 | {user=PUBLIC}
- Public | sv7 | {"user=\"Public\""}
- testrolx | sv8 | {user=testrolx}
+ umname | umserver | umoptions
+------------------+----------+-------------------------
+ | sv6 | {user=PUBLIC}
+ Public | sv7 | {"user=\"Public\""}
+ regress_testrolx | sv8 | {user=regress_testrolx}
(3 rows)
DROP USER MAPPING IF EXISTS FOR PUBLIC SERVER sv6;
SELECT * FROM chkumapping();
- umname | umserver | umoptions
-----------+----------+---------------------
- Public | sv7 | {"user=\"Public\""}
- testrolx | sv8 | {user=testrolx}
+ umname | umserver | umoptions
+------------------+----------+-------------------------
+ Public | sv7 | {"user=\"Public\""}
+ regress_testrolx | sv8 | {user=regress_testrolx}
(2 rows)
DROP USER MAPPING IF EXISTS FOR "Public" SERVER sv7;
SELECT * FROM chkumapping();
- umname | umserver | umoptions
-----------+----------+-----------------
- testrolx | sv8 | {user=testrolx}
+ umname | umserver | umoptions
+------------------+----------+-------------------------
+ regress_testrolx | sv8 | {user=regress_testrolx}
(1 row)
-DROP USER MAPPING IF EXISTS FOR testrolx SERVER sv8;
+DROP USER MAPPING IF EXISTS FOR regress_testrolx SERVER sv8;
SELECT * FROM chkumapping();
umname | umserver | umoptions
--------+----------+-----------
DROP USER MAPPING IF EXISTS FOR nonexistent SERVER sv9; -- error
NOTICE: role "nonexistent" does not exist, skipping
-- GRANT/REVOKE
-GRANT testrol0 TO pg_signal_backend; -- success
+GRANT regress_testrol0 TO pg_signal_backend; -- success
SET ROLE pg_signal_backend; --success
RESET ROLE;
CREATE SCHEMA test_schema AUTHORIZATION pg_signal_backend; --success
-SET ROLE testrol2;
+SET ROLE regress_testrol2;
UPDATE pg_proc SET proacl = null WHERE proname LIKE 'testagg_';
SELECT proname, proacl FROM pg_proc WHERE proname LIKE 'testagg_';
proname | proacl
GRANT ALL PRIVILEGES ON FUNCTION testagg3(int2) TO "current_user";
GRANT ALL PRIVILEGES ON FUNCTION testagg4(int2) TO SESSION_USER;
GRANT ALL PRIVILEGES ON FUNCTION testagg5(int2) TO "Public";
-GRANT ALL PRIVILEGES ON FUNCTION testagg6(int2) TO testrolx;
+GRANT ALL PRIVILEGES ON FUNCTION testagg6(int2) TO regress_testrolx;
GRANT ALL PRIVILEGES ON FUNCTION testagg7(int2) TO "public";
GRANT ALL PRIVILEGES ON FUNCTION testagg8(int2)
- TO current_user, public, testrolx;
+ TO current_user, public, regress_testrolx;
SELECT proname, proacl FROM pg_proc WHERE proname LIKE 'testagg_';
- proname | proacl
-----------+---------------------------------------------------------------------------
- testagg1 | {testrol2=X/testrol2,=X/testrol2}
- testagg2 | {current_user=X/current_user,testrol2=X/current_user}
- testagg3 | {testrol1=X/testrol1,current_user=X/testrol1}
- testagg4 | {testrolx=X/testrolx,testrol1=X/testrolx}
+ proname | proacl
+----------+-----------------------------------------------------------------------------------------------------------------------------------
+ testagg1 | {regress_testrol2=X/regress_testrol2,=X/regress_testrol2}
+ testagg2 | {current_user=X/current_user,regress_testrol2=X/current_user}
+ testagg3 | {regress_testrol1=X/regress_testrol1,current_user=X/regress_testrol1}
+ testagg4 | {regress_testrolx=X/regress_testrolx,regress_testrol1=X/regress_testrolx}
testagg5 | {Public=X/Public}
- testagg6 | {testrol0=X/testrol0,testrolx=X/testrol0}
- testagg7 | {testrol0=X/testrol0,=X/testrol0}
- testagg8 | {testrol0=X/testrol0,testrol2=X/testrol0,=X/testrol0,testrolx=X/testrol0}
+ testagg6 | {regress_testrol0=X/regress_testrol0,regress_testrolx=X/regress_testrol0}
+ testagg7 | {regress_testrol0=X/regress_testrol0,=X/regress_testrol0}
+ testagg8 | {regress_testrol0=X/regress_testrol0,regress_testrol2=X/regress_testrol0,=X/regress_testrol0,regress_testrolx=X/regress_testrol0}
testagg9 |
(9 rows)
LINE 1: GRANT ALL PRIVILEGES ON FUNCTION testagg9(int2) TO "none";
^
SELECT proname, proacl FROM pg_proc WHERE proname LIKE 'testagg_';
- proname | proacl
-----------+---------------------------------------------------------------------------
- testagg1 | {testrol2=X/testrol2,=X/testrol2}
- testagg2 | {current_user=X/current_user,testrol2=X/current_user}
- testagg3 | {testrol1=X/testrol1,current_user=X/testrol1}
- testagg4 | {testrolx=X/testrolx,testrol1=X/testrolx}
+ proname | proacl
+----------+-----------------------------------------------------------------------------------------------------------------------------------
+ testagg1 | {regress_testrol2=X/regress_testrol2,=X/regress_testrol2}
+ testagg2 | {current_user=X/current_user,regress_testrol2=X/current_user}
+ testagg3 | {regress_testrol1=X/regress_testrol1,current_user=X/regress_testrol1}
+ testagg4 | {regress_testrolx=X/regress_testrolx,regress_testrol1=X/regress_testrolx}
testagg5 | {Public=X/Public}
- testagg6 | {testrol0=X/testrol0,testrolx=X/testrol0}
- testagg7 | {testrol0=X/testrol0,=X/testrol0}
- testagg8 | {testrol0=X/testrol0,testrol2=X/testrol0,=X/testrol0,testrolx=X/testrol0}
+ testagg6 | {regress_testrol0=X/regress_testrol0,regress_testrolx=X/regress_testrol0}
+ testagg7 | {regress_testrol0=X/regress_testrol0,=X/regress_testrol0}
+ testagg8 | {regress_testrol0=X/regress_testrol0,regress_testrol2=X/regress_testrol0,=X/regress_testrol0,regress_testrolx=X/regress_testrol0}
testagg9 |
(9 rows)
REVOKE ALL PRIVILEGES ON FUNCTION testagg3(int2) FROM "current_user";
REVOKE ALL PRIVILEGES ON FUNCTION testagg4(int2) FROM SESSION_USER;
REVOKE ALL PRIVILEGES ON FUNCTION testagg5(int2) FROM "Public";
-REVOKE ALL PRIVILEGES ON FUNCTION testagg6(int2) FROM testrolx;
+REVOKE ALL PRIVILEGES ON FUNCTION testagg6(int2) FROM regress_testrolx;
REVOKE ALL PRIVILEGES ON FUNCTION testagg7(int2) FROM "public";
REVOKE ALL PRIVILEGES ON FUNCTION testagg8(int2)
- FROM current_user, public, testrolx;
+ FROM current_user, public, regress_testrolx;
SELECT proname, proacl FROM pg_proc WHERE proname LIKE 'testagg_';
- proname | proacl
-----------+-------------------------------
- testagg1 | {testrol2=X/testrol2}
+ proname | proacl
+----------+---------------------------------------
+ testagg1 | {regress_testrol2=X/regress_testrol2}
testagg2 | {current_user=X/current_user}
- testagg3 | {testrol1=X/testrol1}
- testagg4 | {testrolx=X/testrolx}
+ testagg3 | {regress_testrol1=X/regress_testrol1}
+ testagg4 | {regress_testrolx=X/regress_testrolx}
testagg5 | {}
- testagg6 | {testrol0=X/testrol0}
- testagg7 | {testrol0=X/testrol0}
- testagg8 | {testrol0=X/testrol0}
+ testagg6 | {regress_testrol0=X/regress_testrol0}
+ testagg7 | {regress_testrol0=X/regress_testrol0}
+ testagg8 | {regress_testrol0=X/regress_testrol0}
testagg9 |
(9 rows)
LINE 1: ...EVOKE ALL PRIVILEGES ON FUNCTION testagg9(int2) FROM "none";
^
SELECT proname, proacl FROM pg_proc WHERE proname LIKE 'testagg_';
- proname | proacl
-----------+-------------------------------
- testagg1 | {testrol2=X/testrol2}
+ proname | proacl
+----------+---------------------------------------
+ testagg1 | {regress_testrol2=X/regress_testrol2}
testagg2 | {current_user=X/current_user}
- testagg3 | {testrol1=X/testrol1}
- testagg4 | {testrolx=X/testrolx}
+ testagg3 | {regress_testrol1=X/regress_testrol1}
+ testagg4 | {regress_testrolx=X/regress_testrolx}
testagg5 | {}
- testagg6 | {testrol0=X/testrol0}
- testagg7 | {testrol0=X/testrol0}
- testagg8 | {testrol0=X/testrol0}
+ testagg6 | {regress_testrol0=X/regress_testrol0}
+ testagg7 | {regress_testrol0=X/regress_testrol0}
+ testagg8 | {regress_testrol0=X/regress_testrol0}
testagg9 |
(9 rows)
-- clean up
\c
DROP SCHEMA test_schema;
-DROP OWNED BY testrol0, "Public", "current_user", testrol1, testrol2, testrolx CASCADE;
-DROP ROLE testrol0, testrol1, testrol2, testrolx;
+DROP OWNED BY regress_testrol0, "Public", "current_user", regress_testrol1, regress_testrol2, regress_testrolx CASCADE;
+DROP ROLE regress_testrol0, regress_testrol1, regress_testrol2, regress_testrolx;
DROP ROLE "Public", "None", "current_user", "session_user", "user";
--
-- initial setups
SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS seclabel_user1;
-DROP ROLE IF EXISTS seclabel_user2;
-DROP TABLE IF EXISTS seclabel_tbl1;
-DROP TABLE IF EXISTS seclabel_tbl2;
-DROP TABLE IF EXISTS seclabel_tbl3;
-CREATE USER seclabel_user1 WITH CREATEROLE;
-CREATE USER seclabel_user2;
+DROP ROLE IF EXISTS regress_seclabel_user1;
+DROP ROLE IF EXISTS regress_seclabel_user2;
+RESET client_min_messages;
+CREATE USER regress_seclabel_user1 WITH CREATEROLE;
+CREATE USER regress_seclabel_user2;
CREATE TABLE seclabel_tbl1 (a int, b text);
CREATE TABLE seclabel_tbl2 (x int, y text);
CREATE VIEW seclabel_view1 AS SELECT * FROM seclabel_tbl2;
CREATE FUNCTION seclabel_four() RETURNS integer AS $$SELECT 4$$ language sql;
CREATE DOMAIN seclabel_domain AS text;
-ALTER TABLE seclabel_tbl1 OWNER TO seclabel_user1;
-ALTER TABLE seclabel_tbl2 OWNER TO seclabel_user2;
-RESET client_min_messages;
+ALTER TABLE seclabel_tbl1 OWNER TO regress_seclabel_user1;
+ALTER TABLE seclabel_tbl2 OWNER TO regress_seclabel_user2;
--
-- Test of SECURITY LABEL statement without a plugin
--
ERROR: no security label providers have been loaded
SECURITY LABEL ON TABLE seclabel_tbl3 IS 'unclassified'; -- fail
ERROR: no security label providers have been loaded
-SECURITY LABEL ON ROLE seclabel_user1 IS 'classified'; -- fail
+SECURITY LABEL ON ROLE regress_seclabel_user1 IS 'classified'; -- fail
ERROR: no security label providers have been loaded
-SECURITY LABEL FOR 'dummy' ON ROLE seclabel_user1 IS 'classified'; -- fail
+SECURITY LABEL FOR 'dummy' ON ROLE regress_seclabel_user1 IS 'classified'; -- fail
ERROR: security label provider "dummy" is not loaded
-SECURITY LABEL ON ROLE seclabel_user1 IS '...invalid label...'; -- fail
+SECURITY LABEL ON ROLE regress_seclabel_user1 IS '...invalid label...'; -- fail
ERROR: no security label providers have been loaded
-SECURITY LABEL ON ROLE seclabel_user3 IS 'unclassified'; -- fail
+SECURITY LABEL ON ROLE regress_seclabel_user3 IS 'unclassified'; -- fail
ERROR: no security label providers have been loaded
-- clean up objects
DROP FUNCTION seclabel_four();
DROP VIEW seclabel_view1;
DROP TABLE seclabel_tbl1;
DROP TABLE seclabel_tbl2;
-DROP USER seclabel_user1;
-DROP USER seclabel_user2;
+DROP USER regress_seclabel_user1;
+DROP USER regress_seclabel_user2;
-- SELECT INTO and INSERT permission, if owner is not allowed to insert.
--
CREATE SCHEMA selinto_schema;
-CREATE USER selinto_user;
-ALTER DEFAULT PRIVILEGES FOR ROLE selinto_user
- REVOKE INSERT ON TABLES FROM selinto_user;
+CREATE USER regress_selinto_user;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ REVOKE INSERT ON TABLES FROM regress_selinto_user;
GRANT ALL ON SCHEMA selinto_schema TO public;
-SET SESSION AUTHORIZATION selinto_user;
+SET SESSION AUTHORIZATION regress_selinto_user;
SELECT * INTO TABLE selinto_schema.tmp1
FROM pg_class WHERE relname like '%a%'; -- Error
ERROR: permission denied for relation tmp1
WHERE relname like '%c%'; -- Error
ERROR: permission denied for relation tmp3
RESET SESSION AUTHORIZATION;
-ALTER DEFAULT PRIVILEGES FOR ROLE selinto_user
- GRANT INSERT ON TABLES TO selinto_user;
-SET SESSION AUTHORIZATION selinto_user;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ GRANT INSERT ON TABLES TO regress_selinto_user;
+SET SESSION AUTHORIZATION regress_selinto_user;
SELECT * INTO TABLE selinto_schema.tmp1
FROM pg_class WHERE relname like '%a%'; -- OK
SELECT oid AS clsoid, relname, relnatts + 10 AS x
DETAIL: drop cascades to table selinto_schema.tmp1
drop cascades to table selinto_schema.tmp2
drop cascades to table selinto_schema.tmp3
-DROP USER selinto_user;
+DROP USER regress_selinto_user;
-- Tests for WITH NO DATA and column name consistency
CREATE TABLE ctas_base (i int, j int);
INSERT INTO ctas_base VALUES (1, 2);
-- should fail
SELECT lastval();
ERROR: lastval is not yet defined in this session
-CREATE USER seq_user;
+CREATE USER regress_seq_user;
-- privileges tests
-- nextval
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT SELECT ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT SELECT ON seq3 TO regress_seq_user;
SELECT nextval('seq3');
ERROR: permission denied for sequence seq3
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT UPDATE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT UPDATE ON seq3 TO regress_seq_user;
SELECT nextval('seq3');
nextval
---------
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT USAGE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT USAGE ON seq3 TO regress_seq_user;
SELECT nextval('seq3');
nextval
---------
ROLLBACK;
-- currval
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT SELECT ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT SELECT ON seq3 TO regress_seq_user;
SELECT currval('seq3');
currval
---------
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT UPDATE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT UPDATE ON seq3 TO regress_seq_user;
SELECT currval('seq3');
ERROR: permission denied for sequence seq3
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT USAGE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT USAGE ON seq3 TO regress_seq_user;
SELECT currval('seq3');
currval
---------
ROLLBACK;
-- lastval
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT SELECT ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT SELECT ON seq3 TO regress_seq_user;
SELECT lastval();
lastval
---------
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT UPDATE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT UPDATE ON seq3 TO regress_seq_user;
SELECT lastval();
ERROR: permission denied for sequence seq3
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT USAGE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT USAGE ON seq3 TO regress_seq_user;
SELECT lastval();
lastval
---------
regression | public | sequence_test2 | bigint | 64 | 2 | 0 | 32 | 5 | 36 | 4 | YES
(1 row)
-DROP USER seq_user;
+DROP USER regress_seq_user;
DROP SEQUENCE seq;
-- should fail
SELECT lastval();
ERROR: lastval is not yet defined in this session
-CREATE USER seq_user;
+CREATE USER regress_seq_user;
-- privileges tests
-- nextval
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT SELECT ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT SELECT ON seq3 TO regress_seq_user;
SELECT nextval('seq3');
ERROR: permission denied for sequence seq3
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT UPDATE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT UPDATE ON seq3 TO regress_seq_user;
SELECT nextval('seq3');
nextval
---------
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT USAGE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT USAGE ON seq3 TO regress_seq_user;
SELECT nextval('seq3');
nextval
---------
ROLLBACK;
-- currval
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT SELECT ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT SELECT ON seq3 TO regress_seq_user;
SELECT currval('seq3');
currval
---------
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT UPDATE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT UPDATE ON seq3 TO regress_seq_user;
SELECT currval('seq3');
ERROR: permission denied for sequence seq3
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT USAGE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT USAGE ON seq3 TO regress_seq_user;
SELECT currval('seq3');
currval
---------
ROLLBACK;
-- lastval
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT SELECT ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT SELECT ON seq3 TO regress_seq_user;
SELECT lastval();
lastval
---------
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT UPDATE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT UPDATE ON seq3 TO regress_seq_user;
SELECT lastval();
ERROR: permission denied for sequence seq3
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
nextval
1
(1 row)
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT USAGE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT USAGE ON seq3 TO regress_seq_user;
SELECT lastval();
lastval
---------
regression | public | sequence_test2 | bigint | 64 | 2 | 0 | 32 | 5 | 36 | 4 | YES
(1 row)
-DROP USER seq_user;
+DROP USER regress_seq_user;
DROP SEQUENCE seq;
DETAIL: drop cascades to view rw_view1
drop cascades to function rw_view1_aa(rw_view1)
-- permissions checks
-CREATE USER view_user1;
-CREATE USER view_user2;
-SET SESSION AUTHORIZATION view_user1;
+CREATE USER regress_view_user1;
+CREATE USER regress_view_user2;
+SET SESSION AUTHORIZATION regress_view_user1;
CREATE TABLE base_tbl(a int, b text, c float);
INSERT INTO base_tbl VALUES (1, 'Row 1', 1.0);
CREATE VIEW rw_view1 AS SELECT b AS bb, c AS cc, a AS aa FROM base_tbl;
INSERT INTO rw_view1 VALUES ('Row 2', 2.0, 2);
-GRANT SELECT ON base_tbl TO view_user2;
-GRANT SELECT ON rw_view1 TO view_user2;
-GRANT UPDATE (a,c) ON base_tbl TO view_user2;
-GRANT UPDATE (bb,cc) ON rw_view1 TO view_user2;
+GRANT SELECT ON base_tbl TO regress_view_user2;
+GRANT SELECT ON rw_view1 TO regress_view_user2;
+GRANT UPDATE (a,c) ON base_tbl TO regress_view_user2;
+GRANT UPDATE (bb,cc) ON rw_view1 TO regress_view_user2;
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user2;
+SET SESSION AUTHORIZATION regress_view_user2;
CREATE VIEW rw_view2 AS SELECT b AS bb, c AS cc, a AS aa FROM base_tbl;
SELECT * FROM base_tbl; -- ok
a | b | c
DELETE FROM rw_view2; -- not allowed
ERROR: permission denied for relation base_tbl
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user1;
-GRANT INSERT, DELETE ON base_tbl TO view_user2;
+SET SESSION AUTHORIZATION regress_view_user1;
+GRANT INSERT, DELETE ON base_tbl TO regress_view_user2;
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user2;
+SET SESSION AUTHORIZATION regress_view_user2;
INSERT INTO base_tbl VALUES (3, 'Row 3', 3.0); -- ok
INSERT INTO rw_view1 VALUES ('Row 4', 4.0, 4); -- not allowed
ERROR: permission denied for relation rw_view1
(2 rows)
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user1;
-REVOKE INSERT, DELETE ON base_tbl FROM view_user2;
-GRANT INSERT, DELETE ON rw_view1 TO view_user2;
+SET SESSION AUTHORIZATION regress_view_user1;
+REVOKE INSERT, DELETE ON base_tbl FROM regress_view_user2;
+GRANT INSERT, DELETE ON rw_view1 TO regress_view_user2;
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user2;
+SET SESSION AUTHORIZATION regress_view_user2;
INSERT INTO base_tbl VALUES (5, 'Row 5', 5.0); -- not allowed
ERROR: permission denied for relation base_tbl
INSERT INTO rw_view1 VALUES ('Row 5', 5.0, 5); -- ok
NOTICE: drop cascades to 2 other objects
DETAIL: drop cascades to view rw_view1
drop cascades to view rw_view2
-DROP USER view_user1;
-DROP USER view_user2;
+DROP USER regress_view_user1;
+DROP USER regress_view_user2;
-- column defaults
CREATE TABLE base_tbl (a int PRIMARY KEY, b text DEFAULT 'Unspecified', c serial);
INSERT INTO base_tbl VALUES (1, 'Row 1');
INSERT INTO lotest_stash_values (loid) SELECT lo_creat(42);
-- Test ALTER LARGE OBJECT
-CREATE ROLE regresslo;
+CREATE ROLE regress_lo_user;
DO $$
BEGIN
EXECUTE 'ALTER LARGE OBJECT ' || (select loid from lotest_stash_values)
- || ' OWNER TO regresslo';
+ || ' OWNER TO regress_lo_user';
END
$$;
SELECT
DROP TABLE lotest_stash_values;
-DROP ROLE regresslo;
+DROP ROLE regress_lo_user;
-- create a tablespace using WITH clause
-CREATE TABLESPACE testspacewith LOCATION '@testtablespace@' WITH (some_nonexistent_parameter = true); -- fail
-CREATE TABLESPACE testspacewith LOCATION '@testtablespace@' WITH (random_page_cost = 3.0); -- ok
+CREATE TABLESPACE regress_tblspacewith LOCATION '@testtablespace@' WITH (some_nonexistent_parameter = true); -- fail
+CREATE TABLESPACE regress_tblspacewith LOCATION '@testtablespace@' WITH (random_page_cost = 3.0); -- ok
-- check to see the parameter was used
-SELECT spcoptions FROM pg_tablespace WHERE spcname = 'testspacewith';
+SELECT spcoptions FROM pg_tablespace WHERE spcname = 'regress_tblspacewith';
-- drop the tablespace so we can re-use the location
-DROP TABLESPACE testspacewith;
+DROP TABLESPACE regress_tblspacewith;
-- create a tablespace we can use
-CREATE TABLESPACE testspace LOCATION '@testtablespace@';
+CREATE TABLESPACE regress_tblspace LOCATION '@testtablespace@';
-- try setting and resetting some properties for the new tablespace
-ALTER TABLESPACE testspace SET (random_page_cost = 1.0);
-ALTER TABLESPACE testspace SET (some_nonexistent_parameter = true); -- fail
-ALTER TABLESPACE testspace RESET (random_page_cost = 2.0); -- fail
-ALTER TABLESPACE testspace RESET (random_page_cost, seq_page_cost); -- ok
+ALTER TABLESPACE regress_tblspace SET (random_page_cost = 1.0);
+ALTER TABLESPACE regress_tblspace SET (some_nonexistent_parameter = true); -- fail
+ALTER TABLESPACE regress_tblspace RESET (random_page_cost = 2.0); -- fail
+ALTER TABLESPACE regress_tblspace RESET (random_page_cost, seq_page_cost); -- ok
-- create a schema we can use
CREATE SCHEMA testschema;
-- try a table
-CREATE TABLE testschema.foo (i int) TABLESPACE testspace;
+CREATE TABLE testschema.foo (i int) TABLESPACE regress_tblspace;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'foo';
INSERT INTO testschema.foo VALUES(2);
-- tables from dynamic sources
-CREATE TABLE testschema.asselect TABLESPACE testspace AS SELECT 1;
+CREATE TABLE testschema.asselect TABLESPACE regress_tblspace AS SELECT 1;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'asselect';
PREPARE selectsource(int) AS SELECT $1;
-CREATE TABLE testschema.asexecute TABLESPACE testspace
+CREATE TABLE testschema.asexecute TABLESPACE regress_tblspace
AS EXECUTE selectsource(2);
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'asexecute';
-- index
-CREATE INDEX foo_idx on testschema.foo(i) TABLESPACE testspace;
+CREATE INDEX foo_idx on testschema.foo(i) TABLESPACE regress_tblspace;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'foo_idx';
CREATE TABLE testschema.atable AS VALUES (1), (2);
CREATE UNIQUE INDEX anindex ON testschema.atable(column1);
-ALTER TABLE testschema.atable SET TABLESPACE testspace;
-ALTER INDEX testschema.anindex SET TABLESPACE testspace;
+ALTER TABLE testschema.atable SET TABLESPACE regress_tblspace;
+ALTER INDEX testschema.anindex SET TABLESPACE regress_tblspace;
INSERT INTO testschema.atable VALUES(3); -- ok
INSERT INTO testschema.atable VALUES(1); -- fail (checks index)
SELECT COUNT(*) FROM testschema.atable; -- checks heap
-- Will fail with bad path
-CREATE TABLESPACE badspace LOCATION '/no/such/location';
+CREATE TABLESPACE regress_badspace LOCATION '/no/such/location';
-- No such tablespace
-CREATE TABLE bar (i int) TABLESPACE nosuchspace;
+CREATE TABLE bar (i int) TABLESPACE regress_nosuchspace;
-- Fail, not empty
-DROP TABLESPACE testspace;
+DROP TABLESPACE regress_tblspace;
-CREATE ROLE tablespace_testuser1 login;
-CREATE ROLE tablespace_testuser2 login;
+CREATE ROLE regress_tablespace_user1 login;
+CREATE ROLE regress_tablespace_user2 login;
-ALTER TABLESPACE testspace OWNER TO tablespace_testuser1;
+ALTER TABLESPACE regress_tblspace OWNER TO regress_tablespace_user1;
-SET SESSION ROLE tablespace_testuser2;
-CREATE TABLE tablespace_table (i int) TABLESPACE testspace; -- fail
+SET SESSION ROLE regress_tablespace_user2;
+CREATE TABLE tablespace_table (i int) TABLESPACE regress_tblspace; -- fail
RESET ROLE;
-ALTER TABLESPACE testspace RENAME TO testspace_renamed;
+ALTER TABLESPACE regress_tblspace RENAME TO regress_tblspace_renamed;
-ALTER TABLE ALL IN TABLESPACE testspace_renamed SET TABLESPACE pg_default;
-ALTER INDEX ALL IN TABLESPACE testspace_renamed SET TABLESPACE pg_default;
+ALTER TABLE ALL IN TABLESPACE regress_tblspace_renamed SET TABLESPACE pg_default;
+ALTER INDEX ALL IN TABLESPACE regress_tblspace_renamed SET TABLESPACE pg_default;
-- Should show notice that nothing was done
-ALTER TABLE ALL IN TABLESPACE testspace_renamed SET TABLESPACE pg_default;
+ALTER TABLE ALL IN TABLESPACE regress_tblspace_renamed SET TABLESPACE pg_default;
-- Should succeed
-DROP TABLESPACE testspace_renamed;
+DROP TABLESPACE regress_tblspace_renamed;
DROP SCHEMA testschema CASCADE;
-DROP ROLE tablespace_testuser1;
-DROP ROLE tablespace_testuser2;
+DROP ROLE regress_tablespace_user1;
+DROP ROLE regress_tablespace_user2;
-- returns the large object id
INSERT INTO lotest_stash_values (loid) SELECT lo_creat(42);
-- Test ALTER LARGE OBJECT
-CREATE ROLE regresslo;
+CREATE ROLE regress_lo_user;
DO $$
BEGIN
EXECUTE 'ALTER LARGE OBJECT ' || (select loid from lotest_stash_values)
- || ' OWNER TO regresslo';
+ || ' OWNER TO regress_lo_user';
END
$$;
SELECT
lotest_stash_values s
JOIN pg_largeobject_metadata lo ON s.loid = lo.oid
JOIN pg_authid rol ON lo.lomowner = rol.oid;
- rolname
------------
- regresslo
+ rolname
+-----------------
+ regress_lo_user
(1 row)
-- NOTE: large objects require transactions
(1 row)
DROP TABLE lotest_stash_values;
-DROP ROLE regresslo;
+DROP ROLE regress_lo_user;
-- returns the large object id
INSERT INTO lotest_stash_values (loid) SELECT lo_creat(42);
-- Test ALTER LARGE OBJECT
-CREATE ROLE regresslo;
+CREATE ROLE regress_lo_user;
DO $$
BEGIN
EXECUTE 'ALTER LARGE OBJECT ' || (select loid from lotest_stash_values)
- || ' OWNER TO regresslo';
+ || ' OWNER TO regress_lo_user';
END
$$;
SELECT
lotest_stash_values s
JOIN pg_largeobject_metadata lo ON s.loid = lo.oid
JOIN pg_authid rol ON lo.lomowner = rol.oid;
- rolname
------------
- regresslo
+ rolname
+-----------------
+ regress_lo_user
(1 row)
-- NOTE: large objects require transactions
(1 row)
DROP TABLE lotest_stash_values;
-DROP ROLE regresslo;
+DROP ROLE regress_lo_user;
-- create a tablespace using WITH clause
-CREATE TABLESPACE testspacewith LOCATION '@testtablespace@' WITH (some_nonexistent_parameter = true); -- fail
+CREATE TABLESPACE regress_tblspacewith LOCATION '@testtablespace@' WITH (some_nonexistent_parameter = true); -- fail
ERROR: unrecognized parameter "some_nonexistent_parameter"
-CREATE TABLESPACE testspacewith LOCATION '@testtablespace@' WITH (random_page_cost = 3.0); -- ok
+CREATE TABLESPACE regress_tblspacewith LOCATION '@testtablespace@' WITH (random_page_cost = 3.0); -- ok
-- check to see the parameter was used
-SELECT spcoptions FROM pg_tablespace WHERE spcname = 'testspacewith';
+SELECT spcoptions FROM pg_tablespace WHERE spcname = 'regress_tblspacewith';
spcoptions
------------------------
{random_page_cost=3.0}
(1 row)
-- drop the tablespace so we can re-use the location
-DROP TABLESPACE testspacewith;
+DROP TABLESPACE regress_tblspacewith;
-- create a tablespace we can use
-CREATE TABLESPACE testspace LOCATION '@testtablespace@';
+CREATE TABLESPACE regress_tblspace LOCATION '@testtablespace@';
-- try setting and resetting some properties for the new tablespace
-ALTER TABLESPACE testspace SET (random_page_cost = 1.0);
-ALTER TABLESPACE testspace SET (some_nonexistent_parameter = true); -- fail
+ALTER TABLESPACE regress_tblspace SET (random_page_cost = 1.0);
+ALTER TABLESPACE regress_tblspace SET (some_nonexistent_parameter = true); -- fail
ERROR: unrecognized parameter "some_nonexistent_parameter"
-ALTER TABLESPACE testspace RESET (random_page_cost = 2.0); -- fail
+ALTER TABLESPACE regress_tblspace RESET (random_page_cost = 2.0); -- fail
ERROR: RESET must not include values for parameters
-ALTER TABLESPACE testspace RESET (random_page_cost, seq_page_cost); -- ok
+ALTER TABLESPACE regress_tblspace RESET (random_page_cost, seq_page_cost); -- ok
-- create a schema we can use
CREATE SCHEMA testschema;
-- try a table
-CREATE TABLE testschema.foo (i int) TABLESPACE testspace;
+CREATE TABLE testschema.foo (i int) TABLESPACE regress_tblspace;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'foo';
- relname | spcname
----------+-----------
- foo | testspace
+ relname | spcname
+---------+------------------
+ foo | regress_tblspace
(1 row)
INSERT INTO testschema.foo VALUES(1);
INSERT INTO testschema.foo VALUES(2);
-- tables from dynamic sources
-CREATE TABLE testschema.asselect TABLESPACE testspace AS SELECT 1;
+CREATE TABLE testschema.asselect TABLESPACE regress_tblspace AS SELECT 1;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'asselect';
- relname | spcname
-----------+-----------
- asselect | testspace
+ relname | spcname
+----------+------------------
+ asselect | regress_tblspace
(1 row)
PREPARE selectsource(int) AS SELECT $1;
-CREATE TABLE testschema.asexecute TABLESPACE testspace
+CREATE TABLE testschema.asexecute TABLESPACE regress_tblspace
AS EXECUTE selectsource(2);
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'asexecute';
- relname | spcname
------------+-----------
- asexecute | testspace
+ relname | spcname
+-----------+------------------
+ asexecute | regress_tblspace
(1 row)
-- index
-CREATE INDEX foo_idx on testschema.foo(i) TABLESPACE testspace;
+CREATE INDEX foo_idx on testschema.foo(i) TABLESPACE regress_tblspace;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'foo_idx';
- relname | spcname
----------+-----------
- foo_idx | testspace
+ relname | spcname
+---------+------------------
+ foo_idx | regress_tblspace
(1 row)
-- let's try moving a table from one place to another
CREATE TABLE testschema.atable AS VALUES (1), (2);
CREATE UNIQUE INDEX anindex ON testschema.atable(column1);
-ALTER TABLE testschema.atable SET TABLESPACE testspace;
-ALTER INDEX testschema.anindex SET TABLESPACE testspace;
+ALTER TABLE testschema.atable SET TABLESPACE regress_tblspace;
+ALTER INDEX testschema.anindex SET TABLESPACE regress_tblspace;
INSERT INTO testschema.atable VALUES(3); -- ok
INSERT INTO testschema.atable VALUES(1); -- fail (checks index)
ERROR: duplicate key value violates unique constraint "anindex"
(1 row)
-- Will fail with bad path
-CREATE TABLESPACE badspace LOCATION '/no/such/location';
+CREATE TABLESPACE regress_badspace LOCATION '/no/such/location';
ERROR: directory "/no/such/location" does not exist
-- No such tablespace
-CREATE TABLE bar (i int) TABLESPACE nosuchspace;
-ERROR: tablespace "nosuchspace" does not exist
+CREATE TABLE bar (i int) TABLESPACE regress_nosuchspace;
+ERROR: tablespace "regress_nosuchspace" does not exist
-- Fail, not empty
-DROP TABLESPACE testspace;
-ERROR: tablespace "testspace" is not empty
-CREATE ROLE tablespace_testuser1 login;
-CREATE ROLE tablespace_testuser2 login;
-ALTER TABLESPACE testspace OWNER TO tablespace_testuser1;
-SET SESSION ROLE tablespace_testuser2;
-CREATE TABLE tablespace_table (i int) TABLESPACE testspace; -- fail
-ERROR: permission denied for tablespace testspace
+DROP TABLESPACE regress_tblspace;
+ERROR: tablespace "regress_tblspace" is not empty
+CREATE ROLE regress_tablespace_user1 login;
+CREATE ROLE regress_tablespace_user2 login;
+ALTER TABLESPACE regress_tblspace OWNER TO regress_tablespace_user1;
+SET SESSION ROLE regress_tablespace_user2;
+CREATE TABLE tablespace_table (i int) TABLESPACE regress_tblspace; -- fail
+ERROR: permission denied for tablespace regress_tblspace
RESET ROLE;
-ALTER TABLESPACE testspace RENAME TO testspace_renamed;
-ALTER TABLE ALL IN TABLESPACE testspace_renamed SET TABLESPACE pg_default;
-ALTER INDEX ALL IN TABLESPACE testspace_renamed SET TABLESPACE pg_default;
+ALTER TABLESPACE regress_tblspace RENAME TO regress_tblspace_renamed;
+ALTER TABLE ALL IN TABLESPACE regress_tblspace_renamed SET TABLESPACE pg_default;
+ALTER INDEX ALL IN TABLESPACE regress_tblspace_renamed SET TABLESPACE pg_default;
-- Should show notice that nothing was done
-ALTER TABLE ALL IN TABLESPACE testspace_renamed SET TABLESPACE pg_default;
-NOTICE: no matching relations in tablespace "testspace_renamed" found
+ALTER TABLE ALL IN TABLESPACE regress_tblspace_renamed SET TABLESPACE pg_default;
+NOTICE: no matching relations in tablespace "regress_tblspace_renamed" found
-- Should succeed
-DROP TABLESPACE testspace_renamed;
+DROP TABLESPACE regress_tblspace_renamed;
DROP SCHEMA testschema CASCADE;
NOTICE: drop cascades to 4 other objects
DETAIL: drop cascades to table testschema.foo
drop cascades to table testschema.asselect
drop cascades to table testschema.asexecute
drop cascades to table testschema.atable
-DROP ROLE tablespace_testuser1;
-DROP ROLE tablespace_testuser2;
+DROP ROLE regress_tablespace_user1;
+DROP ROLE regress_tablespace_user2;
-- Clean up in case a prior regression run failed
SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS regtest_alter_user1;
-DROP ROLE IF EXISTS regtest_alter_user2;
-DROP ROLE IF EXISTS regtest_alter_user3;
+DROP ROLE IF EXISTS regress_alter_user1;
+DROP ROLE IF EXISTS regress_alter_user2;
+DROP ROLE IF EXISTS regress_alter_user3;
RESET client_min_messages;
-CREATE USER regtest_alter_user3;
-CREATE USER regtest_alter_user2;
-CREATE USER regtest_alter_user1 IN ROLE regtest_alter_user3;
+CREATE USER regress_alter_user3;
+CREATE USER regress_alter_user2;
+CREATE USER regress_alter_user1 IN ROLE regress_alter_user3;
CREATE SCHEMA alt_nsp1;
CREATE SCHEMA alt_nsp2;
--
-- Function and Aggregate
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE FUNCTION alt_func1(int) RETURNS int LANGUAGE sql
AS 'SELECT $1 + 1';
CREATE FUNCTION alt_func2(int) RETURNS int LANGUAGE sql
sfunc1 = int4mi, basetype = int4, stype1 = int4, initcond = 0
);
ALTER AGGREGATE alt_func1(int) RENAME TO alt_func3; -- failed (not aggregate)
-ALTER AGGREGATE alt_func1(int) OWNER TO regtest_alter_user3; -- failed (not aggregate)
+ALTER AGGREGATE alt_func1(int) OWNER TO regress_alter_user3; -- failed (not aggregate)
ALTER AGGREGATE alt_func1(int) SET SCHEMA alt_nsp2; -- failed (not aggregate)
ALTER FUNCTION alt_func1(int) RENAME TO alt_func2; -- failed (name conflict)
ALTER FUNCTION alt_func1(int) RENAME TO alt_func3; -- OK
-ALTER FUNCTION alt_func2(int) OWNER TO regtest_alter_user2; -- failed (no role membership)
-ALTER FUNCTION alt_func2(int) OWNER TO regtest_alter_user3; -- OK
+ALTER FUNCTION alt_func2(int) OWNER TO regress_alter_user2; -- failed (no role membership)
+ALTER FUNCTION alt_func2(int) OWNER TO regress_alter_user3; -- OK
ALTER FUNCTION alt_func2(int) SET SCHEMA alt_nsp1; -- OK, already there
ALTER FUNCTION alt_func2(int) SET SCHEMA alt_nsp2; -- OK
ALTER AGGREGATE alt_agg1(int) RENAME TO alt_agg2; -- failed (name conflict)
ALTER AGGREGATE alt_agg1(int) RENAME TO alt_agg3; -- OK
-ALTER AGGREGATE alt_agg2(int) OWNER TO regtest_alter_user2; -- failed (no role membership)
-ALTER AGGREGATE alt_agg2(int) OWNER TO regtest_alter_user3; -- OK
+ALTER AGGREGATE alt_agg2(int) OWNER TO regress_alter_user2; -- failed (no role membership)
+ALTER AGGREGATE alt_agg2(int) OWNER TO regress_alter_user3; -- OK
ALTER AGGREGATE alt_agg2(int) SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE FUNCTION alt_func1(int) RETURNS int LANGUAGE sql
AS 'SELECT $1 + 2';
CREATE FUNCTION alt_func2(int) RETURNS int LANGUAGE sql
ALTER FUNCTION alt_func3(int) RENAME TO alt_func4; -- failed (not owner)
ALTER FUNCTION alt_func1(int) RENAME TO alt_func4; -- OK
-ALTER FUNCTION alt_func3(int) OWNER TO regtest_alter_user2; -- failed (not owner)
-ALTER FUNCTION alt_func2(int) OWNER TO regtest_alter_user3; -- failed (no role membership)
+ALTER FUNCTION alt_func3(int) OWNER TO regress_alter_user2; -- failed (not owner)
+ALTER FUNCTION alt_func2(int) OWNER TO regress_alter_user3; -- failed (no role membership)
ALTER FUNCTION alt_func3(int) SET SCHEMA alt_nsp2; -- failed (not owner)
ALTER FUNCTION alt_func2(int) SET SCHEMA alt_nsp2; -- failed (name conflicts)
ALTER AGGREGATE alt_agg3(int) RENAME TO alt_agg4; -- failed (not owner)
ALTER AGGREGATE alt_agg1(int) RENAME TO alt_agg4; -- OK
-ALTER AGGREGATE alt_agg3(int) OWNER TO regtest_alter_user2; -- failed (not owner)
-ALTER AGGREGATE alt_agg2(int) OWNER TO regtest_alter_user3; -- failed (no role membership)
+ALTER AGGREGATE alt_agg3(int) OWNER TO regress_alter_user2; -- failed (not owner)
+ALTER AGGREGATE alt_agg2(int) OWNER TO regress_alter_user3; -- failed (no role membership)
ALTER AGGREGATE alt_agg3(int) SET SCHEMA alt_nsp2; -- failed (not owner)
ALTER AGGREGATE alt_agg2(int) SET SCHEMA alt_nsp2; -- failed (name conflict)
--
-- Conversion
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE CONVERSION alt_conv1 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
CREATE CONVERSION alt_conv2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
ALTER CONVERSION alt_conv1 RENAME TO alt_conv2; -- failed (name conflict)
ALTER CONVERSION alt_conv1 RENAME TO alt_conv3; -- OK
-ALTER CONVERSION alt_conv2 OWNER TO regtest_alter_user2; -- failed (no role membership)
-ALTER CONVERSION alt_conv2 OWNER TO regtest_alter_user3; -- OK
+ALTER CONVERSION alt_conv2 OWNER TO regress_alter_user2; -- failed (no role membership)
+ALTER CONVERSION alt_conv2 OWNER TO regress_alter_user3; -- OK
ALTER CONVERSION alt_conv2 SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE CONVERSION alt_conv1 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
CREATE CONVERSION alt_conv2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
ALTER CONVERSION alt_conv3 RENAME TO alt_conv4; -- failed (not owner)
ALTER CONVERSION alt_conv1 RENAME TO alt_conv4; -- OK
-ALTER CONVERSION alt_conv3 OWNER TO regtest_alter_user2; -- failed (not owner)
-ALTER CONVERSION alt_conv2 OWNER TO regtest_alter_user3; -- failed (no role membership)
+ALTER CONVERSION alt_conv3 OWNER TO regress_alter_user2; -- failed (not owner)
+ALTER CONVERSION alt_conv2 OWNER TO regress_alter_user3; -- failed (no role membership)
ALTER CONVERSION alt_conv3 SET SCHEMA alt_nsp2; -- failed (not owner)
ALTER CONVERSION alt_conv2 SET SCHEMA alt_nsp2; -- failed (name conflict)
CREATE LANGUAGE alt_lang1 HANDLER plpgsql_call_handler;
CREATE LANGUAGE alt_lang2 HANDLER plpgsql_call_handler;
-ALTER LANGUAGE alt_lang1 OWNER TO regtest_alter_user1; -- OK
-ALTER LANGUAGE alt_lang2 OWNER TO regtest_alter_user2; -- OK
+ALTER LANGUAGE alt_lang1 OWNER TO regress_alter_user1; -- OK
+ALTER LANGUAGE alt_lang2 OWNER TO regress_alter_user2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
ALTER LANGUAGE alt_lang1 RENAME TO alt_lang2; -- failed (name conflict)
ALTER LANGUAGE alt_lang2 RENAME TO alt_lang3; -- failed (not owner)
ALTER LANGUAGE alt_lang1 RENAME TO alt_lang3; -- OK
-ALTER LANGUAGE alt_lang2 OWNER TO regtest_alter_user3; -- failed (not owner)
-ALTER LANGUAGE alt_lang3 OWNER TO regtest_alter_user2; -- failed (no role membership)
-ALTER LANGUAGE alt_lang3 OWNER TO regtest_alter_user3; -- OK
+ALTER LANGUAGE alt_lang2 OWNER TO regress_alter_user3; -- failed (not owner)
+ALTER LANGUAGE alt_lang3 OWNER TO regress_alter_user2; -- failed (no role membership)
+ALTER LANGUAGE alt_lang3 OWNER TO regress_alter_user3; -- OK
RESET SESSION AUTHORIZATION;
SELECT lanname, a.rolname
--
-- Operator
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE OPERATOR @-@ ( leftarg = int4, rightarg = int4, procedure = int4mi );
CREATE OPERATOR @+@ ( leftarg = int4, rightarg = int4, procedure = int4pl );
-ALTER OPERATOR @+@(int4, int4) OWNER TO regtest_alter_user2; -- failed (no role membership)
-ALTER OPERATOR @+@(int4, int4) OWNER TO regtest_alter_user3; -- OK
+ALTER OPERATOR @+@(int4, int4) OWNER TO regress_alter_user2; -- failed (no role membership)
+ALTER OPERATOR @+@(int4, int4) OWNER TO regress_alter_user3; -- OK
ALTER OPERATOR @-@(int4, int4) SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE OPERATOR @-@ ( leftarg = int4, rightarg = int4, procedure = int4mi );
-ALTER OPERATOR @+@(int4, int4) OWNER TO regtest_alter_user2; -- failed (not owner)
-ALTER OPERATOR @-@(int4, int4) OWNER TO regtest_alter_user3; -- failed (no role membership)
+ALTER OPERATOR @+@(int4, int4) OWNER TO regress_alter_user2; -- failed (not owner)
+ALTER OPERATOR @-@(int4, int4) OWNER TO regress_alter_user3; -- failed (no role membership)
ALTER OPERATOR @+@(int4, int4) SET SCHEMA alt_nsp2; -- failed (not owner)
-- can't test this: the error message includes the raw oid of namespace
-- ALTER OPERATOR @-@(int4, int4) SET SCHEMA alt_nsp2; -- failed (name conflict)
--
CREATE OPERATOR FAMILY alt_opf1 USING hash;
CREATE OPERATOR FAMILY alt_opf2 USING hash;
-ALTER OPERATOR FAMILY alt_opf1 USING hash OWNER TO regtest_alter_user1;
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user1;
+ALTER OPERATOR FAMILY alt_opf1 USING hash OWNER TO regress_alter_user1;
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user1;
CREATE OPERATOR CLASS alt_opc1 FOR TYPE uuid USING hash AS STORAGE uuid;
CREATE OPERATOR CLASS alt_opc2 FOR TYPE uuid USING hash AS STORAGE uuid;
-ALTER OPERATOR CLASS alt_opc1 USING hash OWNER TO regtest_alter_user1;
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user1;
+ALTER OPERATOR CLASS alt_opc1 USING hash OWNER TO regress_alter_user1;
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user1;
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
ALTER OPERATOR FAMILY alt_opf1 USING hash RENAME TO alt_opf2; -- failed (name conflict)
ALTER OPERATOR FAMILY alt_opf1 USING hash RENAME TO alt_opf3; -- OK
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user2; -- failed (no role membership)
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user3; -- OK
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user2; -- failed (no role membership)
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user3; -- OK
ALTER OPERATOR FAMILY alt_opf2 USING hash SET SCHEMA alt_nsp2; -- OK
ALTER OPERATOR CLASS alt_opc1 USING hash RENAME TO alt_opc2; -- failed (name conflict)
ALTER OPERATOR CLASS alt_opc1 USING hash RENAME TO alt_opc3; -- OK
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user2; -- failed (no role membership)
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user3; -- OK
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user2; -- failed (no role membership)
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user3; -- OK
ALTER OPERATOR CLASS alt_opc2 USING hash SET SCHEMA alt_nsp2; -- OK
RESET SESSION AUTHORIZATION;
CREATE OPERATOR FAMILY alt_opf1 USING hash;
CREATE OPERATOR FAMILY alt_opf2 USING hash;
-ALTER OPERATOR FAMILY alt_opf1 USING hash OWNER TO regtest_alter_user2;
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user2;
+ALTER OPERATOR FAMILY alt_opf1 USING hash OWNER TO regress_alter_user2;
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user2;
CREATE OPERATOR CLASS alt_opc1 FOR TYPE macaddr USING hash AS STORAGE macaddr;
CREATE OPERATOR CLASS alt_opc2 FOR TYPE macaddr USING hash AS STORAGE macaddr;
-ALTER OPERATOR CLASS alt_opc1 USING hash OWNER TO regtest_alter_user2;
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user2;
+ALTER OPERATOR CLASS alt_opc1 USING hash OWNER TO regress_alter_user2;
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user2;
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
ALTER OPERATOR FAMILY alt_opf3 USING hash RENAME TO alt_opf4; -- failed (not owner)
ALTER OPERATOR FAMILY alt_opf1 USING hash RENAME TO alt_opf4; -- OK
-ALTER OPERATOR FAMILY alt_opf3 USING hash OWNER TO regtest_alter_user2; -- failed (not owner)
-ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user3; -- failed (no role membership)
+ALTER OPERATOR FAMILY alt_opf3 USING hash OWNER TO regress_alter_user2; -- failed (not owner)
+ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regress_alter_user3; -- failed (no role membership)
ALTER OPERATOR FAMILY alt_opf3 USING hash SET SCHEMA alt_nsp2; -- failed (not owner)
ALTER OPERATOR FAMILY alt_opf2 USING hash SET SCHEMA alt_nsp2; -- failed (name conflict)
ALTER OPERATOR CLASS alt_opc3 USING hash RENAME TO alt_opc4; -- failed (not owner)
ALTER OPERATOR CLASS alt_opc1 USING hash RENAME TO alt_opc4; -- OK
-ALTER OPERATOR CLASS alt_opc3 USING hash OWNER TO regtest_alter_user2; -- failed (not owner)
-ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user3; -- failed (no role membership)
+ALTER OPERATOR CLASS alt_opc3 USING hash OWNER TO regress_alter_user2; -- failed (not owner)
+ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regress_alter_user3; -- failed (no role membership)
ALTER OPERATOR CLASS alt_opc3 USING hash SET SCHEMA alt_nsp2; -- failed (not owner)
ALTER OPERATOR CLASS alt_opc2 USING hash SET SCHEMA alt_nsp2; -- failed (name conflict)
-- Should fail. Need to be SUPERUSER to do ALTER OPERATOR FAMILY .. ADD / DROP
BEGIN TRANSACTION;
-CREATE ROLE regtest_alter_user5 NOSUPERUSER;
+CREATE ROLE regress_alter_user5 NOSUPERUSER;
CREATE OPERATOR FAMILY alt_opf5 USING btree;
-SET ROLE regtest_alter_user5;
+SET ROLE regress_alter_user5;
ALTER OPERATOR FAMILY alt_opf5 USING btree ADD OPERATOR 1 < (int4, int2), FUNCTION 1 btint42cmp(int4, int2);
RESET ROLE;
DROP OPERATOR FAMILY alt_opf5 USING btree;
-- Should fail. Need rights to namespace for ALTER OPERATOR FAMILY .. ADD / DROP
BEGIN TRANSACTION;
-CREATE ROLE regtest_alter_user6;
+CREATE ROLE regress_alter_user6;
CREATE SCHEMA alt_nsp6;
-REVOKE ALL ON SCHEMA alt_nsp6 FROM regtest_alter_user6;
+REVOKE ALL ON SCHEMA alt_nsp6 FROM regress_alter_user6;
CREATE OPERATOR FAMILY alt_nsp6.alt_opf6 USING btree;
-SET ROLE regtest_alter_user6;
+SET ROLE regress_alter_user6;
ALTER OPERATOR FAMILY alt_nsp6.alt_opf6 USING btree ADD OPERATOR 1 < (int4, int2);
ROLLBACK;
--
-- Text Search Dictionary
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE TEXT SEARCH DICTIONARY alt_ts_dict1 (template=simple);
CREATE TEXT SEARCH DICTIONARY alt_ts_dict2 (template=simple);
ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 RENAME TO alt_ts_dict2; -- failed (name conflict)
ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 RENAME TO alt_ts_dict3; -- OK
-ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regtest_alter_user2; -- failed (no role membership)
-ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regtest_alter_user3; -- OK
+ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regress_alter_user2; -- failed (no role membership)
+ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regress_alter_user3; -- OK
ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE TEXT SEARCH DICTIONARY alt_ts_dict1 (template=simple);
CREATE TEXT SEARCH DICTIONARY alt_ts_dict2 (template=simple);
ALTER TEXT SEARCH DICTIONARY alt_ts_dict3 RENAME TO alt_ts_dict4; -- failed (not owner)
ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 RENAME TO alt_ts_dict4; -- OK
-ALTER TEXT SEARCH DICTIONARY alt_ts_dict3 OWNER TO regtest_alter_user2; -- failed (not owner)
-ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regtest_alter_user3; -- failed (no role membership)
+ALTER TEXT SEARCH DICTIONARY alt_ts_dict3 OWNER TO regress_alter_user2; -- failed (not owner)
+ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 OWNER TO regress_alter_user3; -- failed (no role membership)
ALTER TEXT SEARCH DICTIONARY alt_ts_dict3 SET SCHEMA alt_nsp2; -- failed (not owner)
ALTER TEXT SEARCH DICTIONARY alt_ts_dict2 SET SCHEMA alt_nsp2; -- failed (name conflict)
--
-- Text Search Configuration
--
-SET SESSION AUTHORIZATION regtest_alter_user1;
+SET SESSION AUTHORIZATION regress_alter_user1;
CREATE TEXT SEARCH CONFIGURATION alt_ts_conf1 (copy=english);
CREATE TEXT SEARCH CONFIGURATION alt_ts_conf2 (copy=english);
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 RENAME TO alt_ts_conf2; -- failed (name conflict)
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 RENAME TO alt_ts_conf3; -- OK
-ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regtest_alter_user2; -- failed (no role membership)
-ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regtest_alter_user3; -- OK
+ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regress_alter_user2; -- failed (no role membership)
+ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regress_alter_user3; -- OK
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 SET SCHEMA alt_nsp2; -- OK
-SET SESSION AUTHORIZATION regtest_alter_user2;
+SET SESSION AUTHORIZATION regress_alter_user2;
CREATE TEXT SEARCH CONFIGURATION alt_ts_conf1 (copy=english);
CREATE TEXT SEARCH CONFIGURATION alt_ts_conf2 (copy=english);
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf3 RENAME TO alt_ts_conf4; -- failed (not owner)
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 RENAME TO alt_ts_conf4; -- OK
-ALTER TEXT SEARCH CONFIGURATION alt_ts_conf3 OWNER TO regtest_alter_user2; -- failed (not owner)
-ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regtest_alter_user3; -- failed (no role membership)
+ALTER TEXT SEARCH CONFIGURATION alt_ts_conf3 OWNER TO regress_alter_user2; -- failed (not owner)
+ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 OWNER TO regress_alter_user3; -- failed (no role membership)
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf3 SET SCHEMA alt_nsp2; -- failed (not owner)
ALTER TEXT SEARCH CONFIGURATION alt_ts_conf2 SET SCHEMA alt_nsp2; -- failed (name conflict)
DROP SCHEMA alt_nsp1 CASCADE;
DROP SCHEMA alt_nsp2 CASCADE;
-DROP USER regtest_alter_user1;
-DROP USER regtest_alter_user2;
-DROP USER regtest_alter_user3;
+DROP USER regress_alter_user1;
+DROP USER regress_alter_user2;
+DROP USER regress_alter_user3;
--
-- Test permission check. Must be owner to ALTER OPERATOR.
--
-CREATE USER regtest_alter_user;
-SET SESSION AUTHORIZATION regtest_alter_user;
+CREATE USER regress_alter_op_user;
+SET SESSION AUTHORIZATION regress_alter_op_user;
ALTER OPERATOR === (boolean, boolean) SET (RESTRICT = NONE);
-- Clean up
RESET SESSION AUTHORIZATION;
-DROP USER regtest_alter_user;
+DROP USER regress_alter_op_user;
DROP OPERATOR === (boolean, boolean);
DROP FUNCTION customcontsel(internal, oid, internal, integer);
DROP FUNCTION alter_op_test_fn(boolean, boolean);
AND indisclustered;
-- Verify that clustering all tables does in fact cluster the right ones
-CREATE USER clstr_user;
+CREATE USER regress_clstr_user;
CREATE TABLE clstr_1 (a INT PRIMARY KEY);
CREATE TABLE clstr_2 (a INT PRIMARY KEY);
CREATE TABLE clstr_3 (a INT PRIMARY KEY);
-ALTER TABLE clstr_1 OWNER TO clstr_user;
-ALTER TABLE clstr_3 OWNER TO clstr_user;
-GRANT SELECT ON clstr_2 TO clstr_user;
+ALTER TABLE clstr_1 OWNER TO regress_clstr_user;
+ALTER TABLE clstr_3 OWNER TO regress_clstr_user;
+GRANT SELECT ON clstr_2 TO regress_clstr_user;
INSERT INTO clstr_1 VALUES (2);
INSERT INTO clstr_1 VALUES (1);
INSERT INTO clstr_2 VALUES (2);
-- this user can only cluster clstr_1 and clstr_3, but the latter
-- has not been clustered
-SET SESSION AUTHORIZATION clstr_user;
+SET SESSION AUTHORIZATION regress_clstr_user;
CLUSTER;
SELECT * FROM clstr_1 UNION ALL
SELECT * FROM clstr_2 UNION ALL
DROP TABLE clstr_2;
DROP TABLE clstr_3;
DROP TABLE clstr_4;
-DROP USER clstr_user;
+DROP USER regress_clstr_user;
--
-- create user defined conversion
--
-CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEROLE;
-SET SESSION AUTHORIZATION conversion_test_user;
+CREATE USER regress_conversion_user WITH NOCREATEDB NOCREATEROLE;
+SET SESSION AUTHORIZATION regress_conversion_user;
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
--
-- cannot make same name conversion in same schema
-- return to the super user
--
RESET SESSION AUTHORIZATION;
-DROP USER conversion_test_user;
+DROP USER regress_conversion_user;
--
-- sanity check of pg_proc catalog to the given parameters
--
-CREATE USER regtest_unpriv_user;
+CREATE USER regress_unpriv_user;
CREATE SCHEMA temp_func_test;
GRANT ALL ON SCHEMA temp_func_test TO public;
'functext_E_2'::regproc) ORDER BY proname;
-- it takes superuser privilege to turn on leakproof, but not for turn off
-ALTER FUNCTION functext_E_1(int) OWNER TO regtest_unpriv_user;
-ALTER FUNCTION functext_E_2(int) OWNER TO regtest_unpriv_user;
+ALTER FUNCTION functext_E_1(int) OWNER TO regress_unpriv_user;
+ALTER FUNCTION functext_E_2(int) OWNER TO regress_unpriv_user;
-SET SESSION AUTHORIZATION regtest_unpriv_user;
+SET SESSION AUTHORIZATION regress_unpriv_user;
SET search_path TO temp_func_test, public;
ALTER FUNCTION functext_E_1(int) NOT LEAKPROOF;
ALTER FUNCTION functext_E_2(int) LEAKPROOF;
-- Cleanups
DROP SCHEMA temp_func_test CASCADE;
-DROP USER regtest_unpriv_user;
+DROP USER regress_unpriv_user;
RESET search_path;
END;
-- Failure for unauthorized user
-CREATE ROLE regression_reindexuser NOLOGIN;
-SET SESSION ROLE regression_reindexuser;
+CREATE ROLE regress_reindexuser NOLOGIN;
+SET SESSION ROLE regress_reindexuser;
REINDEX SCHEMA schema_to_reindex;
-- Clean up
RESET ROLE;
-DROP ROLE regression_reindexuser;
+DROP ROLE regress_reindexuser;
SET client_min_messages TO 'warning';
DROP SCHEMA schema_to_reindex CASCADE;
RESET client_min_messages;
-- DEPENDENCIES
--
-CREATE USER regression_user;
-CREATE USER regression_user2;
-CREATE USER regression_user3;
-CREATE GROUP regression_group;
+CREATE USER regress_dep_user;
+CREATE USER regress_dep_user2;
+CREATE USER regress_dep_user3;
+CREATE GROUP regress_dep_group;
CREATE TABLE deptest (f1 serial primary key, f2 text);
-GRANT SELECT ON TABLE deptest TO GROUP regression_group;
-GRANT ALL ON TABLE deptest TO regression_user, regression_user2;
+GRANT SELECT ON TABLE deptest TO GROUP regress_dep_group;
+GRANT ALL ON TABLE deptest TO regress_dep_user, regress_dep_user2;
-- can't drop neither because they have privileges somewhere
-DROP USER regression_user;
-DROP GROUP regression_group;
+DROP USER regress_dep_user;
+DROP GROUP regress_dep_group;
-- if we revoke the privileges we can drop the group
-REVOKE SELECT ON deptest FROM GROUP regression_group;
-DROP GROUP regression_group;
+REVOKE SELECT ON deptest FROM GROUP regress_dep_group;
+DROP GROUP regress_dep_group;
-- can't drop the user if we revoke the privileges partially
-REVOKE SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES ON deptest FROM regression_user;
-DROP USER regression_user;
+REVOKE SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES ON deptest FROM regress_dep_user;
+DROP USER regress_dep_user;
-- now we are OK to drop him
-REVOKE TRIGGER ON deptest FROM regression_user;
-DROP USER regression_user;
+REVOKE TRIGGER ON deptest FROM regress_dep_user;
+DROP USER regress_dep_user;
-- we are OK too if we drop the privileges all at once
-REVOKE ALL ON deptest FROM regression_user2;
-DROP USER regression_user2;
+REVOKE ALL ON deptest FROM regress_dep_user2;
+DROP USER regress_dep_user2;
-- can't drop the owner of an object
-- the error message detail here would include a pg_toast_nnn name that
-- is not constant, so suppress it
\set VERBOSITY terse
-ALTER TABLE deptest OWNER TO regression_user3;
-DROP USER regression_user3;
+ALTER TABLE deptest OWNER TO regress_dep_user3;
+DROP USER regress_dep_user3;
\set VERBOSITY default
-- if we drop the object, we can drop the user too
DROP TABLE deptest;
-DROP USER regression_user3;
+DROP USER regress_dep_user3;
-- Test DROP OWNED
-CREATE USER regression_user0;
-CREATE USER regression_user1;
-CREATE USER regression_user2;
-SET SESSION AUTHORIZATION regression_user0;
+CREATE USER regress_dep_user0;
+CREATE USER regress_dep_user1;
+CREATE USER regress_dep_user2;
+SET SESSION AUTHORIZATION regress_dep_user0;
-- permission denied
-DROP OWNED BY regression_user1;
-DROP OWNED BY regression_user0, regression_user2;
-REASSIGN OWNED BY regression_user0 TO regression_user1;
-REASSIGN OWNED BY regression_user1 TO regression_user0;
+DROP OWNED BY regress_dep_user1;
+DROP OWNED BY regress_dep_user0, regress_dep_user2;
+REASSIGN OWNED BY regress_dep_user0 TO regress_dep_user1;
+REASSIGN OWNED BY regress_dep_user1 TO regress_dep_user0;
-- this one is allowed
-DROP OWNED BY regression_user0;
+DROP OWNED BY regress_dep_user0;
CREATE TABLE deptest1 (f1 int unique);
-GRANT ALL ON deptest1 TO regression_user1 WITH GRANT OPTION;
+GRANT ALL ON deptest1 TO regress_dep_user1 WITH GRANT OPTION;
-SET SESSION AUTHORIZATION regression_user1;
+SET SESSION AUTHORIZATION regress_dep_user1;
CREATE TABLE deptest (a serial primary key, b text);
-GRANT ALL ON deptest1 TO regression_user2;
+GRANT ALL ON deptest1 TO regress_dep_user2;
RESET SESSION AUTHORIZATION;
\z deptest1
-DROP OWNED BY regression_user1;
+DROP OWNED BY regress_dep_user1;
-- all grants revoked
\z deptest1
-- table was dropped
\d deptest
-- Test REASSIGN OWNED
-GRANT ALL ON deptest1 TO regression_user1;
-GRANT CREATE ON DATABASE regression TO regression_user1;
+GRANT ALL ON deptest1 TO regress_dep_user1;
+GRANT CREATE ON DATABASE regression TO regress_dep_user1;
-SET SESSION AUTHORIZATION regression_user1;
+SET SESSION AUTHORIZATION regress_dep_user1;
CREATE SCHEMA deptest;
CREATE TABLE deptest (a serial primary key, b text);
-ALTER DEFAULT PRIVILEGES FOR ROLE regression_user1 IN SCHEMA deptest
- GRANT ALL ON TABLES TO regression_user2;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_dep_user1 IN SCHEMA deptest
+ GRANT ALL ON TABLES TO regress_dep_user2;
CREATE FUNCTION deptest_func() RETURNS void LANGUAGE plpgsql
AS $$ BEGIN END; $$;
CREATE TYPE deptest_enum AS ENUM ('red');
FROM pg_type JOIN pg_class c ON typrelid = c.oid WHERE typname = 'deptest_t';
RESET SESSION AUTHORIZATION;
-REASSIGN OWNED BY regression_user1 TO regression_user2;
+REASSIGN OWNED BY regress_dep_user1 TO regress_dep_user2;
\dt deptest
SELECT typowner = relowner
FROM pg_type JOIN pg_class c ON typrelid = c.oid WHERE typname = 'deptest_t';
-- doesn't work: grant still exists
-DROP USER regression_user1;
-DROP OWNED BY regression_user1;
-DROP USER regression_user1;
+DROP USER regress_dep_user1;
+DROP OWNED BY regress_dep_user1;
+DROP USER regress_dep_user1;
\set VERBOSITY terse
-DROP USER regression_user2;
-DROP OWNED BY regression_user2, regression_user0;
-DROP USER regression_user2;
-DROP USER regression_user0;
+DROP USER regress_dep_user2;
+DROP OWNED BY regress_dep_user2, regress_dep_user0;
+DROP USER regress_dep_user2;
+DROP USER regress_dep_user0;
--- role/user/group
---
-CREATE USER tu1;
-CREATE ROLE tr1;
-CREATE GROUP tg1;
+CREATE USER regress_test_u1;
+CREATE ROLE regress_test_r1;
+CREATE GROUP regress_test_g1;
-DROP USER tu2;
+DROP USER regress_test_u2;
-DROP USER IF EXISTS tu1, tu2;
+DROP USER IF EXISTS regress_test_u1, regress_test_u2;
-DROP USER tu1;
+DROP USER regress_test_u1;
-DROP ROLE tr2;
+DROP ROLE regress_test_r2;
-DROP ROLE IF EXISTS tr1, tr2;
+DROP ROLE IF EXISTS regress_test_r1, regress_test_r2;
-DROP ROLE tr1;
+DROP ROLE regress_test_r1;
-DROP GROUP tg2;
+DROP GROUP regress_test_g2;
-DROP GROUP IF EXISTS tg1, tg2;
+DROP GROUP IF EXISTS regress_test_g1, regress_test_g2;
-DROP GROUP tg1;
+DROP GROUP regress_test_g1;
-- collation
DROP COLLATION IF EXISTS test_collation_exists;
comment on event trigger wrong.regress_event_trigger is 'test comment';
-- drop as non-superuser should fail
-create role regression_bob;
-set role regression_bob;
+create role regress_evt_user;
+set role regress_evt_user;
create event trigger regress_event_trigger_noperms on ddl_command_start
execute procedure test_event_trigger();
reset role;
drop table event_trigger_fire1;
create foreign data wrapper useless;
create server useless_server foreign data wrapper useless;
-create user mapping for regression_bob server useless_server;
-alter default privileges for role regression_bob
- revoke delete on tables from regression_bob;
+create user mapping for regress_evt_user server useless_server;
+alter default privileges for role regress_evt_user
+ revoke delete on tables from regress_evt_user;
-- alter owner to non-superuser should fail
-alter event trigger regress_event_trigger owner to regression_bob;
+alter event trigger regress_event_trigger owner to regress_evt_user;
-- alter owner to superuser should work
-alter role regression_bob superuser;
-alter event trigger regress_event_trigger owner to regression_bob;
+alter role regress_evt_user superuser;
+alter event trigger regress_event_trigger owner to regress_evt_user;
-- should fail, name collision
alter event trigger regress_event_trigger rename to regress_event_trigger2;
-- should fail, doesn't exist any more
drop event trigger regress_event_trigger;
--- should fail, regression_bob owns some objects
-drop role regression_bob;
+-- should fail, regress_evt_user owns some objects
+drop role regress_evt_user;
-- cleanup before next test
-- these are all OK; the second one should emit a NOTICE
drop event trigger regress_event_trigger_end;
-- test support for dropped objects
-CREATE SCHEMA schema_one authorization regression_bob;
-CREATE SCHEMA schema_two authorization regression_bob;
-CREATE SCHEMA audit_tbls authorization regression_bob;
+CREATE SCHEMA schema_one authorization regress_evt_user;
+CREATE SCHEMA schema_two authorization regress_evt_user;
+CREATE SCHEMA audit_tbls authorization regress_evt_user;
CREATE TEMP TABLE a_temp_tbl ();
-SET SESSION AUTHORIZATION regression_bob;
+SET SESSION AUTHORIZATION regress_evt_user;
CREATE TABLE schema_one.table_one(a int);
CREATE TABLE schema_one."table two"(a int);
SELECT * FROM dropped_objects WHERE schema IS NULL OR schema <> 'pg_toast';
-DROP OWNED BY regression_bob;
+DROP OWNED BY regress_evt_user;
SELECT * FROM dropped_objects WHERE type = 'schema';
-DROP ROLE regression_bob;
+DROP ROLE regress_evt_user;
DROP EVENT TRIGGER regress_event_trigger_drop_objects;
DROP EVENT TRIGGER undroppable;
-- Clean up in case a prior regression run failed
-- Suppress NOTICE messages when roles don't exist
-SET client_min_messages TO 'error';
+SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS foreign_data_user, regress_test_role, regress_test_role2, regress_test_role_super, regress_test_indirect, unpriviled_role;
+DROP ROLE IF EXISTS regress_foreign_data_user, regress_test_role, regress_test_role2, regress_test_role_super, regress_test_indirect, regress_unprivileged_role;
RESET client_min_messages;
-CREATE ROLE foreign_data_user LOGIN SUPERUSER;
-SET SESSION AUTHORIZATION 'foreign_data_user';
+CREATE ROLE regress_foreign_data_user LOGIN SUPERUSER;
+SET SESSION AUTHORIZATION 'regress_foreign_data_user';
CREATE ROLE regress_test_role;
CREATE ROLE regress_test_role2;
CREATE ROLE regress_test_role_super SUPERUSER;
CREATE ROLE regress_test_indirect;
-CREATE ROLE unprivileged_role;
+CREATE ROLE regress_unprivileged_role;
CREATE FOREIGN DATA WRAPPER dummy;
COMMENT ON FOREIGN DATA WRAPPER dummy IS 'useless';
ALTER FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator;
-- Privileges
-SET ROLE unprivileged_role;
+SET ROLE regress_unprivileged_role;
CREATE FOREIGN DATA WRAPPER foobar; -- ERROR
ALTER FOREIGN DATA WRAPPER foo OPTIONS (gotcha 'true'); -- ERROR
-ALTER FOREIGN DATA WRAPPER foo OWNER TO unprivileged_role; -- ERROR
+ALTER FOREIGN DATA WRAPPER foo OWNER TO regress_unprivileged_role; -- ERROR
DROP FOREIGN DATA WRAPPER foo; -- ERROR
GRANT USAGE ON FOREIGN DATA WRAPPER foo TO regress_test_role; -- ERROR
CREATE SERVER s9 FOREIGN DATA WRAPPER foo; -- ERROR
ALTER SERVER s4 VERSION '0.5'; -- ERROR
-ALTER SERVER s4 OWNER TO unprivileged_role; -- ERROR
+ALTER SERVER s4 OWNER TO regress_unprivileged_role; -- ERROR
DROP SERVER s4; -- ERROR
GRANT USAGE ON FOREIGN SERVER s4 TO regress_test_role; -- ERROR
CREATE USER MAPPING FOR public SERVER s4; -- ERROR
DROP USER MAPPING FOR regress_test_role SERVER s6; -- ERROR
RESET ROLE;
-GRANT USAGE ON FOREIGN DATA WRAPPER postgresql TO unprivileged_role;
-GRANT USAGE ON FOREIGN DATA WRAPPER foo TO unprivileged_role WITH GRANT OPTION;
-SET ROLE unprivileged_role;
+GRANT USAGE ON FOREIGN DATA WRAPPER postgresql TO regress_unprivileged_role;
+GRANT USAGE ON FOREIGN DATA WRAPPER foo TO regress_unprivileged_role WITH GRANT OPTION;
+SET ROLE regress_unprivileged_role;
CREATE FOREIGN DATA WRAPPER foobar; -- ERROR
ALTER FOREIGN DATA WRAPPER foo OPTIONS (gotcha 'true'); -- ERROR
DROP FOREIGN DATA WRAPPER foo; -- ERROR
DROP USER MAPPING FOR regress_test_role SERVER s6; -- ERROR
RESET ROLE;
-REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM unprivileged_role; -- ERROR
-REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM unprivileged_role CASCADE;
-SET ROLE unprivileged_role;
+REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM regress_unprivileged_role; -- ERROR
+REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM regress_unprivileged_role CASCADE;
+SET ROLE regress_unprivileged_role;
GRANT USAGE ON FOREIGN DATA WRAPPER foo TO regress_test_role; -- ERROR
CREATE SERVER s10 FOREIGN DATA WRAPPER foo; -- ERROR
ALTER SERVER s9 VERSION '1.1';
DROP SERVER s9 CASCADE;
RESET ROLE;
CREATE SERVER s9 FOREIGN DATA WRAPPER foo;
-GRANT USAGE ON FOREIGN SERVER s9 TO unprivileged_role;
-SET ROLE unprivileged_role;
+GRANT USAGE ON FOREIGN SERVER s9 TO regress_unprivileged_role;
+SET ROLE regress_unprivileged_role;
ALTER SERVER s9 VERSION '1.2'; -- ERROR
GRANT USAGE ON FOREIGN SERVER s9 TO regress_test_role; -- WARNING
CREATE USER MAPPING FOR current_user SERVER s9;
DROP SERVER s8 CASCADE;
DROP ROLE regress_test_indirect;
DROP ROLE regress_test_role;
-DROP ROLE unprivileged_role; -- ERROR
-REVOKE ALL ON FOREIGN DATA WRAPPER postgresql FROM unprivileged_role;
-DROP ROLE unprivileged_role;
+DROP ROLE regress_unprivileged_role; -- ERROR
+REVOKE ALL ON FOREIGN DATA WRAPPER postgresql FROM regress_unprivileged_role;
+DROP ROLE regress_unprivileged_role;
DROP ROLE regress_test_role2;
DROP FOREIGN DATA WRAPPER postgresql CASCADE;
DROP FOREIGN DATA WRAPPER dummy CASCADE;
\c
-DROP ROLE foreign_data_user;
+DROP ROLE regress_foreign_data_user;
-- At this point we should have no wrappers, no servers, and no mappings.
SELECT fdwname, fdwhandler, fdwvalidator, fdwoptions FROM pg_foreign_data_wrapper;
LISTEN foo_event;
SET vacuum_cost_delay = 13;
CREATE TEMP TABLE tmp_foo (data text) ON COMMIT DELETE ROWS;
-CREATE ROLE temp_reset_user;
-SET SESSION AUTHORIZATION temp_reset_user;
+CREATE ROLE regress_guc_user;
+SET SESSION AUTHORIZATION regress_guc_user;
-- look changes
SELECT pg_listening_channels();
SELECT name FROM pg_prepared_statements;
SELECT name FROM pg_cursors;
SHOW vacuum_cost_delay;
SELECT relname from pg_class where relname = 'tmp_foo';
-SELECT current_user = 'temp_reset_user';
+SELECT current_user = 'regress_guc_user';
-- discard everything
DISCARD ALL;
-- look again
SELECT name FROM pg_cursors;
SHOW vacuum_cost_delay;
SELECT relname from pg_class where relname = 'tmp_foo';
-SELECT current_user = 'temp_reset_user';
-DROP ROLE temp_reset_user;
+SELECT current_user = 'regress_guc_user';
+DROP ROLE regress_guc_user;
--
-- search_path should react to changes in pg_namespace
-- Clean up in case a prior regression run failed
SET client_min_messages TO 'warning';
+DROP ROLE IF EXISTS regress_addr_user;
+RESET client_min_messages;
-DROP ROLE IF EXISTS regtest_addr_user;
-
-CREATE USER regtest_addr_user;
+CREATE USER regress_addr_user;
-- Test generic object addressing/identification functions
CREATE SCHEMA addr_nsp;
CREATE TRIGGER t BEFORE INSERT ON addr_nsp.gentable FOR EACH ROW EXECUTE PROCEDURE addr_nsp.trig();
CREATE POLICY genpol ON addr_nsp.gentable;
CREATE SERVER "integer" FOREIGN DATA WRAPPER addr_fdw;
-CREATE USER MAPPING FOR regtest_addr_user SERVER "integer";
-ALTER DEFAULT PRIVILEGES FOR ROLE regtest_addr_user IN SCHEMA public GRANT ALL ON TABLES TO regtest_addr_user;
-ALTER DEFAULT PRIVILEGES FOR ROLE regtest_addr_user REVOKE DELETE ON TABLES FROM regtest_addr_user;
+CREATE USER MAPPING FOR regress_addr_user SERVER "integer";
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user IN SCHEMA public GRANT ALL ON TABLES TO regress_addr_user;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user REVOKE DELETE ON TABLES FROM regress_addr_user;
CREATE TRANSFORM FOR int LANGUAGE SQL (
FROM SQL WITH FUNCTION varchar_transform(internal),
TO SQL WITH FUNCTION int4recv(internal));
('text search dictionary', '{addr_ts_dict}', '{}'),
('text search template', '{addr_ts_temp}', '{}'),
('text search configuration', '{addr_ts_conf}', '{}'),
- ('role', '{regtest_addr_user}', '{}'),
+ ('role', '{regress_addr_user}', '{}'),
-- database
-- tablespace
('foreign-data wrapper', '{addr_fdw}', '{}'),
('server', '{addr_fserv}', '{}'),
- ('user mapping', '{regtest_addr_user}', '{integer}'),
- ('default acl', '{regtest_addr_user,public}', '{r}'),
- ('default acl', '{regtest_addr_user}', '{r}'),
+ ('user mapping', '{regress_addr_user}', '{integer}'),
+ ('default acl', '{regress_addr_user,public}', '{r}'),
+ ('default acl', '{regress_addr_user}', '{r}'),
-- extension
-- event trigger
('policy', '{addr_nsp, gentable, genpol}', '{}'),
---
--- Cleanup resources
---
+SET client_min_messages TO 'warning';
+
DROP FOREIGN DATA WRAPPER addr_fdw CASCADE;
DROP SCHEMA addr_nsp CASCADE;
-DROP OWNED BY regtest_addr_user;
-DROP USER regtest_addr_user;
+DROP OWNED BY regress_addr_user;
+DROP USER regress_addr_user;
-- Suppress NOTICE messages when users/groups don't exist
SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS regressgroup1;
-DROP ROLE IF EXISTS regressgroup2;
+DROP ROLE IF EXISTS regress_group1;
+DROP ROLE IF EXISTS regress_group2;
-DROP ROLE IF EXISTS regressuser1;
-DROP ROLE IF EXISTS regressuser2;
-DROP ROLE IF EXISTS regressuser3;
-DROP ROLE IF EXISTS regressuser4;
-DROP ROLE IF EXISTS regressuser5;
-DROP ROLE IF EXISTS regressuser6;
+DROP ROLE IF EXISTS regress_user1;
+DROP ROLE IF EXISTS regress_user2;
+DROP ROLE IF EXISTS regress_user3;
+DROP ROLE IF EXISTS regress_user4;
+DROP ROLE IF EXISTS regress_user5;
+DROP ROLE IF EXISTS regress_user6;
SELECT lo_unlink(oid) FROM pg_largeobject_metadata;
-- test proper begins here
-CREATE USER regressuser1;
-CREATE USER regressuser2;
-CREATE USER regressuser3;
-CREATE USER regressuser4;
-CREATE USER regressuser5;
-CREATE USER regressuser5; -- duplicate
+CREATE USER regress_user1;
+CREATE USER regress_user2;
+CREATE USER regress_user3;
+CREATE USER regress_user4;
+CREATE USER regress_user5;
+CREATE USER regress_user5; -- duplicate
-CREATE GROUP regressgroup1;
-CREATE GROUP regressgroup2 WITH USER regressuser1, regressuser2;
+CREATE GROUP regress_group1;
+CREATE GROUP regress_group2 WITH USER regress_user1, regress_user2;
-ALTER GROUP regressgroup1 ADD USER regressuser4;
+ALTER GROUP regress_group1 ADD USER regress_user4;
-ALTER GROUP regressgroup2 ADD USER regressuser2; -- duplicate
-ALTER GROUP regressgroup2 DROP USER regressuser2;
-GRANT regressgroup2 TO regressuser4 WITH ADMIN OPTION;
+ALTER GROUP regress_group2 ADD USER regress_user2; -- duplicate
+ALTER GROUP regress_group2 DROP USER regress_user2;
+GRANT regress_group2 TO regress_user4 WITH ADMIN OPTION;
-- test owner privileges
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
SELECT session_user, current_user;
CREATE TABLE atest1 ( a int, b text );
REVOKE ALL ON atest1 FROM PUBLIC;
SELECT * FROM atest1;
-GRANT ALL ON atest1 TO regressuser2;
-GRANT SELECT ON atest1 TO regressuser3, regressuser4;
+GRANT ALL ON atest1 TO regress_user2;
+GRANT SELECT ON atest1 TO regress_user3, regress_user4;
SELECT * FROM atest1;
CREATE TABLE atest2 (col1 varchar(10), col2 boolean);
-GRANT SELECT ON atest2 TO regressuser2;
-GRANT UPDATE ON atest2 TO regressuser3;
-GRANT INSERT ON atest2 TO regressuser4;
-GRANT TRUNCATE ON atest2 TO regressuser5;
+GRANT SELECT ON atest2 TO regress_user2;
+GRANT UPDATE ON atest2 TO regress_user3;
+GRANT INSERT ON atest2 TO regress_user4;
+GRANT TRUNCATE ON atest2 TO regress_user5;
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT session_user, current_user;
-- try various combinations of queries on atest1 and atest2
SELECT * FROM atest2 WHERE ( col1 IN ( SELECT b FROM atest1 ) );
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
SELECT session_user, current_user;
SELECT * FROM atest1; -- ok
SELECT * FROM atest1 WHERE ( b IN ( SELECT col1 FROM atest2 ) );
SELECT * FROM atest2 WHERE ( col1 IN ( SELECT b FROM atest1 ) );
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
COPY atest2 FROM stdin; -- ok
bar true
\.
-- groups
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
CREATE TABLE atest3 (one int, two int, three int);
-GRANT DELETE ON atest3 TO GROUP regressgroup2;
+GRANT DELETE ON atest3 TO GROUP regress_group2;
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
SELECT * FROM atest3; -- fail
DELETE FROM atest3; -- ok
-- views
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
CREATE VIEW atestv1 AS SELECT * FROM atest1; -- ok
/* The next *should* fail, but it's not implemented that way yet. */
SELECT * FROM atestv1; -- ok
SELECT * FROM atestv2; -- fail
-GRANT SELECT ON atestv1, atestv3 TO regressuser4;
-GRANT SELECT ON atestv2 TO regressuser2;
+GRANT SELECT ON atestv1, atestv3 TO regress_user4;
+GRANT SELECT ON atestv2 TO regress_user2;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT * FROM atestv1; -- ok
SELECT * FROM atestv2; -- fail
CREATE VIEW atestv4 AS SELECT * FROM atestv3; -- nested view
SELECT * FROM atestv4; -- ok
-GRANT SELECT ON atestv4 TO regressuser2;
+GRANT SELECT ON atestv4 TO regress_user2;
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
-- Two complex cases:
SELECT * FROM atestv3; -- fail
-SELECT * FROM atestv4; -- ok (even though regressuser2 cannot access underlying atestv3)
+SELECT * FROM atestv4; -- ok (even though regress_user2 cannot access underlying atestv3)
SELECT * FROM atest2; -- ok
-SELECT * FROM atestv2; -- fail (even though regressuser2 can access underlying atest2)
+SELECT * FROM atestv2; -- fail (even though regress_user2 can access underlying atest2)
-- Test column level permissions
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
CREATE TABLE atest5 (one int, two int unique, three int, four int unique);
CREATE TABLE atest6 (one int, two int, blue int);
-GRANT SELECT (one), INSERT (two), UPDATE (three) ON atest5 TO regressuser4;
-GRANT ALL (one) ON atest5 TO regressuser3;
+GRANT SELECT (one), INSERT (two), UPDATE (three) ON atest5 TO regress_user4;
+GRANT ALL (one) ON atest5 TO regress_user3;
INSERT INTO atest5 VALUES (1,2,3);
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT * FROM atest5; -- fail
SELECT one FROM atest5; -- ok
COPY atest5 (one) TO stdout; -- ok
SELECT atest1.*,atest5.one FROM atest1 JOIN atest5 ON (atest1.a = atest5.one); -- ok
SELECT one, two FROM atest5; -- fail
-SET SESSION AUTHORIZATION regressuser1;
-GRANT SELECT (one,two) ON atest6 TO regressuser4;
+SET SESSION AUTHORIZATION regress_user1;
+GRANT SELECT (one,two) ON atest6 TO regress_user4;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT one, two FROM atest5 NATURAL JOIN atest6; -- fail still
-SET SESSION AUTHORIZATION regressuser1;
-GRANT SELECT (two) ON atest5 TO regressuser4;
+SET SESSION AUTHORIZATION regress_user1;
+GRANT SELECT (two) ON atest5 TO regress_user4;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT one, two FROM atest5 NATURAL JOIN atest6; -- ok now
-- test column-level privileges for INSERT and UPDATE
-- Error. No privs on four
INSERT INTO atest5(three) VALUES (4) ON CONFLICT (four) DO UPDATE set three = 10;
-SET SESSION AUTHORIZATION regressuser1;
-REVOKE ALL (one) ON atest5 FROM regressuser4;
-GRANT SELECT (one,two,blue) ON atest6 TO regressuser4;
+SET SESSION AUTHORIZATION regress_user1;
+REVOKE ALL (one) ON atest5 FROM regress_user4;
+GRANT SELECT (one,two,blue) ON atest6 TO regress_user4;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT one FROM atest5; -- fail
UPDATE atest5 SET one = 1; -- fail
SELECT atest6 FROM atest6; -- ok
COPY atest6 TO stdout; -- ok
-- check error reporting with column privs
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
CREATE TABLE t1 (c1 int, c2 int, c3 int check (c3 < 5), primary key (c1, c2));
-GRANT SELECT (c1) ON t1 TO regressuser2;
-GRANT INSERT (c1, c2, c3) ON t1 TO regressuser2;
-GRANT UPDATE (c1, c2, c3) ON t1 TO regressuser2;
+GRANT SELECT (c1) ON t1 TO regress_user2;
+GRANT INSERT (c1, c2, c3) ON t1 TO regress_user2;
+GRANT UPDATE (c1, c2, c3) ON t1 TO regress_user2;
-- seed data
INSERT INTO t1 VALUES (1, 1, 1);
INSERT INTO t1 VALUES (2, 2, 2);
INSERT INTO t1 VALUES (3, 1, 3);
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
INSERT INTO t1 (c1, c2) VALUES (1, 1); -- fail, but row not shown
UPDATE t1 SET c2 = 1; -- fail, but row not shown
INSERT INTO t1 (c1, c2) VALUES (null, null); -- fail, but see columns being inserted
INSERT INTO t1 (c1) VALUES (5); -- fail, but see columns being inserted or have SELECT
UPDATE t1 SET c3 = 10; -- fail, but see columns with SELECT rights, or being modified
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
DROP TABLE t1;
-- test column-level privileges when involved with DELETE
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
ALTER TABLE atest6 ADD COLUMN three integer;
-GRANT DELETE ON atest5 TO regressuser3;
-GRANT SELECT (two) ON atest5 TO regressuser3;
-REVOKE ALL (one) ON atest5 FROM regressuser3;
-GRANT SELECT (one) ON atest5 TO regressuser4;
+GRANT DELETE ON atest5 TO regress_user3;
+GRANT SELECT (two) ON atest5 TO regress_user3;
+REVOKE ALL (one) ON atest5 FROM regress_user3;
+GRANT SELECT (one) ON atest5 TO regress_user4;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT atest6 FROM atest6; -- fail
SELECT one FROM atest5 NATURAL JOIN atest6; -- fail
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
ALTER TABLE atest6 DROP COLUMN three;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT atest6 FROM atest6; -- ok
SELECT one FROM atest5 NATURAL JOIN atest6; -- ok
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
ALTER TABLE atest6 DROP COLUMN two;
-REVOKE SELECT (one,blue) ON atest6 FROM regressuser4;
+REVOKE SELECT (one,blue) ON atest6 FROM regress_user4;
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT * FROM atest6; -- fail
SELECT 1 FROM atest6; -- fail
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
DELETE FROM atest5 WHERE one = 1; -- fail
DELETE FROM atest5 WHERE two = 2; -- ok
-- check inheritance cases
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
CREATE TABLE atestp1 (f1 int, f2 int) WITH OIDS;
CREATE TABLE atestp2 (fx int, fy int) WITH OIDS;
CREATE TABLE atestc (fz int) INHERITS (atestp1, atestp2);
-GRANT SELECT(fx,fy,oid) ON atestp2 TO regressuser2;
-GRANT SELECT(fx) ON atestc TO regressuser2;
+GRANT SELECT(fx,fy,oid) ON atestp2 TO regress_user2;
+GRANT SELECT(fx) ON atestc TO regress_user2;
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT fx FROM atestp2; -- ok
SELECT fy FROM atestp2; -- ok
SELECT atestp2 FROM atestp2; -- ok
SELECT oid FROM atestp2; -- ok
SELECT fy FROM atestc; -- fail
-SET SESSION AUTHORIZATION regressuser1;
-GRANT SELECT(fy,oid) ON atestc TO regressuser2;
+SET SESSION AUTHORIZATION regress_user1;
+GRANT SELECT(fy,oid) ON atestc TO regress_user2;
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT fx FROM atestp2; -- still ok
SELECT fy FROM atestp2; -- ok
SELECT atestp2 FROM atestp2; -- ok
\c -
REVOKE ALL PRIVILEGES ON LANGUAGE sql FROM PUBLIC;
-GRANT USAGE ON LANGUAGE sql TO regressuser1; -- ok
+GRANT USAGE ON LANGUAGE sql TO regress_user1; -- ok
GRANT USAGE ON LANGUAGE c TO PUBLIC; -- fail
-SET SESSION AUTHORIZATION regressuser1;
-GRANT USAGE ON LANGUAGE sql TO regressuser2; -- fail
+SET SESSION AUTHORIZATION regress_user1;
+GRANT USAGE ON LANGUAGE sql TO regress_user2; -- fail
CREATE FUNCTION testfunc1(int) RETURNS int AS 'select 2 * $1;' LANGUAGE sql;
CREATE FUNCTION testfunc2(int) RETURNS int AS 'select 3 * $1;' LANGUAGE sql;
REVOKE ALL ON FUNCTION testfunc1(int), testfunc2(int) FROM PUBLIC;
-GRANT EXECUTE ON FUNCTION testfunc1(int), testfunc2(int) TO regressuser2;
-GRANT USAGE ON FUNCTION testfunc1(int) TO regressuser3; -- semantic error
-GRANT ALL PRIVILEGES ON FUNCTION testfunc1(int) TO regressuser4;
-GRANT ALL PRIVILEGES ON FUNCTION testfunc_nosuch(int) TO regressuser4;
+GRANT EXECUTE ON FUNCTION testfunc1(int), testfunc2(int) TO regress_user2;
+GRANT USAGE ON FUNCTION testfunc1(int) TO regress_user3; -- semantic error
+GRANT ALL PRIVILEGES ON FUNCTION testfunc1(int) TO regress_user4;
+GRANT ALL PRIVILEGES ON FUNCTION testfunc_nosuch(int) TO regress_user4;
CREATE FUNCTION testfunc4(boolean) RETURNS text
AS 'select col1 from atest2 where col2 = $1;'
LANGUAGE sql SECURITY DEFINER;
-GRANT EXECUTE ON FUNCTION testfunc4(boolean) TO regressuser3;
+GRANT EXECUTE ON FUNCTION testfunc4(boolean) TO regress_user3;
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT testfunc1(5), testfunc2(5); -- ok
CREATE FUNCTION testfunc3(int) RETURNS int AS 'select 2 * $1;' LANGUAGE sql; -- fail
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
SELECT testfunc1(5); -- fail
SELECT col1 FROM atest2 WHERE col2 = true; -- fail
SELECT testfunc4(true); -- ok
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT testfunc1(5); -- ok
DROP FUNCTION testfunc1(int); -- fail
CREATE TYPE testtype1 AS (a int, b text);
REVOKE USAGE ON TYPE testtype1 FROM PUBLIC;
-GRANT USAGE ON TYPE testtype1 TO regressuser2;
-GRANT USAGE ON TYPE _testtype1 TO regressuser2; -- fail
-GRANT USAGE ON DOMAIN testtype1 TO regressuser2; -- fail
+GRANT USAGE ON TYPE testtype1 TO regress_user2;
+GRANT USAGE ON TYPE _testtype1 TO regress_user2; -- fail
+GRANT USAGE ON DOMAIN testtype1 TO regress_user2; -- fail
CREATE DOMAIN testdomain1 AS int;
REVOKE USAGE on DOMAIN testdomain1 FROM PUBLIC;
-GRANT USAGE ON DOMAIN testdomain1 TO regressuser2;
-GRANT USAGE ON TYPE testdomain1 TO regressuser2; -- ok
+GRANT USAGE ON DOMAIN testdomain1 TO regress_user2;
+GRANT USAGE ON TYPE testdomain1 TO regress_user2; -- ok
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
-- commands that should fail
REVOKE ALL ON TYPE testtype1 FROM PUBLIC;
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
-- commands that should succeed
-- truncate
-SET SESSION AUTHORIZATION regressuser5;
+SET SESSION AUTHORIZATION regress_user5;
TRUNCATE atest2; -- ok
TRUNCATE atest3; -- fail
from (select oid from pg_class where relname = 'pg_authid') as t1;
-- non-superuser
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
select has_table_privilege(current_user,'pg_class','select');
select has_table_privilege(current_user,'pg_class','insert');
-- Grant options
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
CREATE TABLE atest4 (a int);
-GRANT SELECT ON atest4 TO regressuser2 WITH GRANT OPTION;
-GRANT UPDATE ON atest4 TO regressuser2;
-GRANT SELECT ON atest4 TO GROUP regressgroup1 WITH GRANT OPTION;
+GRANT SELECT ON atest4 TO regress_user2 WITH GRANT OPTION;
+GRANT UPDATE ON atest4 TO regress_user2;
+GRANT SELECT ON atest4 TO GROUP regress_group1 WITH GRANT OPTION;
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
-GRANT SELECT ON atest4 TO regressuser3;
-GRANT UPDATE ON atest4 TO regressuser3; -- fail
+GRANT SELECT ON atest4 TO regress_user3;
+GRANT UPDATE ON atest4 TO regress_user3; -- fail
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
-REVOKE SELECT ON atest4 FROM regressuser3; -- does nothing
-SELECT has_table_privilege('regressuser3', 'atest4', 'SELECT'); -- true
-REVOKE SELECT ON atest4 FROM regressuser2; -- fail
-REVOKE GRANT OPTION FOR SELECT ON atest4 FROM regressuser2 CASCADE; -- ok
-SELECT has_table_privilege('regressuser2', 'atest4', 'SELECT'); -- true
-SELECT has_table_privilege('regressuser3', 'atest4', 'SELECT'); -- false
+REVOKE SELECT ON atest4 FROM regress_user3; -- does nothing
+SELECT has_table_privilege('regress_user3', 'atest4', 'SELECT'); -- true
+REVOKE SELECT ON atest4 FROM regress_user2; -- fail
+REVOKE GRANT OPTION FOR SELECT ON atest4 FROM regress_user2 CASCADE; -- ok
+SELECT has_table_privilege('regress_user2', 'atest4', 'SELECT'); -- true
+SELECT has_table_privilege('regress_user3', 'atest4', 'SELECT'); -- false
-SELECT has_table_privilege('regressuser1', 'atest4', 'SELECT WITH GRANT OPTION'); -- true
+SELECT has_table_privilege('regress_user1', 'atest4', 'SELECT WITH GRANT OPTION'); -- true
-- Admin options
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
CREATE FUNCTION dogrant_ok() RETURNS void LANGUAGE sql SECURITY DEFINER AS
- 'GRANT regressgroup2 TO regressuser5';
-GRANT regressgroup2 TO regressuser5; -- ok: had ADMIN OPTION
-SET ROLE regressgroup2;
-GRANT regressgroup2 TO regressuser5; -- fails: SET ROLE suspended privilege
+ 'GRANT regress_group2 TO regress_user5';
+GRANT regress_group2 TO regress_user5; -- ok: had ADMIN OPTION
+SET ROLE regress_group2;
+GRANT regress_group2 TO regress_user5; -- fails: SET ROLE suspended privilege
-SET SESSION AUTHORIZATION regressuser1;
-GRANT regressgroup2 TO regressuser5; -- fails: no ADMIN OPTION
+SET SESSION AUTHORIZATION regress_user1;
+GRANT regress_group2 TO regress_user5; -- fails: no ADMIN OPTION
SELECT dogrant_ok(); -- ok: SECURITY DEFINER conveys ADMIN
-SET ROLE regressgroup2;
-GRANT regressgroup2 TO regressuser5; -- fails: SET ROLE did not help
+SET ROLE regress_group2;
+GRANT regress_group2 TO regress_user5; -- fails: SET ROLE did not help
-SET SESSION AUTHORIZATION regressgroup2;
-GRANT regressgroup2 TO regressuser5; -- ok: a role can self-admin
+SET SESSION AUTHORIZATION regress_group2;
+GRANT regress_group2 TO regress_user5; -- ok: a role can self-admin
CREATE FUNCTION dogrant_fails() RETURNS void LANGUAGE sql SECURITY DEFINER AS
- 'GRANT regressgroup2 TO regressuser5';
+ 'GRANT regress_group2 TO regress_user5';
SELECT dogrant_fails(); -- fails: no self-admin in SECURITY DEFINER
DROP FUNCTION dogrant_fails();
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
DROP FUNCTION dogrant_ok();
-REVOKE regressgroup2 FROM regressuser5;
+REVOKE regress_group2 FROM regress_user5;
-- has_sequence_privilege tests
CREATE SEQUENCE x_seq;
-GRANT USAGE on x_seq to regressuser2;
+GRANT USAGE on x_seq to regress_user2;
-SELECT has_sequence_privilege('regressuser1', 'atest1', 'SELECT');
-SELECT has_sequence_privilege('regressuser1', 'x_seq', 'INSERT');
-SELECT has_sequence_privilege('regressuser1', 'x_seq', 'SELECT');
+SELECT has_sequence_privilege('regress_user1', 'atest1', 'SELECT');
+SELECT has_sequence_privilege('regress_user1', 'x_seq', 'INSERT');
+SELECT has_sequence_privilege('regress_user1', 'x_seq', 'SELECT');
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT has_sequence_privilege('x_seq', 'USAGE');
-- largeobject privilege tests
\c -
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
SELECT lo_create(1001);
SELECT lo_create(1002);
SELECT lo_create(1005);
GRANT ALL ON LARGE OBJECT 1001 TO PUBLIC;
-GRANT SELECT ON LARGE OBJECT 1003 TO regressuser2;
-GRANT SELECT,UPDATE ON LARGE OBJECT 1004 TO regressuser2;
-GRANT ALL ON LARGE OBJECT 1005 TO regressuser2;
-GRANT SELECT ON LARGE OBJECT 1005 TO regressuser2 WITH GRANT OPTION;
+GRANT SELECT ON LARGE OBJECT 1003 TO regress_user2;
+GRANT SELECT,UPDATE ON LARGE OBJECT 1004 TO regress_user2;
+GRANT ALL ON LARGE OBJECT 1005 TO regress_user2;
+GRANT SELECT ON LARGE OBJECT 1005 TO regress_user2 WITH GRANT OPTION;
GRANT SELECT, INSERT ON LARGE OBJECT 1001 TO PUBLIC; -- to be failed
GRANT SELECT, UPDATE ON LARGE OBJECT 1001 TO nosuchuser; -- to be failed
GRANT SELECT, UPDATE ON LARGE OBJECT 999 TO PUBLIC; -- to be failed
\c -
-SET SESSION AUTHORIZATION regressuser2;
+SET SESSION AUTHORIZATION regress_user2;
SELECT lo_create(2001);
SELECT lo_create(2002);
SELECT lowrite(lo_open(1003, x'20000'::int), 'abcd'); -- to be denied
SELECT lowrite(lo_open(1004, x'20000'::int), 'abcd');
-GRANT SELECT ON LARGE OBJECT 1005 TO regressuser3;
-GRANT UPDATE ON LARGE OBJECT 1006 TO regressuser3; -- to be denied
+GRANT SELECT ON LARGE OBJECT 1005 TO regress_user3;
+GRANT UPDATE ON LARGE OBJECT 1006 TO regress_user3; -- to be denied
REVOKE ALL ON LARGE OBJECT 2001, 2002 FROM PUBLIC;
-GRANT ALL ON LARGE OBJECT 2001 TO regressuser3;
+GRANT ALL ON LARGE OBJECT 2001 TO regress_user3;
SELECT lo_unlink(1001); -- to be denied
SELECT lo_unlink(2002);
-- confirm ACL setting
SELECT oid, pg_get_userbyid(lomowner) ownername, lomacl FROM pg_largeobject_metadata;
-SET SESSION AUTHORIZATION regressuser3;
+SET SESSION AUTHORIZATION regress_user3;
SELECT loread(lo_open(1001, x'40000'::int), 32);
SELECT loread(lo_open(1003, x'40000'::int), 32); -- to be denied
-- compatibility mode in largeobject permission
\c -
SET lo_compat_privileges = false; -- default setting
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT loread(lo_open(1002, x'40000'::int), 32); -- to be denied
SELECT lowrite(lo_open(1002, x'20000'::int), 'abcd'); -- to be denied
\c -
SET lo_compat_privileges = true; -- compatibility mode
-SET SESSION AUTHORIZATION regressuser4;
+SET SESSION AUTHORIZATION regress_user4;
SELECT loread(lo_open(1002, x'40000'::int), 32);
SELECT lowrite(lo_open(1002, x'20000'::int), 'abcd');
\c -
SELECT * FROM pg_largeobject LIMIT 0;
-SET SESSION AUTHORIZATION regressuser1;
+SET SESSION AUTHORIZATION regress_user1;
SELECT * FROM pg_largeobject LIMIT 0; -- to be denied
-- test default ACLs
\c -
CREATE SCHEMA testns;
-GRANT ALL ON SCHEMA testns TO regressuser1;
+GRANT ALL ON SCHEMA testns TO regress_user1;
CREATE TABLE testns.acltest1 (x int);
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- no
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- no
ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT SELECT ON TABLES TO public;
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- no
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- no
DROP TABLE testns.acltest1;
CREATE TABLE testns.acltest1 (x int);
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- yes
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- yes
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- no
-ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT INSERT ON TABLES TO regressuser1;
+ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT INSERT ON TABLES TO regress_user1;
DROP TABLE testns.acltest1;
CREATE TABLE testns.acltest1 (x int);
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- yes
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- yes
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- yes
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- yes
-ALTER DEFAULT PRIVILEGES IN SCHEMA testns REVOKE INSERT ON TABLES FROM regressuser1;
+ALTER DEFAULT PRIVILEGES IN SCHEMA testns REVOKE INSERT ON TABLES FROM regress_user1;
DROP TABLE testns.acltest1;
CREATE TABLE testns.acltest1 (x int);
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'SELECT'); -- yes
-SELECT has_table_privilege('regressuser1', 'testns.acltest1', 'INSERT'); -- no
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'SELECT'); -- yes
+SELECT has_table_privilege('regress_user1', 'testns.acltest1', 'INSERT'); -- no
-ALTER DEFAULT PRIVILEGES FOR ROLE regressuser1 REVOKE EXECUTE ON FUNCTIONS FROM public;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_user1 REVOKE EXECUTE ON FUNCTIONS FROM public;
-SET ROLE regressuser1;
+SET ROLE regress_user1;
CREATE FUNCTION testns.foo() RETURNS int AS 'select 1' LANGUAGE sql;
-SELECT has_function_privilege('regressuser2', 'testns.foo()', 'EXECUTE'); -- no
+SELECT has_function_privilege('regress_user2', 'testns.foo()', 'EXECUTE'); -- no
ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT EXECUTE ON FUNCTIONS to public;
DROP FUNCTION testns.foo();
CREATE FUNCTION testns.foo() RETURNS int AS 'select 1' LANGUAGE sql;
-SELECT has_function_privilege('regressuser2', 'testns.foo()', 'EXECUTE'); -- yes
+SELECT has_function_privilege('regress_user2', 'testns.foo()', 'EXECUTE'); -- yes
DROP FUNCTION testns.foo();
-ALTER DEFAULT PRIVILEGES FOR ROLE regressuser1 REVOKE USAGE ON TYPES FROM public;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_user1 REVOKE USAGE ON TYPES FROM public;
CREATE DOMAIN testns.testdomain1 AS int;
-SELECT has_type_privilege('regressuser2', 'testns.testdomain1', 'USAGE'); -- no
+SELECT has_type_privilege('regress_user2', 'testns.testdomain1', 'USAGE'); -- no
ALTER DEFAULT PRIVILEGES IN SCHEMA testns GRANT USAGE ON TYPES to public;
DROP DOMAIN testns.testdomain1;
CREATE DOMAIN testns.testdomain1 AS int;
-SELECT has_type_privilege('regressuser2', 'testns.testdomain1', 'USAGE'); -- yes
+SELECT has_type_privilege('regress_user2', 'testns.testdomain1', 'USAGE'); -- yes
DROP DOMAIN testns.testdomain1;
CREATE TABLE testns.t1 (f1 int);
CREATE TABLE testns.t2 (f1 int);
-SELECT has_table_privilege('regressuser1', 'testns.t1', 'SELECT'); -- false
+SELECT has_table_privilege('regress_user1', 'testns.t1', 'SELECT'); -- false
-GRANT ALL ON ALL TABLES IN SCHEMA testns TO regressuser1;
+GRANT ALL ON ALL TABLES IN SCHEMA testns TO regress_user1;
-SELECT has_table_privilege('regressuser1', 'testns.t1', 'SELECT'); -- true
-SELECT has_table_privilege('regressuser1', 'testns.t2', 'SELECT'); -- true
+SELECT has_table_privilege('regress_user1', 'testns.t1', 'SELECT'); -- true
+SELECT has_table_privilege('regress_user1', 'testns.t2', 'SELECT'); -- true
-REVOKE ALL ON ALL TABLES IN SCHEMA testns FROM regressuser1;
+REVOKE ALL ON ALL TABLES IN SCHEMA testns FROM regress_user1;
-SELECT has_table_privilege('regressuser1', 'testns.t1', 'SELECT'); -- false
-SELECT has_table_privilege('regressuser1', 'testns.t2', 'SELECT'); -- false
+SELECT has_table_privilege('regress_user1', 'testns.t1', 'SELECT'); -- false
+SELECT has_table_privilege('regress_user1', 'testns.t2', 'SELECT'); -- false
CREATE FUNCTION testns.testfunc(int) RETURNS int AS 'select 3 * $1;' LANGUAGE sql;
-SELECT has_function_privilege('regressuser1', 'testns.testfunc(int)', 'EXECUTE'); -- true by default
+SELECT has_function_privilege('regress_user1', 'testns.testfunc(int)', 'EXECUTE'); -- true by default
REVOKE ALL ON ALL FUNCTIONS IN SCHEMA testns FROM PUBLIC;
-SELECT has_function_privilege('regressuser1', 'testns.testfunc(int)', 'EXECUTE'); -- false
+SELECT has_function_privilege('regress_user1', 'testns.testfunc(int)', 'EXECUTE'); -- false
SET client_min_messages TO 'warning';
DROP SCHEMA testns CASCADE;
-- Change owner of the schema & and rename of new schema owner
\c -
-CREATE ROLE schemauser1 superuser login;
-CREATE ROLE schemauser2 superuser login;
+CREATE ROLE regress_schemauser1 superuser login;
+CREATE ROLE regress_schemauser2 superuser login;
-SET SESSION ROLE schemauser1;
+SET SESSION ROLE regress_schemauser1;
CREATE SCHEMA testns;
SELECT nspname, rolname FROM pg_namespace, pg_roles WHERE pg_namespace.nspname = 'testns' AND pg_namespace.nspowner = pg_roles.oid;
-ALTER SCHEMA testns OWNER TO schemauser2;
-ALTER ROLE schemauser2 RENAME TO schemauser_renamed;
+ALTER SCHEMA testns OWNER TO regress_schemauser2;
+ALTER ROLE regress_schemauser2 RENAME TO regress_schemauser_renamed;
SELECT nspname, rolname FROM pg_namespace, pg_roles WHERE pg_namespace.nspname = 'testns' AND pg_namespace.nspowner = pg_roles.oid;
-set session role schemauser_renamed;
+set session role regress_schemauser_renamed;
SET client_min_messages TO 'warning';
DROP SCHEMA testns CASCADE;
RESET client_min_messages;
-- clean up
\c -
-DROP ROLE schemauser1;
-DROP ROLE schemauser_renamed;
+DROP ROLE regress_schemauser1;
+DROP ROLE regress_schemauser_renamed;
-- test that dependent privileges are revoked (or not) properly
\c -
-set session role regressuser1;
+set session role regress_user1;
create table dep_priv_test (a int);
-grant select on dep_priv_test to regressuser2 with grant option;
-grant select on dep_priv_test to regressuser3 with grant option;
-set session role regressuser2;
-grant select on dep_priv_test to regressuser4 with grant option;
-set session role regressuser3;
-grant select on dep_priv_test to regressuser4 with grant option;
-set session role regressuser4;
-grant select on dep_priv_test to regressuser5;
+grant select on dep_priv_test to regress_user2 with grant option;
+grant select on dep_priv_test to regress_user3 with grant option;
+set session role regress_user2;
+grant select on dep_priv_test to regress_user4 with grant option;
+set session role regress_user3;
+grant select on dep_priv_test to regress_user4 with grant option;
+set session role regress_user4;
+grant select on dep_priv_test to regress_user5;
\dp dep_priv_test
-set session role regressuser2;
-revoke select on dep_priv_test from regressuser4 cascade;
+set session role regress_user2;
+revoke select on dep_priv_test from regress_user4 cascade;
\dp dep_priv_test
-set session role regressuser3;
-revoke select on dep_priv_test from regressuser4 cascade;
+set session role regress_user3;
+revoke select on dep_priv_test from regress_user4 cascade;
\dp dep_priv_test
-set session role regressuser1;
+set session role regress_user1;
drop table dep_priv_test;
SELECT lo_unlink(oid) FROM pg_largeobject_metadata;
-DROP GROUP regressgroup1;
-DROP GROUP regressgroup2;
+DROP GROUP regress_group1;
+DROP GROUP regress_group2;
-- these are needed to clean up permissions
-REVOKE USAGE ON LANGUAGE sql FROM regressuser1;
-DROP OWNED BY regressuser1;
+REVOKE USAGE ON LANGUAGE sql FROM regress_user1;
+DROP OWNED BY regress_user1;
-DROP USER regressuser1;
-DROP USER regressuser2;
-DROP USER regressuser3;
-DROP USER regressuser4;
-DROP USER regressuser5;
-DROP USER regressuser6;
+DROP USER regress_user1;
+DROP USER regress_user2;
+DROP USER regress_user3;
+DROP USER regress_user4;
+DROP USER regress_user5;
+DROP USER regress_user6;
-- permissions with LOCK TABLE
-CREATE USER locktable_user;
+CREATE USER regress_locktable_user;
CREATE TABLE lock_table (a int);
-- LOCK TABLE and SELECT permission
-GRANT SELECT ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT SELECT ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should fail
ROLLBACK;
LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should fail
ROLLBACK;
\c
-REVOKE SELECT ON lock_table FROM locktable_user;
+REVOKE SELECT ON lock_table FROM regress_locktable_user;
-- LOCK TABLE and INSERT permission
-GRANT INSERT ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT INSERT ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
COMMIT;
LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should fail
ROLLBACK;
\c
-REVOKE INSERT ON lock_table FROM locktable_user;
+REVOKE INSERT ON lock_table FROM regress_locktable_user;
-- LOCK TABLE and UPDATE permission
-GRANT UPDATE ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT UPDATE ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
COMMIT;
LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
COMMIT;
\c
-REVOKE UPDATE ON lock_table FROM locktable_user;
+REVOKE UPDATE ON lock_table FROM regress_locktable_user;
-- LOCK TABLE and DELETE permission
-GRANT DELETE ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT DELETE ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
COMMIT;
LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
COMMIT;
\c
-REVOKE DELETE ON lock_table FROM locktable_user;
+REVOKE DELETE ON lock_table FROM regress_locktable_user;
-- LOCK TABLE and TRUNCATE permission
-GRANT TRUNCATE ON lock_table TO locktable_user;
-SET SESSION AUTHORIZATION locktable_user;
+GRANT TRUNCATE ON lock_table TO regress_locktable_user;
+SET SESSION AUTHORIZATION regress_locktable_user;
BEGIN;
LOCK TABLE lock_table IN ROW EXCLUSIVE MODE; -- should pass
COMMIT;
LOCK TABLE lock_table IN ACCESS EXCLUSIVE MODE; -- should pass
COMMIT;
\c
-REVOKE TRUNCATE ON lock_table FROM locktable_user;
+REVOKE TRUNCATE ON lock_table FROM regress_locktable_user;
-- clean up
DROP TABLE lock_table;
-DROP USER locktable_user;
+DROP USER regress_locktable_user;
/* If objects exist, return oids */
-CREATE ROLE regtestrole;
+CREATE ROLE regress_regrole_test;
-- without schemaname
-- schemaname not applicable
-SELECT regrole('regtestrole');
-SELECT regrole('"regtestrole"');
+SELECT regrole('regress_regrole_test');
+SELECT regrole('"regress_regrole_test"');
SELECT regnamespace('pg_catalog');
SELECT regnamespace('"pg_catalog"');
-SELECT to_regrole('regtestrole');
-SELECT to_regrole('"regtestrole"');
+SELECT to_regrole('regress_regrole_test');
+SELECT to_regrole('"regress_regrole_test"');
SELECT to_regnamespace('pg_catalog');
SELECT to_regnamespace('"pg_catalog"');
/* If objects don't exist, raise errors. */
-DROP ROLE regtestrole;
+DROP ROLE regress_regrole_test;
-- without schemaname
-- schemaname not applicable
-SELECT regrole('regtestrole');
-SELECT regrole('"regtestrole"');
+SELECT regrole('regress_regrole_test');
+SELECT regrole('"regress_regrole_test"');
SELECT regrole('Nonexistent');
SELECT regrole('"Nonexistent"');
SELECT regrole('foo.bar');
-- schemaname not applicable
-SELECT to_regrole('regtestrole');
-SELECT to_regrole('"regtestrole"');
+SELECT to_regrole('regress_regrole_test');
+SELECT to_regrole('"regress_regrole_test"');
SELECT to_regrole('foo.bar');
SELECT to_regrole('Nonexistent');
SELECT to_regrole('"Nonexistent"');
-- default for superuser is false
-CREATE ROLE test_def_superuser;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_superuser';
-CREATE ROLE test_superuser WITH SUPERUSER;
-SELECT * FROM pg_authid WHERE rolname = 'test_superuser';
-ALTER ROLE test_superuser WITH NOSUPERUSER;
-SELECT * FROM pg_authid WHERE rolname = 'test_superuser';
-ALTER ROLE test_superuser WITH SUPERUSER;
-SELECT * FROM pg_authid WHERE rolname = 'test_superuser';
+CREATE ROLE regress_test_def_superuser;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_superuser';
+CREATE ROLE regress_test_superuser WITH SUPERUSER;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_superuser';
+ALTER ROLE regress_test_superuser WITH NOSUPERUSER;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_superuser';
+ALTER ROLE regress_test_superuser WITH SUPERUSER;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_superuser';
-- default for inherit is true
-CREATE ROLE test_def_inherit;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_inherit';
-CREATE ROLE test_inherit WITH NOINHERIT;
-SELECT * FROM pg_authid WHERE rolname = 'test_inherit';
-ALTER ROLE test_inherit WITH INHERIT;
-SELECT * FROM pg_authid WHERE rolname = 'test_inherit';
-ALTER ROLE test_inherit WITH NOINHERIT;
-SELECT * FROM pg_authid WHERE rolname = 'test_inherit';
+CREATE ROLE regress_test_def_inherit;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_inherit';
+CREATE ROLE regress_test_inherit WITH NOINHERIT;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_inherit';
+ALTER ROLE regress_test_inherit WITH INHERIT;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_inherit';
+ALTER ROLE regress_test_inherit WITH NOINHERIT;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_inherit';
-- default for create role is false
-CREATE ROLE test_def_createrole;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_createrole';
-CREATE ROLE test_createrole WITH CREATEROLE;
-SELECT * FROM pg_authid WHERE rolname = 'test_createrole';
-ALTER ROLE test_createrole WITH NOCREATEROLE;
-SELECT * FROM pg_authid WHERE rolname = 'test_createrole';
-ALTER ROLE test_createrole WITH CREATEROLE;
-SELECT * FROM pg_authid WHERE rolname = 'test_createrole';
+CREATE ROLE regress_test_def_createrole;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_createrole';
+CREATE ROLE regress_test_createrole WITH CREATEROLE;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createrole';
+ALTER ROLE regress_test_createrole WITH NOCREATEROLE;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createrole';
+ALTER ROLE regress_test_createrole WITH CREATEROLE;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createrole';
-- default for create database is false
-CREATE ROLE test_def_createdb;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_createdb';
-CREATE ROLE test_createdb WITH CREATEDB;
-SELECT * FROM pg_authid WHERE rolname = 'test_createdb';
-ALTER ROLE test_createdb WITH NOCREATEDB;
-SELECT * FROM pg_authid WHERE rolname = 'test_createdb';
-ALTER ROLE test_createdb WITH CREATEDB;
-SELECT * FROM pg_authid WHERE rolname = 'test_createdb';
+CREATE ROLE regress_test_def_createdb;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_createdb';
+CREATE ROLE regress_test_createdb WITH CREATEDB;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createdb';
+ALTER ROLE regress_test_createdb WITH NOCREATEDB;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createdb';
+ALTER ROLE regress_test_createdb WITH CREATEDB;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_createdb';
-- default for can login is false for role
-CREATE ROLE test_def_role_canlogin;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_role_canlogin';
-CREATE ROLE test_role_canlogin WITH LOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_role_canlogin';
-ALTER ROLE test_role_canlogin WITH NOLOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_role_canlogin';
-ALTER ROLE test_role_canlogin WITH LOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_role_canlogin';
+CREATE ROLE regress_test_def_role_canlogin;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_role_canlogin';
+CREATE ROLE regress_test_role_canlogin WITH LOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_role_canlogin';
+ALTER ROLE regress_test_role_canlogin WITH NOLOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_role_canlogin';
+ALTER ROLE regress_test_role_canlogin WITH LOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_role_canlogin';
-- default for can login is true for user
-CREATE USER test_def_user_canlogin;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_user_canlogin';
-CREATE USER test_user_canlogin WITH NOLOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_user_canlogin';
-ALTER USER test_user_canlogin WITH LOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_user_canlogin';
-ALTER USER test_user_canlogin WITH NOLOGIN;
-SELECT * FROM pg_authid WHERE rolname = 'test_user_canlogin';
+CREATE USER regress_test_def_user_canlogin;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_user_canlogin';
+CREATE USER regress_test_user_canlogin WITH NOLOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_user_canlogin';
+ALTER USER regress_test_user_canlogin WITH LOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_user_canlogin';
+ALTER USER regress_test_user_canlogin WITH NOLOGIN;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_user_canlogin';
-- default for replication is false
-CREATE ROLE test_def_replication;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_replication';
-CREATE ROLE test_replication WITH REPLICATION;
-SELECT * FROM pg_authid WHERE rolname = 'test_replication';
-ALTER ROLE test_replication WITH NOREPLICATION;
-SELECT * FROM pg_authid WHERE rolname = 'test_replication';
-ALTER ROLE test_replication WITH REPLICATION;
-SELECT * FROM pg_authid WHERE rolname = 'test_replication';
+CREATE ROLE regress_test_def_replication;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_replication';
+CREATE ROLE regress_test_replication WITH REPLICATION;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_replication';
+ALTER ROLE regress_test_replication WITH NOREPLICATION;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_replication';
+ALTER ROLE regress_test_replication WITH REPLICATION;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_replication';
-- default for bypassrls is false
-CREATE ROLE test_def_bypassrls;
-SELECT * FROM pg_authid WHERE rolname = 'test_def_bypassrls';
-CREATE ROLE test_bypassrls WITH BYPASSRLS;
-SELECT * FROM pg_authid WHERE rolname = 'test_bypassrls';
-ALTER ROLE test_bypassrls WITH NOBYPASSRLS;
-SELECT * FROM pg_authid WHERE rolname = 'test_bypassrls';
-ALTER ROLE test_bypassrls WITH BYPASSRLS;
-SELECT * FROM pg_authid WHERE rolname = 'test_bypassrls';
+CREATE ROLE regress_test_def_bypassrls;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_def_bypassrls';
+CREATE ROLE regress_test_bypassrls WITH BYPASSRLS;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_bypassrls';
+ALTER ROLE regress_test_bypassrls WITH NOBYPASSRLS;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_bypassrls';
+ALTER ROLE regress_test_bypassrls WITH BYPASSRLS;
+SELECT * FROM pg_authid WHERE rolname = 'regress_test_bypassrls';
-- clean up roles
-DROP ROLE test_def_superuser;
-DROP ROLE test_superuser;
-DROP ROLE test_def_inherit;
-DROP ROLE test_inherit;
-DROP ROLE test_def_createrole;
-DROP ROLE test_createrole;
-DROP ROLE test_def_createdb;
-DROP ROLE test_createdb;
-DROP ROLE test_def_role_canlogin;
-DROP ROLE test_role_canlogin;
-DROP USER test_def_user_canlogin;
-DROP USER test_user_canlogin;
-DROP ROLE test_def_replication;
-DROP ROLE test_replication;
-DROP ROLE test_def_bypassrls;
-DROP ROLE test_bypassrls;
+DROP ROLE regress_test_def_superuser;
+DROP ROLE regress_test_superuser;
+DROP ROLE regress_test_def_inherit;
+DROP ROLE regress_test_inherit;
+DROP ROLE regress_test_def_createrole;
+DROP ROLE regress_test_createrole;
+DROP ROLE regress_test_def_createdb;
+DROP ROLE regress_test_createdb;
+DROP ROLE regress_test_def_role_canlogin;
+DROP ROLE regress_test_role_canlogin;
+DROP USER regress_test_def_user_canlogin;
+DROP USER regress_test_user_canlogin;
+DROP ROLE regress_test_def_replication;
+DROP ROLE regress_test_replication;
+DROP ROLE regress_test_def_bypassrls;
+DROP ROLE regress_test_bypassrls;
(SESSION_USER, 'session_user'))
AS v(uname, keyword)
ON (r.rolname = v.uname)
- WHERE (r.rolname) IN ('Public', 'current_user', 'testrol1', 'testrol2')
+ WHERE (r.rolname) IN ('Public', 'current_user', 'regress_testrol1', 'regress_testrol2')
ORDER BY 1, 2;
$$ LANGUAGE SQL;
CREATE ROLE pg_abcdef; -- error
CREATE ROLE "pg_abcdef"; -- error
-CREATE ROLE testrol0 SUPERUSER LOGIN;
-CREATE ROLE testrolx SUPERUSER LOGIN;
-CREATE ROLE testrol2 SUPERUSER;
-CREATE ROLE testrol1 SUPERUSER LOGIN IN ROLE testrol2;
+CREATE ROLE regress_testrol0 SUPERUSER LOGIN;
+CREATE ROLE regress_testrolx SUPERUSER LOGIN;
+CREATE ROLE regress_testrol2 SUPERUSER;
+CREATE ROLE regress_testrol1 SUPERUSER LOGIN IN ROLE regress_testrol2;
\c -
-SET SESSION AUTHORIZATION testrol1;
-SET ROLE testrol2;
+SET SESSION AUTHORIZATION regress_testrol1;
+SET ROLE regress_testrol2;
-- ALTER ROLE
BEGIN;
ALTER USER "Public" WITH REPLICATION;
ALTER USER "None" WITH REPLICATION;
SELECT * FROM chkrolattr();
-ALTER USER testrol1 WITH NOREPLICATION;
-ALTER USER testrol2 WITH NOREPLICATION;
+ALTER USER regress_testrol1 WITH NOREPLICATION;
+ALTER USER regress_testrol2 WITH NOREPLICATION;
SELECT * FROM chkrolattr();
ROLLBACK;
ALTER USER "Public" WITH REPLICATION;
ALTER USER "None" WITH REPLICATION;
SELECT * FROM chkrolattr();
-ALTER USER testrol1 WITH NOREPLICATION;
-ALTER USER testrol2 WITH NOREPLICATION;
+ALTER USER regress_testrol1 WITH NOREPLICATION;
+ALTER USER regress_testrol2 WITH NOREPLICATION;
SELECT * FROM chkrolattr();
ROLLBACK;
ALTER ROLE "Public" SET application_name to 'BARBAR';
ALTER ROLE ALL SET application_name to 'SLAP';
SELECT * FROM chksetconfig();
-ALTER ROLE testrol1 SET application_name to 'SLAM';
+ALTER ROLE regress_testrol1 SET application_name to 'SLAM';
SELECT * FROM chksetconfig();
ALTER ROLE CURRENT_USER RESET application_name;
ALTER ROLE SESSION_USER RESET application_name;
ALTER USER "Public" SET application_name to 'BARBAR';
ALTER USER ALL SET application_name to 'SLAP';
SELECT * FROM chksetconfig();
-ALTER USER testrol1 SET application_name to 'SLAM';
+ALTER USER regress_testrol1 SET application_name to 'SLAM';
SELECT * FROM chksetconfig();
ALTER USER CURRENT_USER RESET application_name;
ALTER USER SESSION_USER RESET application_name;
CREATE SCHEMA newschema1 AUTHORIZATION CURRENT_USER;
CREATE SCHEMA newschema2 AUTHORIZATION "current_user";
CREATE SCHEMA newschema3 AUTHORIZATION SESSION_USER;
-CREATE SCHEMA newschema4 AUTHORIZATION testrolx;
+CREATE SCHEMA newschema4 AUTHORIZATION regress_testrolx;
CREATE SCHEMA newschema5 AUTHORIZATION "Public";
CREATE SCHEMA newschema6 AUTHORIZATION USER; -- error
CREATE SCHEMA IF NOT EXISTS newschema1 AUTHORIZATION CURRENT_USER;
CREATE SCHEMA IF NOT EXISTS newschema2 AUTHORIZATION "current_user";
CREATE SCHEMA IF NOT EXISTS newschema3 AUTHORIZATION SESSION_USER;
-CREATE SCHEMA IF NOT EXISTS newschema4 AUTHORIZATION testrolx;
+CREATE SCHEMA IF NOT EXISTS newschema4 AUTHORIZATION regress_testrolx;
CREATE SCHEMA IF NOT EXISTS newschema5 AUTHORIZATION "Public";
CREATE SCHEMA IF NOT EXISTS newschema6 AUTHORIZATION USER; -- error
-- ALTER TABLE OWNER TO
\c -
-SET SESSION AUTHORIZATION testrol0;
+SET SESSION AUTHORIZATION regress_testrol0;
set client_min_messages to error;
CREATE TABLE testtab1 (a int);
CREATE TABLE testtab2 (a int);
CREATE TABLE testtab6 (a int);
\c -
-SET SESSION AUTHORIZATION testrol1;
-SET ROLE testrol2;
+SET SESSION AUTHORIZATION regress_testrol1;
+SET ROLE regress_testrol2;
ALTER TABLE testtab1 OWNER TO CURRENT_USER;
ALTER TABLE testtab2 OWNER TO "current_user";
ALTER TABLE testtab3 OWNER TO SESSION_USER;
-ALTER TABLE testtab4 OWNER TO testrolx;
+ALTER TABLE testtab4 OWNER TO regress_testrolx;
ALTER TABLE testtab5 OWNER TO "Public";
ALTER TABLE testtab6 OWNER TO CURRENT_ROLE; -- error
-- ALTER AGGREGATE
\c -
-SET SESSION AUTHORIZATION testrol0;
+SET SESSION AUTHORIZATION regress_testrol0;
CREATE AGGREGATE testagg1(int2) (SFUNC = int2_sum, STYPE = int8);
CREATE AGGREGATE testagg2(int2) (SFUNC = int2_sum, STYPE = int8);
CREATE AGGREGATE testagg3(int2) (SFUNC = int2_sum, STYPE = int8);
CREATE AGGREGATE testagg9(int2) (SFUNC = int2_sum, STYPE = int8);
\c -
-SET SESSION AUTHORIZATION testrol1;
-SET ROLE testrol2;
+SET SESSION AUTHORIZATION regress_testrol1;
+SET ROLE regress_testrol2;
ALTER AGGREGATE testagg1(int2) OWNER TO CURRENT_USER;
ALTER AGGREGATE testagg2(int2) OWNER TO "current_user";
ALTER AGGREGATE testagg3(int2) OWNER TO SESSION_USER;
-ALTER AGGREGATE testagg4(int2) OWNER TO testrolx;
+ALTER AGGREGATE testagg4(int2) OWNER TO regress_testrolx;
ALTER AGGREGATE testagg5(int2) OWNER TO "Public";
ALTER AGGREGATE testagg5(int2) OWNER TO CURRENT_ROLE; -- error
CREATE USER MAPPING FOR SESSION_USER SERVER sv5 OPTIONS (user 'SESSION_USER');
CREATE USER MAPPING FOR PUBLIC SERVER sv6 OPTIONS (user 'PUBLIC');
CREATE USER MAPPING FOR "Public" SERVER sv7 OPTIONS (user '"Public"');
-CREATE USER MAPPING FOR testrolx SERVER sv8 OPTIONS (user 'testrolx');
+CREATE USER MAPPING FOR regress_testrolx SERVER sv8 OPTIONS (user 'regress_testrolx');
CREATE USER MAPPING FOR CURRENT_ROLE SERVER sv9
OPTIONS (user 'CURRENT_ROLE'); -- error
OPTIONS (SET user 'public_alt');
ALTER USER MAPPING FOR "Public" SERVER sv7
OPTIONS (SET user '"Public"_alt');
-ALTER USER MAPPING FOR testrolx SERVER sv8
- OPTIONS (SET user 'testrolx_alt');
+ALTER USER MAPPING FOR regress_testrolx SERVER sv8
+ OPTIONS (SET user 'regress_testrolx_alt');
ALTER USER MAPPING FOR CURRENT_ROLE SERVER sv9
OPTIONS (SET user 'CURRENT_ROLE_alt');
DROP USER MAPPING FOR SESSION_USER SERVER sv5;
DROP USER MAPPING FOR PUBLIC SERVER sv6;
DROP USER MAPPING FOR "Public" SERVER sv7;
-DROP USER MAPPING FOR testrolx SERVER sv8;
+DROP USER MAPPING FOR regress_testrolx SERVER sv8;
DROP USER MAPPING FOR CURRENT_ROLE SERVER sv9; -- error
DROP USER MAPPING FOR nonexistent SERVER sv; -- error
CREATE USER MAPPING FOR SESSION_USER SERVER sv5 OPTIONS (user 'SESSION_USER');
CREATE USER MAPPING FOR PUBLIC SERVER sv6 OPTIONS (user 'PUBLIC');
CREATE USER MAPPING FOR "Public" SERVER sv7 OPTIONS (user '"Public"');
-CREATE USER MAPPING FOR testrolx SERVER sv8 OPTIONS (user 'testrolx');
+CREATE USER MAPPING FOR regress_testrolx SERVER sv8 OPTIONS (user 'regress_testrolx');
SELECT * FROM chkumapping();
-- DROP USER MAPPING IF EXISTS
SELECT * FROM chkumapping();
DROP USER MAPPING IF EXISTS FOR "Public" SERVER sv7;
SELECT * FROM chkumapping();
-DROP USER MAPPING IF EXISTS FOR testrolx SERVER sv8;
+DROP USER MAPPING IF EXISTS FOR regress_testrolx SERVER sv8;
SELECT * FROM chkumapping();
DROP USER MAPPING IF EXISTS FOR CURRENT_ROLE SERVER sv9; --error
DROP USER MAPPING IF EXISTS FOR nonexistent SERVER sv9; -- error
-- GRANT/REVOKE
-GRANT testrol0 TO pg_signal_backend; -- success
+GRANT regress_testrol0 TO pg_signal_backend; -- success
SET ROLE pg_signal_backend; --success
RESET ROLE;
CREATE SCHEMA test_schema AUTHORIZATION pg_signal_backend; --success
-SET ROLE testrol2;
+SET ROLE regress_testrol2;
UPDATE pg_proc SET proacl = null WHERE proname LIKE 'testagg_';
SELECT proname, proacl FROM pg_proc WHERE proname LIKE 'testagg_';
GRANT ALL PRIVILEGES ON FUNCTION testagg3(int2) TO "current_user";
GRANT ALL PRIVILEGES ON FUNCTION testagg4(int2) TO SESSION_USER;
GRANT ALL PRIVILEGES ON FUNCTION testagg5(int2) TO "Public";
-GRANT ALL PRIVILEGES ON FUNCTION testagg6(int2) TO testrolx;
+GRANT ALL PRIVILEGES ON FUNCTION testagg6(int2) TO regress_testrolx;
GRANT ALL PRIVILEGES ON FUNCTION testagg7(int2) TO "public";
GRANT ALL PRIVILEGES ON FUNCTION testagg8(int2)
- TO current_user, public, testrolx;
+ TO current_user, public, regress_testrolx;
SELECT proname, proacl FROM pg_proc WHERE proname LIKE 'testagg_';
REVOKE ALL PRIVILEGES ON FUNCTION testagg3(int2) FROM "current_user";
REVOKE ALL PRIVILEGES ON FUNCTION testagg4(int2) FROM SESSION_USER;
REVOKE ALL PRIVILEGES ON FUNCTION testagg5(int2) FROM "Public";
-REVOKE ALL PRIVILEGES ON FUNCTION testagg6(int2) FROM testrolx;
+REVOKE ALL PRIVILEGES ON FUNCTION testagg6(int2) FROM regress_testrolx;
REVOKE ALL PRIVILEGES ON FUNCTION testagg7(int2) FROM "public";
REVOKE ALL PRIVILEGES ON FUNCTION testagg8(int2)
- FROM current_user, public, testrolx;
+ FROM current_user, public, regress_testrolx;
SELECT proname, proacl FROM pg_proc WHERE proname LIKE 'testagg_';
\c
DROP SCHEMA test_schema;
-DROP OWNED BY testrol0, "Public", "current_user", testrol1, testrol2, testrolx CASCADE;
-DROP ROLE testrol0, testrol1, testrol2, testrolx;
+DROP OWNED BY regress_testrol0, "Public", "current_user", regress_testrol1, regress_testrol2, regress_testrolx CASCADE;
+DROP ROLE regress_testrol0, regress_testrol1, regress_testrol2, regress_testrolx;
DROP ROLE "Public", "None", "current_user", "session_user", "user";
-- initial setups
SET client_min_messages TO 'warning';
-DROP ROLE IF EXISTS seclabel_user1;
-DROP ROLE IF EXISTS seclabel_user2;
+DROP ROLE IF EXISTS regress_seclabel_user1;
+DROP ROLE IF EXISTS regress_seclabel_user2;
-DROP TABLE IF EXISTS seclabel_tbl1;
-DROP TABLE IF EXISTS seclabel_tbl2;
-DROP TABLE IF EXISTS seclabel_tbl3;
+RESET client_min_messages;
-CREATE USER seclabel_user1 WITH CREATEROLE;
-CREATE USER seclabel_user2;
+CREATE USER regress_seclabel_user1 WITH CREATEROLE;
+CREATE USER regress_seclabel_user2;
CREATE TABLE seclabel_tbl1 (a int, b text);
CREATE TABLE seclabel_tbl2 (x int, y text);
CREATE FUNCTION seclabel_four() RETURNS integer AS $$SELECT 4$$ language sql;
CREATE DOMAIN seclabel_domain AS text;
-ALTER TABLE seclabel_tbl1 OWNER TO seclabel_user1;
-ALTER TABLE seclabel_tbl2 OWNER TO seclabel_user2;
-
-RESET client_min_messages;
+ALTER TABLE seclabel_tbl1 OWNER TO regress_seclabel_user1;
+ALTER TABLE seclabel_tbl2 OWNER TO regress_seclabel_user2;
--
-- Test of SECURITY LABEL statement without a plugin
SECURITY LABEL ON TABLE seclabel_tbl1 IS '...invalid label...'; -- fail
SECURITY LABEL ON TABLE seclabel_tbl3 IS 'unclassified'; -- fail
-SECURITY LABEL ON ROLE seclabel_user1 IS 'classified'; -- fail
-SECURITY LABEL FOR 'dummy' ON ROLE seclabel_user1 IS 'classified'; -- fail
-SECURITY LABEL ON ROLE seclabel_user1 IS '...invalid label...'; -- fail
-SECURITY LABEL ON ROLE seclabel_user3 IS 'unclassified'; -- fail
+SECURITY LABEL ON ROLE regress_seclabel_user1 IS 'classified'; -- fail
+SECURITY LABEL FOR 'dummy' ON ROLE regress_seclabel_user1 IS 'classified'; -- fail
+SECURITY LABEL ON ROLE regress_seclabel_user1 IS '...invalid label...'; -- fail
+SECURITY LABEL ON ROLE regress_seclabel_user3 IS 'unclassified'; -- fail
-- clean up objects
DROP FUNCTION seclabel_four();
DROP VIEW seclabel_view1;
DROP TABLE seclabel_tbl1;
DROP TABLE seclabel_tbl2;
-DROP USER seclabel_user1;
-DROP USER seclabel_user2;
+DROP USER regress_seclabel_user1;
+DROP USER regress_seclabel_user2;
-- SELECT INTO and INSERT permission, if owner is not allowed to insert.
--
CREATE SCHEMA selinto_schema;
-CREATE USER selinto_user;
-ALTER DEFAULT PRIVILEGES FOR ROLE selinto_user
- REVOKE INSERT ON TABLES FROM selinto_user;
+CREATE USER regress_selinto_user;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ REVOKE INSERT ON TABLES FROM regress_selinto_user;
GRANT ALL ON SCHEMA selinto_schema TO public;
-SET SESSION AUTHORIZATION selinto_user;
+SET SESSION AUTHORIZATION regress_selinto_user;
SELECT * INTO TABLE selinto_schema.tmp1
FROM pg_class WHERE relname like '%a%'; -- Error
SELECT oid AS clsoid, relname, relnatts + 10 AS x
WHERE relname like '%c%'; -- Error
RESET SESSION AUTHORIZATION;
-ALTER DEFAULT PRIVILEGES FOR ROLE selinto_user
- GRANT INSERT ON TABLES TO selinto_user;
+ALTER DEFAULT PRIVILEGES FOR ROLE regress_selinto_user
+ GRANT INSERT ON TABLES TO regress_selinto_user;
-SET SESSION AUTHORIZATION selinto_user;
+SET SESSION AUTHORIZATION regress_selinto_user;
SELECT * INTO TABLE selinto_schema.tmp1
FROM pg_class WHERE relname like '%a%'; -- OK
SELECT oid AS clsoid, relname, relnatts + 10 AS x
RESET SESSION AUTHORIZATION;
DROP SCHEMA selinto_schema CASCADE;
-DROP USER selinto_user;
+DROP USER regress_selinto_user;
-- Tests for WITH NO DATA and column name consistency
CREATE TABLE ctas_base (i int, j int);
-- should fail
SELECT lastval();
-CREATE USER seq_user;
+CREATE USER regress_seq_user;
-- privileges tests
-- nextval
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT SELECT ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT SELECT ON seq3 TO regress_seq_user;
SELECT nextval('seq3');
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT UPDATE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT UPDATE ON seq3 TO regress_seq_user;
SELECT nextval('seq3');
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT USAGE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT USAGE ON seq3 TO regress_seq_user;
SELECT nextval('seq3');
ROLLBACK;
-- currval
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT SELECT ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT SELECT ON seq3 TO regress_seq_user;
SELECT currval('seq3');
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT UPDATE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT UPDATE ON seq3 TO regress_seq_user;
SELECT currval('seq3');
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT USAGE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT USAGE ON seq3 TO regress_seq_user;
SELECT currval('seq3');
ROLLBACK;
-- lastval
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT SELECT ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT SELECT ON seq3 TO regress_seq_user;
SELECT lastval();
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT UPDATE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT UPDATE ON seq3 TO regress_seq_user;
SELECT lastval();
ROLLBACK;
BEGIN;
-SET LOCAL SESSION AUTHORIZATION seq_user;
+SET LOCAL SESSION AUTHORIZATION regress_seq_user;
CREATE SEQUENCE seq3;
SELECT nextval('seq3');
-REVOKE ALL ON seq3 FROM seq_user;
-GRANT USAGE ON seq3 TO seq_user;
+REVOKE ALL ON seq3 FROM regress_seq_user;
+GRANT USAGE ON seq3 TO regress_seq_user;
SELECT lastval();
ROLLBACK;
'serialtest2_f4_seq', 'serialtest2_f5_seq', 'serialtest2_f6_seq')
ORDER BY sequence_name ASC;
-DROP USER seq_user;
+DROP USER regress_seq_user;
DROP SEQUENCE seq;
-- permissions checks
-CREATE USER view_user1;
-CREATE USER view_user2;
+CREATE USER regress_view_user1;
+CREATE USER regress_view_user2;
-SET SESSION AUTHORIZATION view_user1;
+SET SESSION AUTHORIZATION regress_view_user1;
CREATE TABLE base_tbl(a int, b text, c float);
INSERT INTO base_tbl VALUES (1, 'Row 1', 1.0);
CREATE VIEW rw_view1 AS SELECT b AS bb, c AS cc, a AS aa FROM base_tbl;
INSERT INTO rw_view1 VALUES ('Row 2', 2.0, 2);
-GRANT SELECT ON base_tbl TO view_user2;
-GRANT SELECT ON rw_view1 TO view_user2;
-GRANT UPDATE (a,c) ON base_tbl TO view_user2;
-GRANT UPDATE (bb,cc) ON rw_view1 TO view_user2;
+GRANT SELECT ON base_tbl TO regress_view_user2;
+GRANT SELECT ON rw_view1 TO regress_view_user2;
+GRANT UPDATE (a,c) ON base_tbl TO regress_view_user2;
+GRANT UPDATE (bb,cc) ON rw_view1 TO regress_view_user2;
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user2;
+SET SESSION AUTHORIZATION regress_view_user2;
CREATE VIEW rw_view2 AS SELECT b AS bb, c AS cc, a AS aa FROM base_tbl;
SELECT * FROM base_tbl; -- ok
SELECT * FROM rw_view1; -- ok
DELETE FROM rw_view2; -- not allowed
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user1;
-GRANT INSERT, DELETE ON base_tbl TO view_user2;
+SET SESSION AUTHORIZATION regress_view_user1;
+GRANT INSERT, DELETE ON base_tbl TO regress_view_user2;
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user2;
+SET SESSION AUTHORIZATION regress_view_user2;
INSERT INTO base_tbl VALUES (3, 'Row 3', 3.0); -- ok
INSERT INTO rw_view1 VALUES ('Row 4', 4.0, 4); -- not allowed
INSERT INTO rw_view2 VALUES ('Row 4', 4.0, 4); -- ok
SELECT * FROM base_tbl;
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user1;
-REVOKE INSERT, DELETE ON base_tbl FROM view_user2;
-GRANT INSERT, DELETE ON rw_view1 TO view_user2;
+SET SESSION AUTHORIZATION regress_view_user1;
+REVOKE INSERT, DELETE ON base_tbl FROM regress_view_user2;
+GRANT INSERT, DELETE ON rw_view1 TO regress_view_user2;
RESET SESSION AUTHORIZATION;
-SET SESSION AUTHORIZATION view_user2;
+SET SESSION AUTHORIZATION regress_view_user2;
INSERT INTO base_tbl VALUES (5, 'Row 5', 5.0); -- not allowed
INSERT INTO rw_view1 VALUES ('Row 5', 5.0, 5); -- ok
INSERT INTO rw_view2 VALUES ('Row 6', 6.0, 6); -- not allowed
DROP TABLE base_tbl CASCADE;
-DROP USER view_user1;
-DROP USER view_user2;
+DROP USER regress_view_user1;
+DROP USER regress_view_user2;
-- column defaults
my @args = (
"../../../../$Config/pg_regress_ecpg/pg_regress_ecpg",
"--bindir=",
- "--dbname=regress1,connectdb",
- "--create-role=connectuser,connectdb",
+ "--dbname=ecpg1_regression,ecpg2_regression",
+ "--create-role=regress_ecpg_user1,regress_ecpg_user2",
"--schedule=${schedule}_schedule",
"--encoding=SQL_ASCII",
"--no-locale",