From: Peter <pmc@citylink.dinoex.sub.org>
To: pgsql-general@postgresql.org
Subject: Locked out of schema public
Date: Wed, 6 Nov 2019 20:11:53 +0100
Message-ID: <20191106191153.GA12072@gate.oper.dinoex.org> (raw)
This is FreeBSD 11.3, with postgres installed from ports as 10.10.
There is included a daily utility doing pg_dump:
: ${daily_pgsql_pgdump_args:="-U ${daily_pgsql_user} -p ${daily_pgsql_port} -bF c"}
pg_dump ${daily_pgsql_pgdump_args} -f ${file} ${db}
Recently I did a restore of some database, as the postgres user, with:
pg_restore -c -d <db> -h <host> <file>
and now ordinary users are locked out of the database:
PG::UndefinedTable: ERROR: relation "users" does not exist
=> \d users
Did not find any relation named "users".
=> \d
Did not find any relations.
=> \d public.users
Table "public.users"
[etc.etc. all is present]
=> show search_path;
search_path
-----------------
"$user", public
(1 row)
=> select current_schemas(false);
current_schemas
-----------------
{}
(1 row)
eh???? HOPPALA!!!
=> select * from public.users;
ERROR: permission denied for schema public
How can this happen? I don't think I twiddled anything with schemas,
in fact I never used them in any way.
cheers,
PMc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: pmc@citylink.dinoex.sub.org
Subject: Re: Locked out of schema public
In-Reply-To: <20191106191153.GA12072@gate.oper.dinoex.org>
References: <20191106191153.GA12072@gate.oper.dinoex.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox