-
Notifications
You must be signed in to change notification settings - Fork 59
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
Custom type handling #186
Custom type handling #186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have many statement with a set ( KEY = VALUE) section. The keys are often specific, but as of now we allow everything. They could be technically treated as keywords, but we have to add a lot of different variants. Or we keep it as it is and the parser will be more permissive.
(I think I asked this question before, but I don't remember the outcome of the discussion...)
a lot of these get really dialect-specific so imo it's fine to be permissive with them
I have change from Also, on my testing postgres instance this does not work: ALTER TYPE color RENAME VALUE 'purple' TO 'mauve'; It is taken directly from the docs and it complaints about the keyword value. Am I missing something very obvious here? |
is the color type still an enum or did you recreate it as a composite while testing things?
re literal_string I think some dialects treat single/double quotes interchangeably but don't recall which offhand |
I just had a super old postgres version. I have updated to 15.3 and now it works. |
This PR adds handling of custom types in Postgres:
create type
enum
range
drop type
alter type
rename
,rename attributes
drop
,add
,alter
attributescreate table
with a column as a custom typeRemarks:
We have many statement with a
set ( KEY = VALUE)
section. The keys are often specific, but as of now we allow everything. They could be technically treated as keywords, but we have to add a lot of different variants. Or we keep it as it is and the parser will be more permissive.(I think I asked this question before, but I don't remember the outcome of the discussion...)
References:
https://www.postgresql.org/docs/current/sql-createtype.html
https://www.postgresql.org/docs/current/sql-altertype.html
https://www.postgresql.org/docs/current/sql-droptype.html
Closes #184