Skip to content

Instantly share code, notes, and snippets.

@hanula
Created December 4, 2024 08:56
Show Gist options
  • Save hanula/872e74b7e17ca26b06cfcdc25e6b1a77 to your computer and use it in GitHub Desktop.
Save hanula/872e74b7e17ca26b06cfcdc25e6b1a77 to your computer and use it in GitHub Desktop.
INSERT INTO xxx
SELECT (
f
#= hstore('id', nextval(pg_get_serial_sequence('xxx', 'id'))::text)
#= hstore('somefield', 'value')
).* FROM xxx f WHERE id=XXX;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment