Skip to content

Instantly share code, notes, and snippets.

@bcho
Created October 27, 2014 14:47
Show Gist options
  • Select an option

  • Save bcho/c0a0d3f0b56fe068f9f5 to your computer and use it in GitHub Desktop.

Select an option

Save bcho/c0a0d3f0b56fe068f9f5 to your computer and use it in GitHub Desktop.
trick
/* string concat update in postgresql */
/* check before submit changes: */
SELECT 'prefix' || col
FROM tb
WHERE id in (1, 2, 3);
/* concat update */
UPDATE tb
SET col = 'prefix' || col
WHERE id in (1, 2, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment