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

Insert with Generated Columns #3572

Closed
go4cas opened this issue Dec 19, 2019 · 6 comments
Closed

Insert with Generated Columns #3572

go4cas opened this issue Dec 19, 2019 · 6 comments
Labels
c/server Related to server k/bug Something isn't working s/wip Status: This issue is a work in progress

Comments

@go4cas
Copy link

go4cas commented Dec 19, 2019

Using generated columns, introduced with Postgresql 12, work fine when doing queries or mutations through GraphQL. When trying to insert a row, using the console Insert Row tab, tries to set the column value to NULL, which results in a "unexpected : cannot insert into column" error.

@paf31
Copy link
Contributor

paf31 commented Dec 19, 2019

This seems like it's probably caused by the same issue as in #2508.

@marionschleifer marionschleifer added c/server Related to server k/bug Something isn't working labels Dec 21, 2019
@tirumaraiselvan tirumaraiselvan changed the title [CONSOLE] - Insert with Generated Columns Insert with Generated Columns Jan 8, 2020
@0x777
Copy link
Member

0x777 commented Jan 9, 2020

@paf31 Will this be fixed with #3598?

@paf31
Copy link
Contributor

paf31 commented Jan 9, 2020

I expect so, yes. Edit : verified this works on my branch.

@nolandg
Copy link

nolandg commented Jan 10, 2020

I'm confused how @go4cas got this to work even over Graphql. I have a table with generated column but when I try to insert an object over Graphql API (and not pass anything for that generated column), I get a Postgres error. Looking at the error message, you can see that Hasura has taken the liberty of adding all columns to the attempted INSERT command, filling in defaults where I didn't pass values. This break the generated column of course.

When I use the Graphiql interface in the console however, it works fine, no errors and the generated column is returned as expected. Does Hasura make different INSERT commands if operating with a Hasura admin secrete or not?

How are you making this work? This is a show stopping bug for us right now. Any workaround suggestions would be appreciated.

@nolandg
Copy link

nolandg commented Jan 10, 2020

I made more investigation of this and made a new issue: #3681

@tirumaraiselvan
Copy link
Contributor

This is fixed in #3598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/server Related to server k/bug Something isn't working s/wip Status: This issue is a work in progress
Projects
None yet
Development

No branches or pull requests

6 participants