-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
a/dataa/data/postgresc/serverRelated to serverRelated to serverk/bugSomething isn't workingSomething isn't working
Milestone
Description
Tested on 2.0.0-alpha.8 and 2.0.0-alpha.9.
If I create a table with nothing but a single char type:
create table if not exists public.test_bug (
single_char char not null
);And expose it via Hasura:
- table:
schema: public
name: test_bug
insert_permissions:
- role: user
permission:
columns:
- single_char
check: {}
select_permissions:
- role: user
permission:
columns:
- single_char
filter: {}Trying to insert into that table with the below query fails with the below error message:
mutation MyMutation {
insert_test_bug_one(object: {single_char: "x"}) {
single_char
}
}{
"errors": [
{
"extensions": {
"path": "$.selectionSet.insert_test_bug_one.args.object",
"code": "data-exception"
},
"message": "value too long for type character(1)"
}
]
}If I then alter the column to have type text:
alter table test_bug alter COLUMN single_char type text;Running the same query gives the following response:
{
"data": {
"insert_test_bug_one": {
"single_char": "'x'"
}
}
}Note the extraneous single quotes around the character, which is what prevents it from being inserted into the char type.
Metadata
Metadata
Assignees
Labels
a/dataa/data/postgresc/serverRelated to serverRelated to serverk/bugSomething isn't workingSomething isn't working