Commit 2d4a05d7 authored by Tom Lane's avatar Tom Lane

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

now truncate or pad to the specified length.
parent 49528361
...@@ -45,14 +45,14 @@ SELECT CAST(name 'namefield' AS text) AS "text(name)"; ...@@ -45,14 +45,14 @@ SELECT CAST(name 'namefield' AS text) AS "text(name)";
namefield namefield
(1 row) (1 row)
SELECT CAST(f1 AS char) AS "char(text)" FROM TEXT_TBL; SELECT CAST(f1 AS char(10)) AS "char(text)" FROM TEXT_TBL;
char(text) char(text)
------------------- ------------
doh! doh!
hi de ho neighbor hi de ho n
(2 rows) (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) char(varchar)
--------------- ---------------
a a
...@@ -61,7 +61,7 @@ SELECT CAST(f1 AS char) AS "char(varchar)" FROM VARCHAR_TBL; ...@@ -61,7 +61,7 @@ SELECT CAST(f1 AS char) AS "char(varchar)" FROM VARCHAR_TBL;
abcd abcd
(4 rows) (4 rows)
SELECT CAST(name 'namefield' AS char) AS "char(name)"; SELECT CAST(name 'namefield' AS char(10)) AS "char(name)";
char(name) char(name)
------------ ------------
namefield namefield
...@@ -155,10 +155,10 @@ SELECT text 'text' || ' and unknown' AS "Concat text to unknown type"; ...@@ -155,10 +155,10 @@ SELECT text 'text' || ' and unknown' AS "Concat text to unknown type";
text and unknown text and unknown
(1 row) (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 Concat text to char
--------------------- ---------------------
text and char text and chara
(1 row) (1 row)
SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar"; SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";
......
...@@ -25,11 +25,11 @@ SELECT CAST(f1 AS text) AS "text(varchar)" FROM VARCHAR_TBL; ...@@ -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(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; SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL;
...@@ -65,7 +65,7 @@ SELECT 'unknown' || ' and unknown' AS "Concat unknown types"; ...@@ -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' || ' 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"; SELECT text 'text' || varchar ' and varchar' AS "Concat text to varchar";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment