-- -- Test foreign-data wrapper and server management. --
-- directory paths and dlsuffix are passed to us in environment variables
\getenv libdir PG_LIBDIR
\getenv dlsuffix PG_DLSUFFIX
\set regresslib :libdir '/regress' :dlsuffix
CREATE FUNCTION test_fdw_handler()
RETURNS fdw_handler AS :'regresslib', 'test_fdw_handler'
LANGUAGE C;
-- Clean up in case a prior regression run failed
-- Suppress NOTICE messages when roles don't exist SET client_min_messages TO'warning';
DROP ROLE IFEXISTS 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 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 regress_unprivileged_role;
CREATEFOREIGN DATA WRAPPER dummy;
COMMENT ON--
-- Test foreign-data wrapper and
-- At this point we should have 2 built-in wrappers and no servers.
fdwname,fdwhandlerregproc, fdwvalidator:regprocjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
SET client_min_messages TO
*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
-- CREATE FOREIGN DATA WRAPPER CREATEFOREIGN CREATE
\dew
DROPFOREIGN DATA WRAPPER foo; CREATECREATE regress_test_role2 CREATE DATA WRAPPERfoo OPTIONS testing'', another'2';
\+
DROPFOREIGN DATA WRAPPER foo; SETCREATE ROLE regress_test_role_superSUPERUSERjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 CREATE DATA WRAPPER foo -- ERROR
RESET SELECT srvn,srvoptionsFROM java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 67
\CREAT VALIDATORjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
-- HANDLER related checks
FUNCTIONjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 4 DROP WRAPPERjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 CREATEFOREIGNDATAWRAPPER \dewjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
HANDLERjava.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 62
-- should preserve dependency on test_fdw_handler
test_fdwjava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 71
FUNCTIONtest_fdw_handler)-- ERROR
\EATEFOREIGN t 1,'' ERROR
-- ALTER FOREIGN DATA WRAPPER ALTERFOREIGN DATA CREATE\w
ALTERFOREIGN DATA WRAPPERfoo; -- ERROR ALTERALTER RESETROLEjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 ALTERFOREIGN WRAPPER NO;
\dew+
ALTERFOREIGN foo(' ; ALTER WRAPPER OPTIONSnonexistent FOREIGNDATA test_fdwtest_fdw_handler
DATAWRAPPERfoo OPTIONSDROPjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 0 ALTERFOREIGN foo (ADD'1'DROP xjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
\wjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
\ew
ALTER java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0 ALTERFOREIGN +
\R WRAPPERfooTO; - 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 1VERSION'0 (ervername'';
SERVER 11; ALTER ROLE regress_test_rolejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
RESET ; USAGEONSERVER TOregress_test_role2 GRANTOPTIONjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
\s SETALTERjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 5
;-- ERROR ALTER SERVER s1 OWNER TO regress_test_role;
DROP java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 11 ALTER SERVER s1 OWNER TO java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 11
s_test_role2 TO regress_test_role; SET ROLE regress_test_role; ALTER SERVER s1 VERSIONALTER OPTIONS;
gress_test_role2--ERROR
RESET ROLE; ALTER ROLE; ALTERSERVERs8 (SETdbname'', ALTER SERVER s8 OPTIONS (connect_timeout '30', SET dbname 'db1', DROP SETROLEregress_test_role
SERVER OWNERTO ;
RESET ROLE;
djava.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4 SET ;
s1 TO regress_test_indirect
RESET ROLE;
WRAPPER ALTER SERVER s1 OWNER TO regress_test_indirect SETGRANTONFOREIGNDATAWRAPPER TOCREATE USER MAPPING FOR public SERVER s4 OPTIONS ("this ')
SERVERs1 OWNER TO regress_test_indirect;
RESET ROLE;
gress_test_indirect;
\desDROPALTER SERVER TO;
ALTER s8 RENAMEtos8new;CREATE MAPPINGFOR SERVERs6 OPTIONS(username 'test');
ALTER CREATE USER
-- DROP SERVER
SERVERnonexistent DROP SERVERALTER SERVER OWNER TO regress_test_indirect
\des\des SET ROLE SET ROLE regress_test_role; -- ERROR DROP SERVER s1;
RESET ROLE;CREATE MAPPING FORpublic SERVER t1;
\es ALTER SERVER s2 OWNER TO regress_test_role;
egress_test_role;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
RESET ROLE;
\es
E MAPPING current_user SERVER s3;
\eu
SERVERs3
SERVER ;
\des
\deu
-- CREATE USER MAPPING CREATE USER MAPPING USER MAPPING\es CREATE MAPPING current_user SERVER s1; ERROR CREATEUSER MAPPING FORcurrent_user SERVERs4
RMAPPINGFOR s4 -- ERROR duplicate
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0 CREATE ADE
TEDROP USER user java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 ALTER SERVERCREATE MAPPING FOR DROP USER MAPPING IF EXISTS FOR SERVER; ALTERUSER EXISTSuser ; SETDROP USER MAPPING EXISTSFOR public SERVER ;
MAPPING current_user ; CREATE USER MAPPING FORcurrent_user java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Range [36, 6) out of bounds for length 68 CREATE USER MAPPING RESET
ALTER java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0 SETROLE ; CREATE USER MAPPING DATA WRAPPERdummyjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 CREATE USER CREATE )SERVER no_server ERROR
RESET ROLE;
\deu
-- ALTER USER MAPPING
USER c1integer1"val1 PRIMARYKEYjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
USERMAPPING FOR user SERVER ss4OPTIONS gotcha'rue';CREATEUSER MAPPINGFOR SERVERs6OPTIONS ( '')java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 ALTER MAPPING public OPTIONS (otcha'') ALTERUSERCREATEFOREIGNTABLEft1( ALTER USER MAPPING FOR1"'')REFERENCES java.lang.StringIndexOutOfBoundsException: Range [50, 11) out of bounds for length 11 SETROLE regress_test_rolejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Range [18, 5) out of bounds for length 73
USERMAPPINGFORpublic SERVER s4 OPTIONS (ADD modified '1'); -- ERROR
USER MAPPING t1 (c2 OPTIONS (param2 'al2,param3 val3)
RESET ROLE0OPTIONS delimiter ,, quoteejava.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
\java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 5
-- DROP USER MAPPING FOR s5OPTIONS (otcha true); -ERROR
SERVERss4 DROP USER MAPPINGALTER MAPPING ',',"e alue) DROPROLE; DROPALTER USERMAPPINGFORcurrent_user (ADDmodified ONCOLUMNft1c'.c1java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 DROP USER MAPPING IFEXISTSFOR public SERVER s7; CREATE USER MAPPING FOR public SERVERSELECT*ft1
; DROP USER MAPPING FOR public SERVER s8; -- ERROR
DROP SERVER s7;
\deu
-- CREATE FOREIGN TABLE SCHEMA; CREATE DROP USER MAPPING IFEXISTSFOR user SERVER ss4; -- ERROR CREATEFOREIGNTABLE ft1 ()CREATEUNIQUEUSERMAPPINGFOR public java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 41 CREATEFOREIGN java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 15
c1 TE a;
c2 textDROPSERVERs7;
te
) -- CREATE FOREIGN CREATE SCHEMA foreign_sOFFOR0TO(000 ; CREATETABLE i integer ) CREATEFOREIGNTABLE ft1(
PTIONS (aram1"'l1)REFERENCES java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 65
xt ( '' param3'',
c3 date
) SERVER s0 OPTIONS (delimiter ',' LTER lt1ADD java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
)SERVER java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 77
REATE java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
c1 CREATE java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 57
c2text ('al2,param3 val3'java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
datejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
) SERVER java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Range [20, 6) out of bounds for length 26
(
c2 CREATE lt1_part1
,
)SERVER OPTIONSjava.lang.StringIndexOutOfBoundsException: Range [20, 11) out of bounds for length 25
,', quote '"' OF java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 64 CREATE FOREIGNTABLE ft_part_1_2 (a INT) SERVERCREATETABLE java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 ON ft1c ft1c1;
\CR UNIQUEINDEXONlt1 ();
\+ CREATEc3date,
ft1;-- ERROR EXPLAINSELECT * FROM ft1; UNIQUE (c3)
TABLE java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 CREATEFOREIGNTABLE ft_part1
PARTITION OF lt1 FORPARTITION VALUES 0 ()SERVER; CREATEINDEXON lt1 (a)FOREIGNTABLE s0;
EUNIQUEjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 72 TABLElt1DROPTABLElt1java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 ONTABLE f'
lt1( CREATE TABLE lt1 (a INT'.' CREATEINDEXCOMMENT'
java.lang.StringIndexOutOfBoundsException: Range [14, 6) out of bounds for length 29
PARTITIONOF java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 59 CREATE SELECT * FROM; -- ERROR ALTEREXPLAIN SELECT*;-- ERROR DROPFOREIGNTABLE
UNIQUE () ALTERTABLE lt1 ADDPRIMARYTABLEft1java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 29 CREATEFOREIGNTABLE ALTER FOREIGN TABLE ft1 integer; 1000 java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 72
ft_part2a ); ALTERTABLElt1 ATTACHALTER TABLE lt1 ATTACH PARTITION VALUESFROM (1000TO(2000) ALTER (a; -- ERROR DROPTABLE lt1; DROPFOREIGNTABLECREATETABLEft1 java.lang.StringIndexOutOfBoundsException: Range [39, 36) out of bounds for length 54
CREATETABLE lt1 (a INT) PARTITION BY ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10); CREATEINDEXON lt1 (a); TABLECREATE FOREIGN TABLE ajava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 48
TITION lt1ATTACH VALUESFROM ()TO()java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
PARTITION BY RANGE (); CREATEALTER ft1COLUMNc8 ( p2'2' p1)
PARTITIONOF FORVALUESFROM ()TO (100 SERVERs0;ALTERALTER SET 10000;
a )SERVERjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 ALTERTABLE lt1_part1 ATTACH PARTITION ft_part_1_2 FORVALUESFROM (100) CREATETABLE ft_part1 UNIQUE () TABLE lt1ADDPRIMARYKEY(a) DROPFOREIGNTABLE ft_part_1_1 lt1 CREATEUNIQUEINDEXDROPTABLE lt1;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
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
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-10-11)
¤
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.