Package: postgresql-common
Version: 114
Severity: minor

Hi,

Script /usr/bin/pg_upgradecluster fails (silently drops data) on
databases which has datdba set as a role without login access.

I can narrow this bug to use of pg_user view in query:
"select datname, datallowconn, pg_catalog.pg_encoding_to_char(encoding),
usename from pg_database, pg_user where datdba = usesysid"
in line 375.

Not all roles/groups are shown in this view, I think that on postgresql
versions 8.1+ it's better to use query like this:
"select datname, datallowconn, pg_catalog.pg_encoding_to_char(encoding),
rolname from pg_database, pg_authid where datdba = pg_authid.oid"

Spotted on upgrade from 8.4 to 9.0 on debian/lenny (with backports) but
this database query is identical to official debian/stable (or sid)
package version.

Roles and privileges:
CREATE ROLE pol_admin;
ALTER ROLE pol_admin WITH NOSUPERUSER NOINHERIT NOCREATEROLE NOCREATEDB NOLOGIN;
GRANT pol_admin TO <some_login_user>;
ALTER DATABASE pol OWNER TO pol_admin;

Then pg_upgradecluster omit data (schema is created correctly) on "pol"
database.

Best regards,
Kupson




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to