From 2d4a05d7dfc475c65b838642e26da407561267bc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 17 Jan 2000 00:16:41 +0000 Subject: [PATCH] Update strings test to reflect the fact that casting to char() will now truncate or pad to the specified length. --- src/test/regress/expected/strings.out | 28 +++++++++++++-------------- src/test/regress/sql/strings.sql | 8 ++++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/test/regress/expected/strings.out b/src/test/regress/expected/strings.out index 36a0f12e95..c2687844c0 100644 --- a/src/test/regress/expected/strings.out +++ b/src/test/regress/expected/strings.out @@ -45,26 +45,26 @@ SELECT CAST(name 'namefield' AS text) AS "text(name)"; namefield (1 row) -SELECT CAST(f1 AS char) AS "char(text)" FROM TEXT_TBL; - char(text) -------------------- - doh! - hi de ho neighbor +SELECT CAST(f1 AS char(10)) AS "char(text)" FROM TEXT_TBL; + char(text) +------------ + doh! + hi de ho n (2 rows) -SELECT CAST(f1 AS char) AS "char(varchar)" FROM VARCHAR_TBL; +SELECT CAST(f1 AS char(10)) AS "char(varchar)" FROM VARCHAR_TBL; char(varchar) --------------- - a - ab - abcd - abcd + a + ab + abcd + abcd (4 rows) -SELECT CAST(name 'namefield' AS char) AS "char(name)"; +SELECT CAST(name 'namefield' AS char(10)) AS "char(name)"; char(name) ------------ - namefield + namefield (1 row) SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL; @@ -155,10 +155,10 @@ SELECT text 'text' || ' and unknown' AS "Concat text to unknown type"; text and unknown (1 row) -SELECT text 'text' || char ' and char' AS "Concat text to char"; +SELECT text 'text' || char(10) ' and characters' AS "Concat text to char"; Concat text to char --------------------- - text and char + text and chara (1 row) SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar"; diff --git a/src/test/regress/sql/strings.sql b/src/test/regress/sql/strings.sql index 7be0073a6f..2726744383 100644 --- a/src/test/regress/sql/strings.sql +++ b/src/test/regress/sql/strings.sql @@ -25,11 +25,11 @@ SELECT CAST(f1 AS text) AS "text(varchar)" FROM VARCHAR_TBL; SELECT CAST(name 'namefield' AS text) AS "text(name)"; -SELECT CAST(f1 AS char) AS "char(text)" FROM TEXT_TBL; +SELECT CAST(f1 AS char(10)) AS "char(text)" FROM TEXT_TBL; -SELECT CAST(f1 AS char) AS "char(varchar)" FROM VARCHAR_TBL; +SELECT CAST(f1 AS char(10)) AS "char(varchar)" FROM VARCHAR_TBL; -SELECT CAST(name 'namefield' AS char) AS "char(name)"; +SELECT CAST(name 'namefield' AS char(10)) AS "char(name)"; SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL; @@ -65,7 +65,7 @@ SELECT 'unknown' || ' and unknown' AS "Concat unknown types"; SELECT text 'text' || ' and unknown' AS "Concat text to unknown type"; -SELECT text 'text' || char ' and char' AS "Concat text to char"; +SELECT text 'text' || char(10) ' and characters' AS "Concat text to char"; SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar"; -- 2.40.0