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
372e598c
Commit
372e598c
authored
Nov 09, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Arrange for CASE or UNION with only untyped literal constants as input
to resolve the unknown constants as type TEXT.
parent
9bbca2c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
src/backend/parser/parse_coerce.c
src/backend/parser/parse_coerce.c
+17
-1
No files found.
src/backend/parser/parse_coerce.c
View file @
372e598c
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.4
7 2000/10/05 19:11:33
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.4
8 2000/11/09 04:14:32
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -374,6 +374,22 @@ select_common_type(List *typeids, const char *context)
}
}
}
/*
* If all the inputs were UNKNOWN type --- ie, unknown-type literals ---
* then resolve as type TEXT. This situation comes up with constructs
* like
* SELECT (CASE WHEN foo THEN 'bar' ELSE 'baz' END);
* SELECT 'foo' UNION SELECT 'bar';
* It might seem desirable to leave the construct's output type as
* UNKNOWN, but that really doesn't work, because we'd probably end up
* needing a runtime coercion from UNKNOWN to something else, and we
* usually won't have it. We need to coerce the unknown literals while
* they are still literals, so a decision has to be made now.
*/
if
(
ptype
==
UNKNOWNOID
)
ptype
=
TEXTOID
;
return
ptype
;
}
...
...
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