Update strings test to reflect the fact that casting to char() will

now truncate or pad to the specified length.
This commit is contained in:
Tom Lane 2000-01-17 00:16:41 +00:00
parent 49528361f5
commit 2d4a05d7df
2 changed files with 18 additions and 18 deletions

View File

@ -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";

View File

@ -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";