You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a user defines enum type totally in UPPERCASE and references that enum as data type for specific column in table, the current behavior is that Hasura maps default to lowercase enum type which is resulting into an error suggesting that enum type does not exist. This error happens at query level.
What is the expected behaviour?
It should adhere to the case-sensitive practice based on the definition of enum type. So essentially it would map to exact enum type name as it was defined by user.
How to reproduce the issue?
I have an ENUM type defined with the enum type name in all caps (uppercase).
Now I am creating a table with one of its column having array of an enum type.
CREATETABLEperson (
id UUID PRIMARY KEY,
name TEXT,
moods "MOOD"[]
);
Some seeds
INSERT INTO person (id, name, moods) VALUES (gen_random_uuid(), 'Alice', ARRAY['happy', 'ok']::"MOOD"[]);
INSERT INTO person (id, name, moods) VALUES (gen_random_uuid(), 'Bob', ARRAY['sad', 'sad', 'ok']::"MOOD"[]);
Then when I execute mutation
mutationupdatePersonByPk {
update_person_by_pk(pk_columns:
{id: "669aa150-d3d9-4a2b-9663-6e24bc12faf2"}, # replace id with the id of record as this id was taken in my example_set: {moods: ["happy"]}) {
idmoodsname
}
}
It throws the error such as
{
"errors": [
{
"message": "type \"mood[]\" does not exist",
"extensions": {
"path": "$",
"code": "constraint-error"
}
}
]
}
Screenshots or Screencast
Any possible solutions/workarounds you're aware of?
The workaround is to define enum type name in lowercase which we can reference in any table definition for column data type utilizing enum.
Keywords
enum postgres uppercase
The text was updated successfully, but these errors were encountered:
meetzaveri
changed the title
server: issue with uppercase enum type names in postgres
server: issue with uppercase enum type names in postgres (v2)
Jul 3, 2024
Version Information
Server Version: 2.40
Environment
Cloud/OSS/EE
What is the current behaviour?
If a user defines enum type totally in UPPERCASE and references that enum as data type for specific column in table, the current behavior is that Hasura maps default to lowercase enum type which is resulting into an error suggesting that enum type does not exist. This error happens at query level.
What is the expected behaviour?
It should adhere to the case-sensitive practice based on the definition of enum type. So essentially it would map to exact enum type name as it was defined by user.
How to reproduce the issue?
I have an ENUM type defined with the enum type name in all caps (uppercase).
Now I am creating a table with one of its column having array of an enum type.
enum DDL
table DDL
Some seeds
Then when I execute mutation
It throws the error such as
Screenshots or Screencast
Any possible solutions/workarounds you're aware of?
The workaround is to define enum type name in lowercase which we can reference in any table definition for column data type utilizing enum.
Keywords
enum postgres uppercase
The text was updated successfully, but these errors were encountered: