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

upsert on table with NOT NULL columns is not supported #20

Open
cldellow opened this issue Nov 26, 2022 · 0 comments
Open

upsert on table with NOT NULL columns is not supported #20

cldellow opened this issue Nov 26, 2022 · 0 comments

Comments

@cldellow
Copy link

I found a case where /-/upserting a non-existing row behaves differently than /-/inserting a non-existing row.

This surprised me, but I might be misunderstanding the intended use.

If I have a table like:

create table test(key text primary key, value text);

I can do:

$ curl -XPOST https://example.com/-/upsert/db/test?pk=key -d '{"key": "abc", "value": "def"}'

{"table_count": 1}

But if the columns are non null, the upsert fails:

create table test(key text primary key, value text not null);
$ curl -XPOST https://example.com/-/upsert/db/test?pk=key -d '{"key": "abc", "value": "def"}'

{"table_count": 0}

(The /-/insert endpoint adds the row in both cases.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant