fix: insert with missing=default uses column default before using domain default
This commit is contained in:
committed by
Wolfgang Walther
parent
7b9027ea0a
commit
9fcbf994cb
@@ -579,6 +579,15 @@ spec actualPgVersion = do
|
||||
, matchHeaders = ["Preference-Applied" <:> "missing=default, return=representation"]
|
||||
}
|
||||
|
||||
it "inserts a COLUMN default before a DOMAIN default with missing=default" $
|
||||
request methodPost "/evil_friends_with_column_default?columns=id,name" [("Prefer", "return=representation"), ("Prefer", "missing=default")]
|
||||
[json| { "name": "Demon" } |]
|
||||
`shouldRespondWith`
|
||||
[json| [{"id": 420, "name": "Demon"}] |]
|
||||
{ matchStatus = 201
|
||||
, matchHeaders = ["Preference-Applied" <:> "missing=default, return=representation"]
|
||||
}
|
||||
|
||||
it "inserts json that has duplicate keys" $ do
|
||||
request methodPost "/tbl_w_json" [("Prefer", "return=representation")]
|
||||
[json| { "data": { "a": 1, "a": 2 }, "id": 3 } |]
|
||||
|
||||
Vendored
+5
@@ -3319,6 +3319,11 @@ create table evil_friends(
|
||||
, name text
|
||||
);
|
||||
|
||||
create table evil_friends_with_column_default(
|
||||
id devil_int default 420
|
||||
, name text
|
||||
);
|
||||
|
||||
create table bets (
|
||||
id int
|
||||
, data_json json
|
||||
|
||||
Reference in New Issue
Block a user