Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
2d4a05d7
Commit
2d4a05d7
authored
Jan 17, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update strings test to reflect the fact that casting to char() will
now truncate or pad to the specified length.
parent
49528361
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
src/test/regress/expected/strings.out
src/test/regress/expected/strings.out
+14
-14
src/test/regress/sql/strings.sql
src/test/regress/sql/strings.sql
+4
-4
No files found.
src/test/regress/expected/strings.out
View file @
2d4a05d7
...
@@ -45,26 +45,26 @@ SELECT CAST(name 'namefield' AS text) AS "text(name)";
...
@@ -45,26 +45,26 @@ 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 n
eighbor
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
ab
ab
abcd
abcd
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
(1 row)
(1 row)
SELECT CAST(f1 AS varchar) AS "varchar(text)" FROM TEXT_TBL;
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";
...
@@ -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 char
a
(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";
...
...
src/test/regress/sql/strings.sql
View file @
2d4a05d7
...
@@ -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"
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment