On 01.03.21 11:12, Michael Banck wrote:
postgres@kohn:~$ pg_dump --create-only -p 65432 -d test -h /tmp | egrep -v '^($|--|SET)' SELECT pg_catalog.set_config('search_path', '', false); CREATE DATABASE test WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'de_DE.UTF-8'; ALTER DATABASE test OWNER TO postgres; \connect test SELECT pg_catalog.set_config('search_path', '', false); GRANT CONNECT ON DATABASE test TO test;
I find this option name confusing, because evidently it prints out things that are not CREATE commands. For example, an intuitive idea of "create only" might be to omit GRANT commands.