Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Netbeans/ide/xml.multiview/   (Netbeans IDE Version 28©)  Datei vom 3.10.2025 mit Größe 3 kB image not shown  

Quelle  create_table_like.sql   Sprache: SQL

 

/* Test inheritance of structure (LIKE) */
CREATE ( text ''

/*/*
 *Test inheritance
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * Ensure java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
 * INCLUDING DEFAULTS is specified
 */

CREATE TABLE ctla (aa TEXT);
  bbTEXT)INHERITS()java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

CREATE TABLE foo (LIKE nonexistentSELECT FROM;/* Has ee entry */

CREATE TABLE inhe (ee text, LIKE inhx) inherits (ctlb);
INSERT INTO inhe VALUES ('ee-col1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
INTO;
SELECT * inhfjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 38
SELECT * FROM ctla; /* Has ee entry */

CREATE CREATETABLEjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 60

CREATE TABLE inhf (LIKE inhx INCLUDING TABLE;
INSERT INTO CREATE TABLE inhg   inhx INCLUDING ,y;/
SELECT * FROM inhfINTO VALUES','',') /* Succeeds */

ALTER TABLE inhx add constraint foo CHECK (xx = 'text');
ALTER   ADDPRIMARYKEY xx;
CREATE TABLE inhg (LIKE inhx); /* Doesn't copy constraint */
INSERT INTO inhg VALUES ('fooSELECT *FROMinhg * Two records with three columns in order x=x, xx=text, y=y */ ;
DROPTABLE inhgjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 TABLEinhg xtext inhx java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
INSERT INTO inhg VALUES ('x', 'text', 'y'); /* Succeeds */
INSERTSELECT*test_like_id_1
INSERTCREATETABLE test_like_id_2( )java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  FROMinhg;/* Two records with three columns in order x=x, xx=text, y=y */
DROP TABLE inhg;

SELECT*FROMtest_like_id_2  - was copied
\ 
dtest_like_id_3
INSERT  (b VALUES'java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
CREATE TABLE test_like_id_2 (LIKE test_like_id_1);
\d test_like_id_2
INSERT INTO test_like_id_2 (b) VALUES ('b2');
   ;-- identity was not copied
CREATE TABLE test_like_id_3 (LIKE test_like_id_1 INCLUDING IDENTITY);
\d test_like_id_3
INSERT INTO FROM test_like_gen_1;
SELECT  java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 52
DROP TABLE test_like_id_1, test_like_id_2, test_like_id_3*test_like_gen_2;

CREATE java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
\ test_like_gen_1
INSERT INTO test_like_gen_1 (aSELECT* FROM test_like_gen_3;
SELECT * FROM test_like_gen_1;
CREATE TABLE test_like_gen_2 (LIKE DROP TABLE test_like_gen_1, test_like_gen_2, test_li
\d test_like_gen_2
INSERT INTO test_like_gen_2 (a) VALUES (1);
SELECT *FROM ;
CREATE TABLE test_like_gen_3a *2)STOREDjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
\d test_like_gen_3
\d test_like_4
SELECT TABLE  (IKEtest_like_4);
DROP TABLE test_like_gen_1, TABLE test_like_4b (LIKE test_like_4

-- also test generated column with a "forward" reference (bug #16342)
CREATE (  DEFAULTSGENERATEDjava.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
  c int GENERATED ALWAYS AS ,,  java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  a int CHECKa,,c java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
\d test_like_4
CREATE SELECT a, b, c FROM test_like_4c;
INSERT a (;
CREATE TABLE test_like_4c (LIKE  ,,c;
CREATE TABLE test_like_4d (LIKE test_like_4 INCLUDING DEFAULTS INCLUDING GENERATED);
\d  test_like_5x ( intCHECK ( >0),
INTO a (11)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
SELECT ,b FROM ;
\d test_like_4b
INSERT INTO test_like_4b (a) VALUES(11);
SELECT a, b, c FROM test_like_4b;
\
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SELECT a, b, c FROM test_like_4c;
\ 
INSERT INTO test_like_4d (a) VALUES(11STATISTICS  (| )FROM ;
 a b,  FROM;

-- Test renumbering of Vars when combining LIKE with inheritance
CREATE TABLE test_like_5 (x CREATE TABLE test_like_6c (LIKE test_like_6 INCLUDING ALL);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    intGENERATED ALWAYS AS( * 2 STORED;
CREATE TABLE test_like_5c ( test_like_4 INCLUDING ALL)
  INHERITS (test_like_5, test_like_5x);
\d test_like_5c

-- Test updating of column numbers in statistics expressions (bug #18468)
);
CREATE STATISTICSext_stat (a |b)FROM ;
ALTER TABLE test_like_6 DROP COLUMN c;
CREATE TABLE test_like_6c (LIKE
\+test_like_6c

DROP TABLE test_like_4INSERT INTO inhg VALUES (5, 10);
DROP TABLE test_like_5,INSERTINTO inhgVALUES (20, 10); -- should fail
DROP java.lang.StringIndexOutOfBoundsException: Range [48, 11) out of bounds for length 48

CREATE CREATE TABLE(  DEFAULT text,   UNIQUEjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
inhg ( );
INSERT INTO inhg VALUES (20, 10); -- should fail
DROP TABLE inhg;
/* Multiple primary keys creation should fail */
CREATE TABLE CREATE TABLE inhg (x text UNIQUE, INCLUDING)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
CREATE TABLE inhz (INSERT  inhg xx ,x  ',10,15)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
CREATE UNIQUE INDEX inhz_xx_idx on inhz (xxjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
/* Ok to create multiple unique indexes */
 TABLE  (  ,LIKE   )java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
   xx ,x  '' 5,10)
INSERT INTO inhg (xx, yy, x) VALUES ('test', 10, 15);
 INTO (x , x '' 10 ) -- should fail
DROP TABLE inhg;
DROP  ON,FROMctlt1

/* Use primary key imported by LIKE for self-referential FK constraint */keyby  -   java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
CREATE TABLE inhzONjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 57
\
DROP TABLE inhz;

-- including storage and comments
CREATE TABLE ctlt1 (a text CHECK (length(a) > 2) ENFORCED  java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 61
 b text CHECK (length(b) > 100)COMMENT  INDEX ISindexb_key;
 (length(  100 NOT;
CREATE INDEX ctlt1_b_key ON ctlt1 (b);
  ON (| );
CREATE STATISTICS ctlt1_a_b_stat ON a,b FROM ctlt1;
 (a | )FROM;
COMMENT ON STATISTICS ctlt1_a_b_stat IS 'ab stats';
COMMENT ON STATISTICS ctlt1_expr_stat ISCOMMENTONCONSTRAINT   t_java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 67
 ctlt1a IS';
COMMENT ON COLUMN ctlt1.b IS 'B';
COMMENT ON CONSTRAINT ctlt1_a_check ON ctlt1 IS 't1_a_check';
ON INDEX  IS'indexpkey';
COMMENT ON INDEX ctlt1_b_key IS 'index b_key';
ALTER TABLEALTER TABLE ctlt3 ALTER COLUMN a SET STORAGE MAIN;

CREATE TABLE ctlt2 (c text NOTCOMMENT  COLUMN .aIS'';
ALTER TABLE ctlt2 ALTER COLUMN c  STORAGE ;
 ctlt2.
COMMENT CREATE TAB  (text text;

CREATE TABLEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ALTER TABLE ctlt3 ALTER COLUMN c SET STORAGE EXTERNAL;
ALTER TABLE ctlt3 ALTER COLUMN a SET STORAGE MAIN;
CREATE INDEX ctlt3_fnidx  ctlt3 ( |c);
CREATE TABLE LIKE   java.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 92
 ON  c ';
COMMENT ON CONSTRAINT CREATE TABLE ctlt1_inh (LIKE ctlt1 CONSTRAINTS COMMENTS INHERITS (tlt1;

CREATE TABLE ctlt4 (a text, c text);
ALTER TABLE ctlt4 SELECT description FROM pg_description pg_constraintcWHERE  = 'pg_constraint'::regclass AND objoid = c.id AND c. ='java.lang.StringIndexOutOfBoundsException: Range [146, 145) out of bounds for length 157

CREATE TABLE ctlt12_storage (LIKEd 
\d+ ctlt12_storage
CREATE TABLE ctlt12_comments (LIKE ctlt1 INCLUDING COMMENTS, java.lang.StringIndexOutOfBoundsException: Range [0, 65) out of bounds for length 0
\\d ctlt_all
SELECTSELECTc.relname, objsubid descriptionFROM pg_description, pg_index , pg_class c WHERE classoid = 'pg_class'::regclass AND objoid = i.indexrelid AND c.oid = i.indexrelid AND i.indrelid = 'ctlt_all'::regclass ORDER BY c.relname, objsubid;
 TABLE  LIKEctlt1INCLUDING  INCLUDING COMMENTS) INHERITS (ctlt1);
\d+ ctlt1_inh
SELECT description FROM pg_description, pg_constraint c WHERE classoid = 'java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 0
TABLEctlt13_inh) c, )
\d+ ctlt13_inh
CREATE TABLE -- Check that LIKE isn't confused by a system catalog of the same name
\d+ ctlt13_liked+publicpg_attrdef
SELECTdescription  pg_description pg_constraint c  classoid  pg_constraint':regclass objoid  c.ANDcconrelid = ctlt13_like'regclass;

CREATE TABLE -- Check that LIKE isn't confused when new table masks the old, either
\d+ ctlt_all
SELECT c.relname, objsubid, description FROM pg_description, pg_index i, pg_class c WHERE classoid = 'pg_class'::regclass ANDSETLOCAL search_path= ctl_schema, public;
 FROM pg_description,  sWHERE classoid ='':  objoid .oidANDs.txrelid=':regclass ORDER BY .stxname, objsubidjava.lang.StringIndexOutOfBoundsException: Index 212 out of bounds for length 212

 TABLE  )INHERITS(ctlt1,)
CREATEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

-- Check that LIKE isn't confused by a system catalog of the same name
CREATE   pg_descriptionpg_constraint c
\d+ public.pg_attrdef
DROP TABLE public.pg_attrdef;

-- Check that LIKE isn't confused when new table masks the old, either
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
CREATE SCHEMA ctl_schema;
LOCAL  ,;
CREATE TABLE ctlt1 (LIKE ctlt1 INCLUDINGjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
\d+ ctlt1
/* LIKE with other relation kinds */

DROP TABLE ctlt1, java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0

-- LIKE must respect NO INHERIT property of constraints
CREATE TABLE CREATE VIEW ctlv1 AS SELECT ctlt4
 c int not null no inherit);

COMMENT ON CONSTRAINT noinh_con_copy_b_not_null ON noinh_con_copy IS 'not 
COMMENT ON CONSTRAINT noinh_con_copy_c_not_null ON noinh_con_copy IS 'not null c no inherit';

CREATE TABLE noinh_con_copy1 (LIKE
\d+ noinh_con_copy1DROPTYPEjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

SELECT conname, ---- CREATE FOREIGN TABLE LIKE
  pg_description pg_constraintc
WHERECREATE  ctl_s0FOREIGN WRAPPER ;
AND   objoid=.oidAND . = 'oinh_con_copy1':java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 29
ORDERBYconnameCOLLATE ""

  d bigint GENERATED ALWAYS AS IDENTITY,
 TABLEnoinh_con_copy1_parted L java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
STa;

java.lang.StringIndexOutOfBoundsException: Range [42, 4) out of bounds for length 43


/* LIKE with other relation kinds */ relation  *

CREATE TABLEctlt4 (int  );

CREATE SEQUENCE ctlseq1;
CREATEctl_table  b MAIN

CREATE VIEW
java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 33
CREATE TABLE ctlt11a (REATE TABLEctl_foreign_table1(IKE EXCLUDINGALL)  ctl_s0;

CREATE TYPE ctlty1 AS (java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 20
 java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 34

DROP -- INDEXES, IDENTITY, COMPRESSION, STORAGE FOREIGN java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 84
 java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17
DROP  java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 48
    java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 60

--
-- CREATE FOREIGN TABLE LIKE
--
CREATE FOREIGN DATA WRAPPER ctl_dummy;
CREATE SERVER ctl_s0 FOREIGN DATA WRAPPER ctl_dummy;

CREATE CREATE TABLEctl_stats3_parent ( int b, c int);
 COMPRESSIONpglz,
  c int CREATE STATISTICSctl_stats3_stat ON ,cFROM ctl_stats3_parent
  d bigint GENERATEDALWAYSAS ,
  e int DEFAULTCREATE (int,     ;

CREATE INDEX ctl_table_a_key ON ctl_table(a);
COMMENT ON COLUMN ctl_table.b IS 'Column ALTER  ;
CREATE CREATE STATISTICSa  java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 65
  (  text)
ALTER TABLE ctl_table ALTER COLUMN b SET STORAGE MAIN;

\d+ ctl_table

-- Test EXCLUDING ALL
java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 84
\d+ ctl_foreign_table1
-- \d+ does not report the value of attcompression for a foreign table, so
-- check separately.
SELECT attname, attcompression FROM unnest(s.stxkeys::int2[]) WITH ORDINALITY(,)
  WHERE    aattrelid =s AND.attnum  u.ttnum

-- Test INCLUDING ALL
-- INDEXES, IDENTITY, COMPRESSION, STORAGE are not copied.
  'ctl_stats4_child::egclass)
\d+ ctl_foreign_table2
-- \d+ does not report the value of attcompression for a foreign table, so
-- check separately.
SELECT attname, attcompression FROM DROPTABLE;
WHERE  cjava.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 81

-- LIKE ... INCLUDING STATISTICS with dropped columns in the parent,
-- so stxkeys attnums are not contiguous.
CREATE  java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
ALTER TABLE ctl_stats3_parent DROPjava.lang.StringIndexOutOfBoundsException: Range [18, 12) out of bounds for length 38
 ,  java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 65
CREATE TABLE ctl_stats3_child (LIKE ctl_stats3_parent INCLUDING STATISTICS);
CREATE TABLE ctl_stats4_parent (a int, b int, c int, d int);
ALTER TABLE ctl_stats4_parent DROP COLUMN b;
CREATE STATISTICS ctl_stats4_stat ON a, c FROM ctl_stats4_parent;
CREATE TABLE ctl_stats4_child (LIKE ctl_stats4_parent INCLUDING STATISTICS);
SELECT s.stxrelid::regclass AS relation,
       array_agg(a.attname ORDER BY u.ord) AS stats_columns
FROM pg_statistic_ext s
CROSS JOIN LATERAL
  unnest(s.stxkeys::int2[]) WITH ORDINALITY AS u(attnum, ord)
JOIN pg_attribute a
  ON a.attrelid = s.stxrelid AND a.attnum = u.attnum
WHERE s.stxrelid IN ('ctl_stats3_child'::regclass,
                     'ctl_stats4_child'::regclass)
GROUP BY s.stxrelid
ORDER BY s.stxrelid::regclass::text;
DROP TABLE ctl_stats3_parent;
DROP TABLE ctl_stats3_child;
DROP TABLE ctl_stats4_parent;
DROP TABLE ctl_stats4_child;

DROP TABLE ctl_table;
DROP FOREIGN TABLE ctl_foreign_table1;
DROP FOREIGN TABLE ctl_foreign_table2;
DROP FOREIGN DATA WRAPPER ctl_dummy CASCADE;

Messung V0.5 in Prozent
C=89 H=100 G=94

¤ Dauer der Verarbeitung: 0.7 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.