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

PostgreSQL SQL compatibility: VARCHAR(N) #19864

Closed
emarsden opened this issue Dec 19, 2024 · 2 comments
Closed

PostgreSQL SQL compatibility: VARCHAR(N) #19864

emarsden opened this issue Dec 19, 2024 · 2 comments
Labels
type/bug Something isn't working
Milestone

Comments

@emarsden
Copy link

Describe the bug

SELECT 'foo'::varchar(20) triggers a parse error.

Error message/log

ERROR:  Failed to run the query

Caused by:
  sql parser error: expected end of statement, found: (
LINE 1: SELECT 'foo'::varchar(20);
                              ^

To Reproduce

SELECT 'foo'::varchar(20);

Expected behavior

No response

How did you deploy RisingWave?

Via the dockerhub image.

The version of RisingWave

PostgreSQL 13.14.0-RisingWave-2.1.0 (d6e98ac)

Additional context

No response

@emarsden emarsden added the type/bug Something isn't working label Dec 19, 2024
@github-actions github-actions bot added this to the release-2.2 milestone Dec 19, 2024
@lmatz
Copy link
Contributor

lmatz commented Dec 20, 2024

Thanks @emarsden,

in RW, the underlying implementation does not differentiate varchar(x), varchar(y), and varchar types.

So we chose to ban the varchar() ones to avoid users' confusion.

@emarsden
Copy link
Author

OK, thanks. I see that this is documented at https://docs.risingwave.com/sql/data-types/overview. It would be useful for users to document the limitations in PostgreSQL compatibility more explicitly (I see for example that the obj_description() function from PostgreSQL does not return correct results for a "COMMENT ON TABLE ...").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants