From cb8d9a1f8ac19215e2d31e2d254931f3b1a07236 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 26 May 2021 16:49:03 -0700 Subject: [PATCH] create-db: Default dbuser and dbname to zulip. Signed-off-by: Anders Kaseorg --- scripts/setup/create-db.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/setup/create-db.sql b/scripts/setup/create-db.sql index 33ccfaf60f..96ff54e0ac 100644 --- a/scripts/setup/create-db.sql +++ b/scripts/setup/create-db.sql @@ -1,3 +1,8 @@ +\set dbuser :dbuser +SELECT CASE WHEN :'dbuser' = ':dbuser' THEN 'zulip' ELSE :'dbuser' END AS dbuser \gset +\set dbname :dbname +SELECT CASE WHEN :'dbname' = ':dbname' THEN 'zulip' ELSE :'dbname' END AS dbname \gset + \connect postgres DROP DATABASE IF EXISTS :"dbname"; SELECT format($$BEGIN