Skip to content

How to write Postgres INSERT with "DEFAULT" as one of the param? #356

Discussion options

You must be logged in to vote

You can't send DEFAULT as an arg, all you would need is psql.Raw

psql.Insert(
  im.Into("users", "name", "age", "id"),
  im.Values(psql.Arg("Mozart"), psql.Arg(20), psql.Raw("DEFAULT")),
)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by stephenafamo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants