Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Varchar Cannot be casted to Int4range with Distributed Tables #5033

Closed
halilozanakgul opened this issue Jun 9, 2021 · 0 comments · Fixed by #6391
Closed

Varchar Cannot be casted to Int4range with Distributed Tables #5033

halilozanakgul opened this issue Jun 9, 2021 · 0 comments · Fixed by #6391
Labels

Comments

@halilozanakgul
Copy link
Contributor

CREATE TABLE tbl(a INT);

SELECT ((1)::VARCHAR)::int4range FROM tbl;
┌───────────┐
│ int4range │
├───────────┤
└───────────┘
(0 rows)     

SELECT create_distributed_table('tbl', 'a');

SELECT ((1)::VARCHAR)::int4range FROM tbl;
ERROR:  cannot cast type cstring to int4range
CONTEXT:  while executing command on localhost:9701
naisila added a commit that referenced this issue May 4, 2023
… deparsing (#6391)

Adjusts query's CoerceViaIO & RelabelType nodes that are
improper for deparsing

The standard planner converts some `::text` casts to `::cstring` and
here we convert back because `cstring` is a pseudotype and it cannot be
casted to most types. This problem occurs in CoerceViaIO nodes.
There was another problem with RelabelType nodes fixed in the following
PR:
#4580
We undo the changes in that PR, and fix both CoerceViaIO and RelabelType
nodes in the planning phase (not in the deparsing phase in ruleutils)

Fixes #5646
Fixes #5033
Fixes #6061
emelsimsek pushed a commit that referenced this issue May 24, 2023
… deparsing (#6391)

Adjusts query's CoerceViaIO & RelabelType nodes that are
improper for deparsing

The standard planner converts some `::text` casts to `::cstring` and
here we convert back because `cstring` is a pseudotype and it cannot be
casted to most types. This problem occurs in CoerceViaIO nodes.
There was another problem with RelabelType nodes fixed in the following
PR:
#4580
We undo the changes in that PR, and fix both CoerceViaIO and RelabelType
nodes in the planning phase (not in the deparsing phase in ruleutils)

Fixes #5646
Fixes #5033
Fixes #6061
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant