diff options
Diffstat (limited to 'src/test/regress/sql')
| -rw-r--r-- | src/test/regress/sql/alter_table.sql | 12 | ||||
| -rw-r--r-- | src/test/regress/sql/arrays.sql | 2 | ||||
| -rw-r--r-- | src/test/regress/sql/btree_index.sql | 12 | ||||
| -rw-r--r-- | src/test/regress/sql/create_index.sql | 10 | ||||
| -rw-r--r-- | src/test/regress/sql/create_misc.sql | 44 | ||||
| -rw-r--r-- | src/test/regress/sql/create_table.sql | 36 | ||||
| -rw-r--r-- | src/test/regress/sql/destroy.sql | 12 | ||||
| -rw-r--r-- | src/test/regress/sql/hash_index.sql | 26 | ||||
| -rw-r--r-- | src/test/regress/sql/name.sql | 54 | ||||
| -rw-r--r-- | src/test/regress/sql/oidname.sql | 6 | ||||
| -rw-r--r-- | src/test/regress/sql/tests | 5 |
11 files changed, 84 insertions, 135 deletions
diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql index 9764459922f..5765560ea70 100644 --- a/src/test/regress/sql/alter_table.sql +++ b/src/test/regress/sql/alter_table.sql @@ -5,7 +5,7 @@ CREATE TABLE temp (initial int4); ALTER TABLE temp ADD COLUMN a int4; -ALTER TABLE temp ADD COLUMN b name; +ALTER TABLE temp ADD COLUMN b char16; ALTER TABLE temp ADD COLUMN c text; @@ -56,12 +56,12 @@ ALTER TABLE temp ADD COLUMN z int2[]; INSERT INTO temp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u, v, w, x, y, z) - VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)', + VALUES (4, 'char16', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)', 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}', 314159, '(1,1)', 512, '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)', '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["current" "infinity"]', - '1/3', '1,name', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); + '1/3', '1,char16', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); SELECT * FROM temp; @@ -74,7 +74,7 @@ CREATE TABLE temp ( ALTER TABLE temp ADD COLUMN a int4; -ALTER TABLE temp ADD COLUMN b name; +ALTER TABLE temp ADD COLUMN b char16; ALTER TABLE temp ADD COLUMN c text; @@ -125,12 +125,12 @@ ALTER TABLE temp ADD COLUMN z int2[]; INSERT INTO temp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u, v, w, x, y, z) - VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)', + VALUES (4, 'char16', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)', 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}', 314159, '(1,1)', 512, '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)', '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["current" "infinity"]', - '1/3', '1,name', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); + '1/3', '1,char16', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); SELECT * FROM temp; diff --git a/src/test/regress/sql/arrays.sql b/src/test/regress/sql/arrays.sql index a82a185c922..117b27cf8a6 100644 --- a/src/test/regress/sql/arrays.sql +++ b/src/test/regress/sql/arrays.sql @@ -26,7 +26,7 @@ SELECT array_dims(arrtest.b) AS x; SELECT * FROM arrtest WHERE arrtest.a[1] < 5 and - arrtest.c = '{"foobar"}'::_name; + arrtest.c = '{"foobar"}'::_char16; -- updating array subranges seems to be broken -- diff --git a/src/test/regress/sql/btree_index.sql b/src/test/regress/sql/btree_index.sql index 71dcddd0ee2..88e4dd7f455 100644 --- a/src/test/regress/sql/btree_index.sql +++ b/src/test/regress/sql/btree_index.sql @@ -16,16 +16,16 @@ SELECT b.* WHERE b.seqno = 4500; SELECT b.* - FROM bt_name_heap b - WHERE b.seqno < '1'::name; + FROM bt_c16_heap b + WHERE b.seqno < '1'::char16; SELECT b.* - FROM bt_name_heap b - WHERE b.seqno >= '9999'::name; + FROM bt_c16_heap b + WHERE b.seqno >= '9999'::char16; SELECT b.* - FROM bt_name_heap b - WHERE b.seqno = '4500'::name; + FROM bt_c16_heap b + WHERE b.seqno = '4500'::char16; SELECT b.* FROM bt_txt_heap b diff --git a/src/test/regress/sql/create_index.sql b/src/test/regress/sql/create_index.sql index e9f93eb75b4..5ba465e7a7e 100644 --- a/src/test/regress/sql/create_index.sql +++ b/src/test/regress/sql/create_index.sql @@ -11,7 +11,7 @@ CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops); CREATE INDEX onek_hundred ON onek USING btree(hundred int4_ops); -CREATE INDEX onek_stringu1 ON onek USING btree(stringu1 name_ops); +CREATE INDEX onek_stringu1 ON onek USING btree(stringu1 char16_ops); CREATE INDEX tenk1_unique1 ON tenk1 USING btree(unique1 int4_ops); @@ -35,13 +35,13 @@ CREATE INDEX six ON shighway USING btree (name text_ops); -- BTREE ascending/descending cases -- -- we load int4/text from pure descending data (each key is a new --- low key) and name/f8 from pure ascending data (each key is a new +-- low key) and c16/f8 from pure ascending data (each key is a new -- high key). we had a bug where new low keys would sometimes be -- "lost". -- CREATE INDEX bt_i4_index ON bt_i4_heap USING btree (seqno int4_ops); -CREATE INDEX bt_name_index ON bt_name_heap USING btree (seqno name_ops); +CREATE INDEX bt_c16_index ON bt_c16_heap USING btree (seqno char16_ops); CREATE INDEX bt_txt_index ON bt_txt_heap USING btree (seqno text_ops); @@ -61,7 +61,7 @@ CREATE INDEX bt_f8_index ON bt_f8_heap USING btree (seqno float8_ops); -- EXTEND INDEX onek2_u2_prtl; --- CREATE INDEX onek2_stu1_prtl ON onek2 USING btree(stringu1 name_ops) +-- CREATE INDEX onek2_stu1_prtl ON onek2 USING btree(stringu1 char16_ops) -- where onek2.stringu1 >= 'J' and onek2.stringu1 < 'K'; -- @@ -80,7 +80,7 @@ CREATE INDEX rect2ind ON fast_emp4000 USING rtree (home_base bigbox_ops); -- CREATE INDEX hash_i4_index ON hash_i4_heap USING hash (random int4_ops); -CREATE INDEX hash_name_index ON hash_name_heap USING hash (random name_ops); +CREATE INDEX hash_c16_index ON hash_c16_heap USING hash (random char16_ops); CREATE INDEX hash_txt_index ON hash_txt_heap USING hash (random text_ops); diff --git a/src/test/regress/sql/create_misc.sql b/src/test/regress/sql/create_misc.sql index 495f94506f8..58ce26a2fc2 100644 --- a/src/test/regress/sql/create_misc.sql +++ b/src/test/regress/sql/create_misc.sql @@ -71,96 +71,96 @@ INSERT INTO b_star (class, b) VALUES ('b', 'bumble'::text); INSERT INTO b_star (class) VALUES ('b'); -INSERT INTO c_star (class, a, c) VALUES ('c', 5, 'hi mom'::name); +INSERT INTO c_star (class, a, c) VALUES ('c', 5, 'hi mom'::char16); INSERT INTO c_star (class, a) VALUES ('c', 6); -INSERT INTO c_star (class, c) VALUES ('c', 'hi paul'::name); +INSERT INTO c_star (class, c) VALUES ('c', 'hi paul'::char16); INSERT INTO c_star (class) VALUES ('c'); INSERT INTO d_star (class, a, b, c, d) - VALUES ('d', 7, 'grumble'::text, 'hi sunita'::name, '0.0'::float8); + VALUES ('d', 7, 'grumble'::text, 'hi sunita'::char16, '0.0'::float8); INSERT INTO d_star (class, a, b, c) - VALUES ('d', 8, 'stumble'::text, 'hi koko'::name); + VALUES ('d', 8, 'stumble'::text, 'hi koko'::char16); INSERT INTO d_star (class, a, b, d) VALUES ('d', 9, 'rumble'::text, '1.1'::float8); INSERT INTO d_star (class, a, c, d) - VALUES ('d', 10, 'hi kristin'::name, '10.01'::float8); + VALUES ('d', 10, 'hi kristin'::char16, '10.01'::float8); INSERT INTO d_star (class, b, c, d) - VALUES ('d', 'crumble'::text, 'hi boris'::name, '100.001'::float8); + VALUES ('d', 'crumble'::text, 'hi boris'::char16, '100.001'::float8); INSERT INTO d_star (class, a, b) VALUES ('d', 11, 'fumble'::text); INSERT INTO d_star (class, a, c) - VALUES ('d', 12, 'hi avi'::name); + VALUES ('d', 12, 'hi avi'::char16); INSERT INTO d_star (class, a, d) VALUES ('d', 13, '1000.0001'::float8); INSERT INTO d_star (class, b, c) - VALUES ('d', 'tumble'::text, 'hi andrew'::name); + VALUES ('d', 'tumble'::text, 'hi andrew'::char16); INSERT INTO d_star (class, b, d) VALUES ('d', 'humble'::text, '10000.00001'::float8); INSERT INTO d_star (class, c, d) - VALUES ('d', 'hi ginger'::name, '100000.000001'::float8); + VALUES ('d', 'hi ginger'::char16, '100000.000001'::float8); INSERT INTO d_star (class, a) VALUES ('d', 14); INSERT INTO d_star (class, b) VALUES ('d', 'jumble'::text); -INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::name); +INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::char16); INSERT INTO d_star (class, d) VALUES ('d', '1000000.0000001'::float8); INSERT INTO d_star (class) VALUES ('d'); INSERT INTO e_star (class, a, c, e) - VALUES ('e', 15, 'hi carol'::name, '-1'::int2); + VALUES ('e', 15, 'hi carol'::char16, '-1'::int2); INSERT INTO e_star (class, a, c) - VALUES ('e', 16, 'hi bob'::name); + VALUES ('e', 16, 'hi bob'::char16); INSERT INTO e_star (class, a, e) VALUES ('e', 17, '-2'::int2); INSERT INTO e_star (class, c, e) - VALUES ('e', 'hi michelle'::name, '-3'::int2); + VALUES ('e', 'hi michelle'::char16, '-3'::int2); INSERT INTO e_star (class, a) VALUES ('e', 18); INSERT INTO e_star (class, c) - VALUES ('e', 'hi elisa'::name); + VALUES ('e', 'hi elisa'::char16); INSERT INTO e_star (class, e) VALUES ('e', '-4'::int2); INSERT INTO f_star (class, a, c, e, f) - VALUES ('f', 19, 'hi claire'::name, '-5'::int2, '(1,3),(2,4)'::polygon); + VALUES ('f', 19, 'hi claire'::char16, '-5'::int2, '(1,3),(2,4)'::polygon); INSERT INTO f_star (class, a, c, e) - VALUES ('f', 20, 'hi mike'::name, '-6'::int2); + VALUES ('f', 20, 'hi mike'::char16, '-6'::int2); INSERT INTO f_star (class, a, c, f) - VALUES ('f', 21, 'hi marcel'::name, '(11,44),(22,55),(33,66)'::polygon); + VALUES ('f', 21, 'hi marcel'::char16, '(11,44),(22,55),(33,66)'::polygon); INSERT INTO f_star (class, a, e, f) VALUES ('f', 22, '-7'::int2, '(111,555),(222,666),(333,777),(444,888)'::polygon); INSERT INTO f_star (class, c, e, f) - VALUES ('f', 'hi keith'::name, '-8'::int2, + VALUES ('f', 'hi keith'::char16, '-8'::int2, '(1111,3333),(2222,4444)'::polygon); INSERT INTO f_star (class, a, c) - VALUES ('f', 24, 'hi marc'::name); + VALUES ('f', 24, 'hi marc'::char16); INSERT INTO f_star (class, a, e) VALUES ('f', 25, '-9'::int2); @@ -169,10 +169,10 @@ INSERT INTO f_star (class, a, f) VALUES ('f', 26, '(11111,33333),(22222,44444)'::polygon); INSERT INTO f_star (class, c, e) - VALUES ('f', 'hi allison'::name, '-10'::int2); + VALUES ('f', 'hi allison'::char16, '-10'::int2); INSERT INTO f_star (class, c, f) - VALUES ('f', 'hi jeff'::name, + VALUES ('f', 'hi jeff'::char16, '(111111,333333),(222222,444444)'::polygon); INSERT INTO f_star (class, e, f) @@ -180,7 +180,7 @@ INSERT INTO f_star (class, e, f) INSERT INTO f_star (class, a) VALUES ('f', 27); -INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::name); +INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::char16); INSERT INTO f_star (class, e) VALUES ('f', '-12'::int2); diff --git a/src/test/regress/sql/create_table.sql b/src/test/regress/sql/create_table.sql index 7bf244b2bc1..7d046fb67ac 100644 --- a/src/test/regress/sql/create_table.sql +++ b/src/test/regress/sql/create_table.sql @@ -30,9 +30,9 @@ CREATE TABLE onek ( tenthous int4, odd int4, even int4, - stringu1 name, - stringu2 name, - string4 name + stringu1 char16, + stringu2 char16, + string4 char16 ); CREATE TABLE tenk1 ( @@ -49,9 +49,9 @@ CREATE TABLE tenk1 ( tenthous int4, odd int4, even int4, - stringu1 name, - stringu2 name, - string4 name + stringu1 char16, + stringu2 char16, + string4 char16 ); CREATE TABLE tenk2 ( @@ -68,9 +68,9 @@ CREATE TABLE tenk2 ( tenthous int4, odd int4, even int4, - stringu1 name, - stringu2 name, - string4 name + stringu1 char16, + stringu2 char16, + string4 char16 ); @@ -83,7 +83,7 @@ CREATE TABLE person ( CREATE TABLE emp ( salary int4, - manager name + manager char16 ) INHERITS (person); @@ -98,13 +98,13 @@ CREATE TABLE stud_emp ( CREATE TABLE city ( - name name, + name char16, location box, budget city_budget ); CREATE TABLE dept ( - dname name, + dname char16, mgrname text ); @@ -153,7 +153,7 @@ CREATE TABLE b_star ( ) INHERITS (a_star); CREATE TABLE c_star ( - c name + c char16 ) INHERITS (a_star); CREATE TABLE d_star ( @@ -176,7 +176,7 @@ CREATE TABLE aggtest ( CREATE TABLE arrtest ( a int2[], b int4[][][], - c name[], + c char16[], d text[][], e float8[] ); @@ -186,9 +186,9 @@ CREATE TABLE hash_i4_heap ( random int4 ); -CREATE TABLE hash_name_heap ( +CREATE TABLE hash_c16_heap ( seqno int4, - random name + random char16 ); CREATE TABLE hash_txt_heap ( @@ -214,8 +214,8 @@ CREATE TABLE bt_i4_heap ( random int4 ); -CREATE TABLE bt_name_heap ( - seqno name, +CREATE TABLE bt_c16_heap ( + seqno char16, random int4 ); diff --git a/src/test/regress/sql/destroy.sql b/src/test/regress/sql/destroy.sql index 4d4f5561884..e33abba4198 100644 --- a/src/test/regress/sql/destroy.sql +++ b/src/test/regress/sql/destroy.sql @@ -1,7 +1,7 @@ -- -- destroy.source -- --- $Header: /cvsroot/pgsql/src/test/regress/sql/Attic/destroy.sql,v 1.4 1998/03/30 17:28:09 momjian Exp $ +-- $Header: /cvsroot/pgsql/src/test/regress/sql/Attic/destroy.sql,v 1.5 1998/04/07 18:14:27 momjian Exp $ -- -- @@ -38,7 +38,7 @@ DROP FUNCTION boxarea(box); DROP FUNCTION interpt_pp(path,path); -DROP FUNCTION reverse_name(name); +DROP FUNCTION reverse_c16(char16); -- @@ -125,7 +125,7 @@ DROP INDEX six; DROP INDEX hash_i4_index; -DROP INDEX hash_name_index; +DROP INDEX hash_c16_index; DROP INDEX hash_txt_index; @@ -135,7 +135,7 @@ DROP INDEX hash_f8_index; DROP INDEX bt_i4_index; -DROP INDEX bt_name_index; +DROP INDEX bt_c16_index; DROP INDEX bt_txt_index; @@ -213,7 +213,7 @@ DROP TABLE city; DROP TABLE hash_i4_heap; -DROP TABLE hash_name_heap; +DROP TABLE hash_c16_heap; DROP TABLE hash_txt_heap; @@ -223,7 +223,7 @@ DROP TABLE hash_f8_heap; DROP TABLE bt_i4_heap; -DROP TABLE bt_name_heap; +DROP TABLE bt_c16_heap; DROP TABLE bt_txt_heap; diff --git a/src/test/regress/sql/hash_index.sql b/src/test/regress/sql/hash_index.sql index e7e9059924e..7c0cc6b3308 100644 --- a/src/test/regress/sql/hash_index.sql +++ b/src/test/regress/sql/hash_index.sql @@ -16,15 +16,15 @@ SELECT hash_i4_heap.* -- hash index -- grep 1505703298 hash.data -- -SELECT hash_name_heap.* - WHERE hash_name_heap.random = '1505703298'::name; +SELECT hash_c16_heap.* + WHERE hash_c16_heap.random = '1505703298'::char16; -- -- hash index -- grep 7777777 hash.data -- -SELECT hash_name_heap.* - WHERE hash_name_heap.random = '7777777'::name; +SELECT hash_c16_heap.* + WHERE hash_c16_heap.random = '7777777'::char16; -- -- hash index @@ -87,24 +87,24 @@ SELECT h.seqno AS i20000 FROM hash_i4_heap h WHERE h.random = 1492795354; -UPDATE hash_name_heap - SET random = '0123456789abcdef'::name - WHERE hash_name_heap.seqno = 6543; +UPDATE hash_c16_heap + SET random = '0123456789abcdef'::char16 + WHERE hash_c16_heap.seqno = 6543; SELECT h.seqno AS i6543, h.random AS c0_to_f - FROM hash_name_heap h - WHERE h.random = '0123456789abcdef'::name; + FROM hash_c16_heap h + WHERE h.random = '0123456789abcdef'::char16; -UPDATE hash_name_heap +UPDATE hash_c16_heap SET seqno = 20000 - WHERE hash_name_heap.random = '76652222'::name; + WHERE hash_c16_heap.random = '76652222'::char16; -- -- this is the row we just replaced; index scan should return zero rows -- SELECT h.seqno AS emptyset - FROM hash_name_heap h - WHERE h.random = '76652222'::name; + FROM hash_c16_heap h + WHERE h.random = '76652222'::char16; UPDATE hash_txt_heap SET random = '0123456789abcdefghijklmnop'::text diff --git a/src/test/regress/sql/name.sql b/src/test/regress/sql/name.sql index 11235caaa3d..e69de29bb2d 100644 --- a/src/test/regress/sql/name.sql +++ b/src/test/regress/sql/name.sql @@ -1,54 +0,0 @@ ---**************** testing built-in type name ************** --- --- all inputs are silently truncated at NAMEDATALEN (32) characters --- - --- fixed-length by reference -SELECT 'name string'::name = 'name string'::name AS "True"; - -SELECT 'name string'::name = 'name string '::name AS "False"; - --- --- --- - -CREATE TABLE NAME_TBL(f1 name); - -INSERT INTO NAME_TBL(f1) VALUES ('ABCDEFGHIJKLMNOP'); - -INSERT INTO NAME_TBL(f1) VALUES ('abcdefghijklmnop'); - -INSERT INTO NAME_TBL(f1) VALUES ('asdfghjkl;'); - -INSERT INTO NAME_TBL(f1) VALUES ('343f%2a'); - -INSERT INTO NAME_TBL(f1) VALUES ('d34aaasdf'); - -INSERT INTO NAME_TBL(f1) VALUES (''); - -INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'); - - -SELECT '' AS seven, NAME_TBL.*; - -SELECT '' AS six, c.f1 FROM NAME_TBL c WHERE c.f1 <> 'ABCDEFGHIJKLMNOP'; - -SELECT '' AS one, c.f1 FROM NAME_TBL c WHERE c.f1 = 'ABCDEFGHIJKLMNOP'; - -SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 < 'ABCDEFGHIJKLMNOP'; - -SELECT '' AS four, c.f1 FROM NAME_TBL c WHERE c.f1 <= 'ABCDEFGHIJKLMNOP'; - -SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 > 'ABCDEFGHIJKLMNOP'; - -SELECT '' AS four, c.f1 FROM NAME_TBL c WHERE c.f1 >= 'ABCDEFGHIJKLMNOP'; - -SELECT '' AS seven, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*'; - -SELECT '' AS zero, c.f1 FROM NAME_TBL c WHERE c.f1 !~ '.*'; - -SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '[0-9]'; - -SELECT '' AS two, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*asdf.*'; - -DROP TABLE NAME_TBL; diff --git a/src/test/regress/sql/oidname.sql b/src/test/regress/sql/oidname.sql index d8d5522b65e..65fccc3c06f 100644 --- a/src/test/regress/sql/oidname.sql +++ b/src/test/regress/sql/oidname.sql @@ -10,11 +10,11 @@ INSERT INTO OIDNAME_TBL(f1) VALUES ('1235,efgh'); INSERT INTO OIDNAME_TBL(f1) VALUES ('987,XXXX'); --- no name component +-- no char16 component INSERT INTO OIDNAME_TBL(f1) VALUES ('123456'); --- name component too long -INSERT INTO OIDNAME_TBL(f1) VALUES ('123456,abcdefghijklmnopqrsutvwyz0123456789'); +-- char16 component too long +INSERT INTO OIDNAME_TBL(f1) VALUES ('123456,abcdefghijklmnopqrsutvwyz'); -- bad inputs INSERT INTO OIDNAME_TBL(f1) VALUES (''); diff --git a/src/test/regress/sql/tests b/src/test/regress/sql/tests index a7a061b9be5..79513431f17 100644 --- a/src/test/regress/sql/tests +++ b/src/test/regress/sql/tests @@ -1,6 +1,9 @@ boolean char -name +char2 +char4 +char8 +char16 varchar text strings |
