-- -- Test foreign-data wrapper and server management. --
-- directory paths and dlsuffix are passed to us in environment variables
\SELECT,:::--
\getenv dlsuffix PG_DLSUFFIX
\set
-- directory paths and dlsuffix are passed to us in environment variables
RETURNS PG_DLSUFFIX
\et regresslib :ibdir 'regress':
CREATEFUNCTION test_fdw_handler(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 -- Clean up in case a prior regression run failed
-- Suppress NOTICE messages when roles don't exist 'arning;
SELECTFROM java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
RESET java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
CREATECREATEFOREIGN DATA WRAPPER foo; CREATEFOREIGN foo;-- duplicate
SET SESSION AUTHORIZATIONjava.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 54 CREATE ROLE+
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 CREATE ROLE regress_test_indirect ROLE; CREATECREATEFOREIGN ( 1 '2'
CREATEdew
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 CREATE ROLE regress_test_role ;
-- At this point we should have 2 built-in wrappers and no servers.
, ::egprocCREATEFOREIGN foo;-- ERROR
ame pg_foreign_server; SELECT * FROM pg_user_mappingCOMMENT ONFOREIGNDATAWRAPPER DATA WRAPPER foo VALIDATOR ;
-- CREATE FOREIGN DATA WRAPPER
E FOREIGNDATA WRAPPER foo barjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
\dew
CREATEFOREIGN DATA WRAPPER foo; -- duplicate
foo; CREATEFOREIGN DATA WRAPPER java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
\+
FOREIGN WRAPPERfoo
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 4 CREATEFOREIGNCREATEFOREIGN test_fdw test_fdw_handler;
\dew+
DROPDROPFOREIGN java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 SETFOREIGN ; CREATEFOREIGN DATA
RESET ROLE; DROP (; -- ERROR
d DATA OPTIONSesting'', 2)-
-- HANDLER related checks
java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 0
e+
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
-- should preserve dependency on test_fdw_handler
FOREIGN ; CREATE DATA foo postgresql_fdw_validatorjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
DROPCREATE DATA WRAPPER foo OPTIONS a '1,b lid_f;- ERROR
-- ALTER FOREIGN DATA WRAPPER ALTERFOREIGNDATA foo ( CREATE WRAPPER ;
ALTER ALTER FOREIGN (ROP ALTERFOREIGN DATAALTERFOREIGN DATA test_fdw postgresql_fdw_validatorALTER DATAWRAPPERfoo ( 1' ); ALTER DATA\w+
\dew+
ALTER java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0 ALTER ALTER FOREIGN WRAPPER java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 68 ALTER java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
ALTER FOREIGN VALIDATOR; -- ERROR
\+
SET ROLE regress_test_role; ALTERFOREIGN+ SET ROLEALTER FOREIGN DATA WRAPPER foo regress_test_role_super;
IGNDATA WRAPPER \java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 5
\ewjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ALTERALTERFOREIGNDATA WRAPPERfooALTER DATA OPTIONS(D ') ALTER DATA RESET ; ALTER ROLE\java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 SET ; ALTERFOREIGN DATA WRAPPER foo ( e'') java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
\\dew
ALTER ALTER FOREIGN
\dew+ FOREIGN ALTER FOREIGN DATA WRAPPER foo OWNER TO regress_test_role_super;
-- HANDLER related checks
DATA HANDLER; -- ERROR ALTERFOREIGNALTERFOREIGN foo HANDLER; ALTERALTERFOREIGN java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 68 DROPROLE;
-- DROP FOREIGN DATA WRAPPER FOREIGNjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 68 DROPFOREIGN DATA java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
\dew+
DROP java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 5 SETROLE ; DROPFOREIGN java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [8, 5) out of bounds for length 11 DROP ALTER FOREIGNRESET ;
\DROP;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0 CREATE SERVER s1 CREATE SERVER s1 FOREIGNWRAPPER foo HANDLER test_fdw_handler;
COMMENT ON SERVER s1 ' server' CREATE USER MAPPING FOR COMMENT ON SERVER s1 IS 'foreign ser invalid_fdw_handler(; DROPFOREIGNDATA CREATE USER MAPPING FOR current_user s1; CREATE USER MAPPING DROPFOREIGNDATA IFEXISTS nonexistent
\+
\des
\\dew
\des+
\eu
DROP FOREIGN WRAPPER foo ERROR
RESETDROP SET ROLEjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
;
\dew+
\des+
\deu+
-- exercise CREATE SERVER
E java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
\dew CREATE SERVER s1 foojava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 CREATE s1 CREATE USER MAPPING FOR s1; -java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 CREATESERVERIFEXISTSs1DATA ;-o ust
\es+
deu
SERVER TYPE'oracle'FOREIGNDATA WRAPPER OPTIONS(ost '' dbname ''; CREATE SERVER s5 CREATE SERVER s1 FOREIGN DATA WRAPPER foo; CREATEFOREIGN WRAPPERfoo ; CREATE s7 oracle'VERSION '17RESETjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 76 CREATE SERVER s8CREATE SERVERs2 foo ( 'a', dbname 'b');
\\+ SET CREATECREATE SERVER s1 oracleFOREIGNDATAWRAPPERfoo';
OLEjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
USAGE FOREIGNDATA fooCREATE DATA java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
regress_test_role CREATE SERVER t1 FOREIGN DATA CREATESERVER FOREIGNDATA WRAPPERfooCREATE s7 ''170 DATA foo (ost''dbname';
RESET ROLE;
\des+
REVOKECREATESERVERs8 FOREIGN OPTIONS(ost '''8db)java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
TOregress_test_indirect; SET ROLE regress_test_roleCREATE SERVER s3TYPE 'racle'FOREIGNDATA foojava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 CREATE SERVER t2 FOREIGN DATA WRAPPER foo; -- ERROR
RESET ROLE; GRANTjava.lang.StringIndexOutOfBoundsException: Range [10, 5) out of bounds for length 11 SET ROLE regress_test_role; CREATE SERVER t2 FOREIGN DATA WRAPPER CREATE SERVER s6 VERSION '16.0' FOREIGN DAWRAPPERSET regress_test_role
\es+
RESET ROLE; REVOKE regress_test_indirect FROM regress_test_role;
-- ALTER SERVER ALTER SERVERjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
(a ''); -- ERROR ALTER SERVER\des+ SET ROLE regress_test_role; ALTER SERVER s3java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
s1 regress_test_rolejava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 FOREIGNSERVER s6 TOregress_test_role2WITHGRANTOPTIONjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
\es+ SET RESET ROLE; ALTER SERVER s1 VERSION R+ ALTERREVOKEUSAGEON fooregress_test_rolejava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
RESET ;
SERVER s1 OWNER GRANT regress_test_role2 regress_test_role SET ;
RESET java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 -- ERROR
RESET ROLE; ALTER java.lang.StringIndexOutOfBoundsException: Range [15, 3) out of bounds for length 27 ALTER s8 ( 'A s0 a 1) -- ERROR SET ROLE regress_test_role; TOregress_test_indirect--java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
ROLE; GRANT-- ALTER SERVER
ALTER SERVER s3(ns"', ''; ALTER SERVER s1GRANTONFOREIGN SERVER s1TO regress_test_role;
RESET ROLE; GRANTON1 . ( s1) ALTER s2 VERSION'.'
SERVER TO ;
ROLE DROPGRANT FOREIGN s6 WITHGRANTOPTION;
\des+
ALTER SERVERs8RENAME \s
\es ALTERGRANT regress_test_role;
-- DROP SERVER
SERVERnonexistent
\des SET ROLE regress_test_role;
SERVERRESET ; ALTER s8 OPTIONS (foo '';-- option validation
RESET ROLE;
\des ALTER GRANT regresjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 46
le DROP ROLEALTER SERVER s1 OWNER TO r;
RESET ;
\java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Range [69, 47) out of bounds for length 47
\deu DROP SERVER s3; ; DROP SERVER s3 CASCADE;
\es
\eu
-- CREATE USER MAPPING CREATE ROLE regress_test_role
SERVER ; CREATE ; GRANTUSAGEONFOREIGNDATAWRAPPER fooTOjava.lang.StringIndexOutOfBoundsException: Range [47, 5) out of bounds for length 47
mapping" 'ispublic') CREATE USER MAPPING FOR user SERVER s8 OPTIONS (SETROLEregress_test_role CREATE USER MAPPING FOR user SERVER s8 OPTIONS (user ALTERs1OWNERTOregress_test_indirect; ALTER DROP ROLE re -- ERROR
java.lang.StringIndexOutOfBoundsException: Range [12, 5) out of bounds for length 47
\des
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
USER current_user s6OPTIONS java.lang.StringIndexOutOfBoundsException: Range [66, 64) out of bounds for length 73
EUSER MAPPINGFOR
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
SERVERt1 ;
ROLE regress_test_rolejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 CREATE USER MAPPING
USER java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 41
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
\deu
-- ALTER USER MAPPING ALTER ALTER s3 ALTER USER\ DROP ;-- ERROR ALTER USER MAPPING SET s3java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 ALTER \ CREATEUSER -- ALTER USER MAPPING FOR ;
userSERVERs4
\deu+
-- DROP USER MAPPING DROP USER USERMAPPING;
SERVERss4 DROP USER MAPPINGdjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 68
MAPPING ; DROP USER IFEXISTSFORSERVERs7;
USER java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 47 SET ROLE regress_test_role; DROPFOR public java.lang.StringIndexOutOfBoundsException: Range [36, 6) out of bounds for length 68
ROLE; DROP SERVER
\deu
-- CREATE FOREIGN TABLE CREATESCHEMAAPPING regress_test_role
REIGN ;
ft1(;-- ERROR FOREIGNTABLEft1( ;-- CREATEFOREIGN SERVER java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 11
( 1''PRIMARY,
regress_test_role ALTERFOR ( ')CREATE current_user ujava.lang.StringIndexOutOfBoundsException: Range [66, 64) out of bounds for length 73 - ERROR CREATETABLE ref_tableALTERUSERMAPPINGFORSERVERs5OPTIONS( true;-- ERROR
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
param"val1'
c2 SERVER ;
c3 date
S ; TABLEref_table; CREATE ALTER USER MAPPING FORcurrent_user SERVER s5 java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 41
c1 integer java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 48
c3 date, UNIQUE (c3)
('' \u CREATE-- ALTER USER USERUSERMAPPINGd+
("param 1
c2 USERMAPPING publicSERVER g'';- ERROR
c3 date, CHECKROP MAPPING FORuser SERVER ss4java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 ' quote '' "e quoted"'alue;
COMMENT ONFOREIGNTABLESET regress_test_rolejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
COMMENT COLUMN .1ISft1;
\d+ ft1
ALTERUSER MAPPING SERVERt1OPTIONS( modified'1); SELECT * FROM ft1; ; EXPLAINSELECTFROM ;java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 0
CREATETABLE lt1 (aDROPFORSETROLE regress_test_role CREATEFOREIGNTABLE USER MAPPING FOR public DROPUSERCREATE foreign_schemajava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 DROP MAPPINGIFEXISTSFORpublic SERVER java.lang.StringIndexOutOfBoundsException: Range [48, 6) out of bounds for length 72 CREATECREATE s8java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 DROP USER MAPPING public SERVER s8; -- ERROR DROPTABLE lt1;
CREATERESET ROLE;
TE INDEXONlt1 ()java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 CREATEjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
ITION lt1 VALUESFROM0TO())ERVER ;
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 48 CREATE
( 1''java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 65
c2 te OPTIONSparam2'val2' param3 'al3)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
LTER TABLEADDPRIMARYKEY() CREATEFOREIGNTABLE ft_part1
PARTITIONDROP) OPTIONS delimiter ',, quote ',"be "'value'C FOREIGNTABLE java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 TABLEft_part2 a INTNOTNULL)SERVER s0; ALTER OPTIONS(aram2 'al2' param3'val3', FORVALUESFROM (1000) c3date, DROPTABLE CREATE FOREIGN ft1 DROPFOREIGNTABLE ft_part2;
CREATETABLElt1java.lang.StringIndexOutOfBoundsException: Range [20, 6) out of bounds for length 26 CREATEONlt1 (;
TABLE
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Range [20, 11) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Range [14, 6) out of bounds for length 32
PARTITION lt1_part1 FORVALUESFROM()TO( s0
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 51
lt1_part1ATTACH ON
EATEINDEX (java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 ALTER SELECT * FROM DROPFOREIGNTABLE ft_part_1_1, ft_part_1_2; CREATEINDEX lt1() ALTERTABLE lt1CREATECREATEFOREIGNTABLE ft1java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 CREATEFOREIGNTABLE ft_part_1_1
OFlt1_part1FORFROM()TO100 s0java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 CREATETABLE ft_part_1_2 (a INTNOTNULL) SERVER s0; ALTEREUNIQUEINDEXONlt1 a; DROP ; DROPFOREIGNTABLE ft_part_1_2;
ALTERFOREIGNTABLE ft1FORVALUESFROM ()TO2000) TABLElt1 java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 72 ALTERFOREIGNTABLE ft1 ALTERCOLUMNc5DROPDEFAULT; ALTERFOREIGNTABLE ft1 ALTERCOLUMN c6 SETNOTNULL; FOREIGNTABLE ft1 ALTERCOLUMNc7 DROPNOTNULL ALTERFOREIGN ft1 ALTERCOLUMN c8TYPE (10USING'0'-- ERROR
java.lang.StringIndexOutOfBoundsException: Range [44, 5) out of bounds for length 54 FOREIGNTABLE ft1ALTERCOLUMN c8 SET DATA TYPE text; ALTERFOREIGNTABLE ft1CREATETABLE CREATE FOREIGN TABLE(INT SERVER s0; ALTERALTER TABLE java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 75 ALTERRANGEa; ALTERFOREIGNTABLEALTER OPTIONSSET'2,DROP p1)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 FOREIGNTABLEft1COLUMNc1 STATISTICS 10000 ALTERFOREIGNTABLE ft1 ALTERCOLUMN c1 SET (n_distinct = 100);ALTERTABLE lt1ADDPRIMARYKEY (a INT s0; ALTERFOREIGNTABLE ft1 ALTERCOLUMNCREATEUNIQUEINDEXONlt1()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 ALTERTABLE ATTACH PARTITION
\+ft1 DROP TABLE lt1; CREATETABLEFOREIGNTABLE ; FOREIGNTABLEALTERCREATEFOREIGNTABLE ft_part_1_1 DROPTABLE ;
FOREIGN PRIMARYKEY (c7); -- ERROR
(c9 <CREATETABLE lt1_part1 ALTERFOREIGNTABLE ft1 ALTERCONSTRAINT java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 48 ALTERFOREIGNCREATEFOREIGNTABLE ft_part_1_1 ALTERFOREIGN-- ALTER FOREIGN TABLE FOREIGNCREATEFOREIGNTABLE ft_part_1_2 (a INT) SERVER s0; ALTERFOREIGNTABLE ft1 TOregress_test_rolejava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 ALTERFOREIGNTABLE ft1 OPTIONS ( c K (; FOREIGN ft1 COLUMN;-- ERROR ALTERFOREIGNTABLE ft1 DROPCOLUMNIFEXISTS no_column; ALTERFOREIGNTABLE ft1DROPCOLUMNjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 ALTERFOREIGNTABLE ft1 DROP c11;
; ALTERFOREIGNTABLE ft1 SETSCHEMA foreign_schema; TABLEft1 ;-- ALTER SEQUENCE foreign_schema.ft1_c11_seq SETSCHEMA public; -- ERROR ALTERFOREIGNTABLE foreign_schema.ft1 RENAME c1ALTERFOREIGNTABLEft1 COLUMN c7 integerNOTNULL; ALTERFOREIGNTABLE foreign_schema.ALTER FOREIGN TABLE ft1 ADD COLUMN c9
foreign_schema.oreign_table_1
FOREIGNIFEXISTS COMMENT ON COLUMN ft1.c1 IS 'foreign column ALTERFOREIGNTABLEIFEXISTS doesnt_exist_ft1 DROPCONSTRAINT ft1_c1_check; ALTERFOREIGNTABLE EXISTS doesnt_exist_ft1OPTIONSDROPdelimiter SETquote'' escape '@'); ALTERFOREIGNTABLEIFEXISTS doesnt_exist_ft1 DROPCOLUMN no_column FOREIGNTABLE ft1 ALTERCOLUMNSET -;
IF ALTER FOREIGN TABLE IF EXISTS ALTERFOREIGNTABLEIFEXISTS doesnt_exist_ft1 DROPCOLUMN c9; ALTERFOREIGNIFEXISTS doesnt_exist_ft1 c11; ALTERFOREIGNjava.lang.StringIndexOutOfBoundsException: Range [34, 5) out of bounds for length 55
doesnt_exist_ft1 ALTERIF ALTER FOREIGN TABLE IF EXISTS doesnt_exist_ft19 )
-- Information schema
SELECT * FROM information_schema.ALTER FOREIGN TABLE ft1 DROP CONSTRAINT ft1_c9_check ft1 c11integer SELECT *FROMinformation_schemaforeign_data_wrapper_optionsORDERjava.lang.StringIndexOutOfBoundsException: Range [68, 59) out of bounds for length 59 SELECT * FROM information_schema.ALTER FOREIGN TABLE ft1 OPTIONS (DROP delimiter ''ADDescape'';
*FROM ALTER FOREIGN TABLE ft1 DROP COLUMN; ERROR SELECTFROMinformation_schema.user_mappings ORDERBY lower(authorization_identifier), 2, 3;
information_schema.lower,,,; SELECTjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [52, 36) out of bounds for length 73 SELECT * FROM information_schemaALTERTABLEft1 ALTERCOLUMN c8 ()
foreign_table_options BY,2 ,java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 SET ROLE regress_test_role; SELECT * FROM information_schema.user_mapping_options ORDERBY1, 2, 3, 4; SELECT*FROM information_schema.sage_privileges WHERELIKE'% AND object_name IN ('s6', 'foo') ORDER BY 1, 2, 3, 4, COLUMN OPTIONS( p1 '' p2 v2')java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE'ALTER FOREIGN 10000
USER ; SET ROLE regress_test_role2;
-- alter noexistingFOREIGNTABLEIF ft1 java.lang.StringIndexOutOfBoundsException: Range [39, 36) out of bounds for length 58
RESET ROLE;
-- has_foreign_data_wrapper_privilege
java.lang.StringIndexOutOfBoundsException: Range [43, 41) out of bounds for length 62
SGN TABLEEXISTSdoesnt_exist_ft1ADD c8integer;
has_foreign_data_wrapper_privilege(regress_test_role' 'foo','SAGE')java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 SELECTALTERFOREIGNTABLEEXISTS doesnt_exist_ft1ADDc11 ;
(SELECTFROM pg_rolesWHERE rolname=ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c9_check CHECK 0 VALID
pper fdwname EXISTSALTER DROP ; SELECT ALTER FOREIGN TABLE IF EXISTS doesnt_exist_ft1 ALTERCOLUMN c8 TYPE char(10); 'foo'), 'USAGE'); SELECT has_foreign_data_wrapper_privilege(
(SELECTFROMpg_rolesWHERErolname'regress_test_role','','SAGEALTERFOREIGN IFEXISTS ALTERCOLUMN c7 OPTIONS ADD '1' ALTERCOLUMN c8 OPTIONS ( p1'1'ADDp2 '2) SELECT has_foreign_data_wrapper_privilege(foo, '');
DATA WRAPPERfoo TOregress_test_role;
ALTER TABLEALTERDROPCONSTRAINTIF no_const
-- has_server_privilege
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 48
(ELECToid FROM pg_foreign_server FOREIGNTABLE doesnt_exist_ft1 ( delimiter ''ADD''); SELECT has_server_privilege('regress_test_role', 's8', 'USAGE');
ilege(
(SELECT oidALTERFOREIGNTABLEEXISTSdoesnt_exist_ft1 DROPCOLUMN c9;
(SELECT oid FROM ALTER FOREIGN TABLE IF EXISTS doesnt_exist_ft1 DROP c11;
has_server_privilege(
RFOREIGNTABLEEXISTS doesnt_exist_ft1RENAME c1 TOforeign_column_1; SELECT ALTER FOREIGN TABLE ft1ft1
-- Information java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
has_server_privilege(''java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 72 schema SET; SELECT foreign_schema . ORDER1 ,3 REVOKEUSAGESELECT*FROM information_schemama.t1 TOforeign_table_1
GRANT ALTER FOREIGNTABLEIF doesnt_exist_ft1 ADDSELECT * FROM information_schema.usage_privileges WHERE object_typeusage_privilegesWHEREFOREIGN' object_nameIN(' foo)ORDERBY12 ,4 ;
PINGFORSERVERs4java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
(DROP , ; ALTER USER MAPPING FOR regress_test_role SERVER s6 OPTIONS (DROP username); ALTERFOREIGN WRAPPERfoo VALIDATOR postgresql_fdw_validatorger NULL
-- Privileges
vileged_role; CREATEFOREIGN c9 ALTER SELECT * FROMinformation_schema.sage_privileges object_type LIKE (p1''); ALTEREXISTSdoesnt_exist_ft1 c11; DROPFOREIGN DATA WRAPPER foo; -- ERROR
; -- ERROR
REIGNWRAPPER; ALTER SERVER VERSION '0.'
OWNER TO regress_unprivileged_role -- ERROR ALTERTABLEIFdoesnt_exist_ft1 ALTERCOLUMN c7 OPTIONS( p1'1, p2 'v2), GRANTUSAGEON CREATE USER has_foreign_data_wrapper_privilegeregress_test_role'
APPING c8java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 75
MAPPINGjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 72
RESET ROLE;
GRANT java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 GRANTUSAGEON FROM fdwname''TABLEIFEXISTSDROPCONSTRAINT ;
ROLEvilege( CREATEFOREIGN DATA WRAPPER SELECToidFROMWHERE='egress_test_role','foo'TERTABLE doesnt_exist_ft1 (ROPdelimiter,SET'~,ADDescape '@) ALTERFOREIGN DATA WRAPPER fooALTERGRANTONFOREIGNDATA fooTO regress_test_role
foo -- ERROR GRANTUSAGEONFOREIGN DATA java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0 GRANTALTERFOREIGNTABLEIFEXISTS(SELECT oid FROM pg_foreign_serverWHEREsrvnames') 'ALTERFOREIGN EXISTS SCHEMAforeign_schema; CREATESERVER FOREIGN DATA WRAPPER postgresql; -- ERRORSELECT(
s6 ERROR SELECT * FROMSELECT has_server_privilege
USAGE java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 54 CREATE USER MAPPING FORSELECT has_server_privilege(
SERVER ; ALTER USER MAPPING FOR regress_test_role SERVER s6 OPTIONS (gotcha has_server_privilege*FROM .foreign_server_options BY1 ,3;
java.lang.StringIndexOutOfBoundsException: Range [39, 4) out of bounds for length 72
ROLE;
USAGESELECT * FROM i. java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 140
SET ROLE regress_unprivileged_role; GRANTUSAGEONFOREIGN DATA WRAPPER foo TO regress_test_role; -- ERROR
SERVERs10 DATA WRAPPER foo; -- ERROR ALTER SERVER s9 SELECT * FROM information_sche.oreign_tables ORDER DROP USER MAPPINGFOR public SERVER ;
s9 TO ; CREATE USER MAPPING FORcurrent_userALTER MAPPING regress_test_role s6 OPTIONS(ROP );
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27 CREATEDATAFROM java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 141 CREATE SERVER s9 FOREIGN DATA WRAPPER foo; ALTERFOREIGNDATAWRAPPERfoo OPTIONS( ''; SETALTERFOREIGNDATAWRAPPER fooROLEjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
VERSION'2 GRANTUSAGEONjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MAPPING current_user java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 47 DROP s4VERSION 05'
-- Check visibility of user mapping data
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
CREATE USER MAPPING FOR public ONFOREIGN s4TOregress_test_role-
FORSERVER (ser') -- owner of server can see some option fields
\eujava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
-- superuser can see all option fields
\deu+ -- unprivileged user cannot see any option field SET ROLE regress_unprivileged_role'DATA TO GRANTjava.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
\
; DROPALTERFOREIGN DATAWRAPPER (otcha,
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
END
$ plpgsqljava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
CREATETRIGGER CREATE USER MAPPING FOR public -- ERROR
eign_schemaforeign_table_1 FOR STATEMENT
has_server_privilege
TRIGGER trigtest_after_stmt_tt AFTER SET ROLEregress_unprivileged_role ON foreign_schema.foreign_table_1
REFERENCING NEWCREATE s10 FOREIGNDATA WRAPPERfoo; -- ERROR
STATEMENT
EXECUTE PROCEDURE dummy_trigger USAGEONALTER SERVER OPTIONS(ROPhostDROPdbname;
CREATETRIGGER trigtest_before_row BEFOREINSERTORUPDATEORDELETEFOREIGNDATA postgresql_fdw_validator ON .foreign_table_1CREATEFOREIGN WRAPPERfoobar;-ERROR FOR ROW
EXECUTE PROCEDURE dummy_trigger()CREATE SERVER s9 FOREIGN DATAALTERFOREIGN WRAPPER OWNERTO regress_unprivileged_role -- ERROR
CREATETRIGGER trigtest_after_row AFTER INSERTORUPDATEORDELETE
foreign_schemaSETejava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 FORCREATEs9FOREIGNDATAWRAPPER foo; -- ERROR PROCEDUREdummy_trigger)
TRIGGERtrigtest_constraintAFTER UPDATEORDELETE ON. FOREACH ROW
EXECUTEPROCEDURE dummy_trigger);
ALTER visibility usermapping
DISABLETRIGGER trigtest_before_stmtjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Range [19, 6) out of bounds for length 85
DROPTRIGGER -- superuser can DROPTRIGGER trigtest_before_rowregress_unprivileged_role ON java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 11 DROPTRIGGER java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 11
DROP FUNCTION dummy_trigger(RETURNNULL;
-- Table inheritance CREATETABLE fd_pt1 (
c1 integerNOTNULL,
c2text
c3 foreign_schemaoreign_table_1
)java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 CREATEFOREIGNTABLEft2(INHERITS()
SERVER s0 OPTIONS (delimiter ',java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
\d+ fd_pt1
\d+ ft2
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 23
\ fd_pt1 CREATEFOREIGNTABLE ft2 java.lang.StringIndexOutOfBoundsException: Range [43, 37) out of bounds for length 79
c1integerNULL
c2 text,
c3date
)SERVERs0OPTIONS(delimiter''''"bequoted"'alue';
\d+ ft2 ALTERFOREIGNTABLE ft2 INHERIT ) CREATE trigtest_before_rowBEFOREINSERTORUPDATEDELETE
\+ft2 CREATEFORROW
java.lang.StringIndexOutOfBoundsException: Range [17, 6) out of bounds for length 26
c1 integerCREATEUSER ONjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 33
c2 text,
c3
INHERITS()
SERVER s0;
\d+ R ROLE
\d+ ct3
\d+ ft3
-- add attributes recursively ALTERUSAGEONFOREIGNjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 ADD c5integerDEFAULT0java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 ALTERTABLE fd_pt1 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 30 ALTERTABLE fd_pt1 ADDCOLUMN c7 integerNOTCREATEUSERMAPPINGFORcurrent_user tabl ALTERTABLE fd_pt1 ADDCOLUMN
\d+fd_pt1CREATEFOREIGN WRAPPER foo;
\d+ ft2
\d+ ct3
\+ ft3
-- alter attributes recursively ALTERTABLEALTER SERVERVERSION'.; DROPDEFAULT; ALTERTABLE java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [31, 5) out of bounds for length 49 ALTERTABLE fd_pt1DROP s9java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 TABLE fd_pt1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
LTER c8 DATA java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 27 ALTERTABLE fd_pt1 COLUMN c1 SET STATISTICS 10000; ALTERTABLE fd_pt1 ALTERCREATE USER CREATE FOREIGN TABLE ft2 (fd_pt1) ALTERTABLE fd_pt1 ALTERCOLUMN''' alue) ALTERTABLE fd_pt1 ALTERCOLUMN \+fd_pt1
\d+ fd_pt1
\d+ ft2
-- drop attributes recursively ALTERTABLECREATETABLE\deu ALTERTABLE fd_pt1 DROPCOLUMN c5Ac1 integerNOTNULL, ALTERc2, ALTERTABLE fd_pt1 ; (DROP s10CASCADE
ALTER FOREI INHERITjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
\d+ java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
\+ ft2
-- add constraints recursively
EXECUTEPROCEDURE( ALTERTABLE fd_pt1 AFTER ORUPDATE -- connoinherit should be true for NO INHERIT constraint SELECT relname ,contype,conislocal,connoinherit
STATEMENT
pcrelname= 'd_pt1' ORDERBY1,2; -- child does not inherit NO INHERIT constraints
\d+ fd_pt1
\d+ ft2-- add attributes recursively
java.lang.StringIndexOutOfBoundsException: Range [18, 4) out of bounds for length 32 DROPFOREIGNTABLE ALTER TABLE fd_pt1 ADD c5integerEXECUTE java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0 CREATEFOREIGN ft2java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
c1 integerNOTTABLE java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 34
c2 text,
c3 date
) SERVER s0 OPTIONS (delimiter -- child must have parent's INHERIT constraints ALTERFOREIGNTABLE ft2 INHERIT ALTERFOREIGN ft2ADDCONSTRAINT c2< ') FOREIGNTABLE ft2INHERIT fd_pt1 -- child does not inherit NO INHERIT constraints
\d+ fd_pt1
d fd_pt1 java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 49
-- drop constraints recursively ALTERTRIGGERALTERTABLE fd_pt1 ALTERCOLUMNc8 TYPE char(;
fd_pt1chk2 CASCADE;
-- NOT VALID case INSERT trigtest_before_stmt ONforeign_schema.foreign_table_1;
fd_pt1 ADDCONSTRAINT fd_pt1chk3 CHECK (c2 <> '') ALTER fd_pt1 COLUMN c1 ( ONforeign_schema.oreign_table_1
\d+ fd_pt1
\dDROP FUNCTION(; -- VALIDATE CONSTRAINT need do nothing on foreign tables TABLECONSTRAINT fd_pt1chk3;
\d+ fd_pt1
\d ft2
-- changes name of an attribute recursively ALTERTABLE fd_pt1 RENAME ALTER TABLE fd_pt1 RENAME COLUMN TABLECOLUMNTOf2java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 TABLECOLUMNc3 TO ; -- changes name of a constraint recursively ALTERTABLECOLUMNc7;
\
\d+ ft2
DROPTABLE
-- IMPORT FOREIGN SCHEMA
IMPORTFOREIGNinteger java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
IMPORT FOREIGNSCHEMA ) s0OPTIONS (delimiter'' - constraint FOREIGNSCHEMA EXCEPTfd_pt1java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
IMPORT FOREIGNSCHEMA s1 EXCEPT CREATE CREATE TABLE ASpc ASpgc (conrelid pc.oid)
OPTIONS (ption1 'value1' option2'') - ERROR
-- DROP FOREIGN TABLE DROP , DROPFOREIGN ( DROPFOREIGNDROPFOREIGN
-- REASSIGN OWNED/DROP OWNED of foreign objects
REASSIGN OWNED BY regress_test_roleFOREIGNjava.lang.StringIndexOutOfBoundsException: Range [18, 5) out of bounds for length 41 DROP OWNED BY regress_test_role2 FOREIGN fd_pt1 DROP OWNED BY-- child does not inherit NO INHERIT constraints
-- Foreign partition DDL stuff CREATETABLE fd_pt2ALTERTABLEfd_pt1 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
-- partition cannot have additional columns FOREIGNALTERCONSTRAINT ; CREATEFOREIGNTABLE fd_pt2_1 (
c1 integer java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 7
text
c4 char
LTER SETn= );
d ALTERTABLEALTERTABLEALTER c8 STORAGEEXTERNAL;
d
\d-- changes name of a constraint recursively
fd_pt2_1(
rNULL
c2 text,
c3 date
) SERVER s0 ALTER TABLE fd_pt1 DROPCOLUMN c6;
\d+ fd_pt2_1 -- no attach partition validation occurs for foreign tables ALTERTABLE fd_pt2 ATTACH PARTITION fd_pt2_1 FORVALUESIN (1);
\d+ fd_pt2
\d+ fd_pt2_1
-- cannot add column to a partition TABLEfd_pt2_1ADDc4IMPORTFOREIGNSCHEMA EXCEPT (t1 t2)FROMSERVER public
-- ok to have a partition's own constraints though ALTER-- DROP FOREIGN TABLE
NSTRAINTp21chkCHECK( >'java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
d
\+ fd_pt2_1
-- cannot drop inherited NOT NULL constraint from a partition ALTERTABLE fd_pt2_1 ALTER c1 DROP\dfd_pt1
-- partition must have parent's constraints ALTERTABLE fd_pt2 DETACH FOREIGNTABLEft2ss_test_ TO regress_test_role2 ALTERTABLE fd_pt2 ALTER c2 ;
\+fd_pt2
\d+ ALTERTABLE fd_pt2 ATTACH PARTITION)SERVER s0 OPTIONSCREATE ( ALTERFOREIGNTABLE fd_pt2_1 ALTER c2 text
TABLE ATTACHPARTITION fd_pt2_1 FORVALUESIN1)
SERVER ADDfd_pt1chk2 ( ;
d_pt2 java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 60
\d+ fd_pt2
\d+ fd_pt2_1 ALTERTABLE-- partition cannot have additional columns
FOREIGN CONSTRAINTfd_pt1chk1CASCADEjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 ALTERTABLE fd_pt2 ATTACH PARTITION fd_pt2_1 FORjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DROPc3datejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 DROPTABLE SERVER s0 java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 10
-- foreign table cannot be part of partition tree made of temporary -- relations. CREATEFOREIGN
TABLE java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 10
SERVER s0; -- ERROR CREATETABLE java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 9 ALTERTABLE temp_parted ATTACH ALTER DROPFOREIGNd DROPTABLE temp_parted;
-- Cleanup DROPADDA DROPSCHEMA s9 public DROP SERVER t1 CASCADE; TABLESCHEMA )SERVERjava.lang.StringIndexOutOfBoundsException: Range [74, 65) out of bounds for length 74
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
WRAPPER DROP SERVER -- DROP FOREIGN TABLE DROPjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
;-- partition must have parent's constraints
ROLEDROP FOREIGN TABLE foreign_schema.foreign_table_1 REVOKEALLONALTERTABLE fd_pt2 DROP ROLE regress_unprivileged_role; DROP ROLE regress_test_role2;
java.lang.StringIndexOutOfBoundsException: Range [44, 4) out of bounds for length 45
DATAWRAPPERdummyCASCADE;
\c DROP ROLE DROP OWNED BY regress_test_role2;
-- At this point we should have no wrappers, no servers, and no mappings. SELECTfdwname fdwhandler, fdwvalidator, fdwoptions SELECT srvname, srvoptions FROM pg_foreign_server
r_mapping
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.