Custom type handling - #186
Conversation
dmfay
left a comment
There was a problem hiding this comment.
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 typeenumrangedrop typealter typerename,rename attributesdrop,add,alterattributescreate tablewith 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