In MS SQL Server, create my scripts to use customizable variables:
declare @somevariable int
select @somevariable = -1
insert into foo values ( @somevariable )
I'll then change the value of @somevariable at runtime, depending on the value that I want the particular situation. Since it's at the top of the script it's easy to see & remember.
How do I do the same with PostgreSQL?
Googling turned up PSQL variables, but it's implied that they can only be used within other slash commands, not in actual SQL.
EDIT: Found my own answers, and they're actually fairly complicated. Sort the posts older->newer to follow my discoveries.