ALTER DATABASE on a current db without explicit db name?
If you are executing the script in psql
you can use the substitution mechanism of psql
:
alter database :DBNAME SET ...
The documentation is here: http://www.postgresql.org/docs/current/interactive/app-psql.html#APP-PSQL-VARIABLES
If you're on 9.1 you can use:
DO $$
BEGIN
execute 'alter database '||current_database()||' set some_var = ''0''';
END
$$;