Re: pg_dumpall -g problem
От | Tom Lane |
---|---|
Тема | Re: pg_dumpall -g problem |
Дата | |
Msg-id | 22049.1051713014@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | pg_dumpall -g problem (David Goodenough <david.goodenough@btconnect.com>) |
Список | pgsql-general |
David Goodenough <david.goodenough@btconnect.com> writes: > I have a Postgresql 7.2.2 installation, and I am having a problem with > the results of doing a pg_dumpall -g. > It dumps out three users, ignoring the fourth. Looking at the source code for 7.2's pg_dumpall, it's trying to dump everything except the postgres user --- on the assumption that you'll recreate the postgres user at initdb time. The code is $PSQL -d template1 -At -c "\ SELECT 'CREATE USER \"' || usename || '\" WITH SYSID ' || usesysid || CASE WHEN passwd IS NOT NULL THEN ' PASSWORD ''' || passwd || '''' else '' end || CASE WHEN usecreatedb THEN ' CREATEDB'::text ELSE ' NOCREATEDB' END || CASE WHEN usesuper THEN ' CREATEUSER'::text ELSE ' NOCREATEUSER' END || CASE WHEN valuntil IS NOT NULL THEN ' VALID UNTIL '''::text || CAST(valuntil AS TIMESTAMP) || '''' ELSE '' END || ';' FROM pg_shadow WHERE usesysid <> (SELECT datdba FROM pg_database WHERE datname = 'template0');" I'd guess that your missing user is the one who owns template0. Now that should be the postgres user, unless you've been hacking on pg_database ... regards, tom lane
В списке pgsql-general по дате отправления: