Unix Technical Forum

Re: pg_dumpall problem - duplicated users

This is a discussion on Re: pg_dumpall problem - duplicated users within the pgsql Admins forums, part of the PostgreSQL category; --> Tom Lane napisał(a): > Bartosz Nowak <grubby@go2.pl> writes: > > >> postgres=> select ctid,xmin,xmax,cmin,xmax,* from pg_shadow where >> usename ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 05:12 AM
GRUbY
 
Posts: n/a
Default Re: pg_dumpall problem - duplicated users

Tom Lane napisał(a):

> Bartosz Nowak <grubby@go2.pl> writes:
>
>
>> postgres=> select ctid,xmin,xmax,cmin,xmax,* from pg_shadow where
>> usename = 'postgres';
>> ctid | xmin | xmax | cmin | xmax | usename | usesysid |
>> usecreatedb | usesuper | usecatupd |
>> passwd | valuntil | useconfig
>> --------+------------+-------+-------+-------+----------+----------+-------------+----------+-----------+-------------------------------------+----------+-----------
>>

>
>
>
>
>> (0,1) | 1 | 50469 | 50469 | 50469 | postgres | 1 |
>> t | t | t
>> | | |
>> (1,25) | 2559800612 | 0 | 0 | 0 | postgres | 1 |
>> t | t | t |
>> md5c084502ed11efa9d3d96d29717a5e555 | |
>> (2 rows)
>>

>
>
> Hmm --- clearly, that second xmin is corrupt. I'd venture that this
> is the result of a rolled-back (crashed?) ALTER USER SET PASSWORD
> operation, in which somehow the new tuple's xmin got clobbered ... and
> more than likely, its XMIN_COMMITTED bit got set at the same time.
>
> You could manually delete either row, probably better to zap the second
> one:
> delete from pg_shadow where ctid = '(1,25)';
> and then things should be OK. A dump and reload wouldn't be a bad idea
> though, since there may be other corruption elsewhere that you haven't
> noticed yet.
>
> regards, tom lane
>
>

Heh... i wish it was that easy - i tried it already :] When i delete the
'second' postgres user (with passwd set) PG is acting like there is no
postgres account at all:

pg_dumpall -i -U mw > test.sql
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: pg_class_aclcheck: invalid
user id 1
pg_dump: The command was: SELECT (SELECT usename FROM pg_user WHERE
usesysid = datdba) as dba, pg_encoding_to_char(encoding) as encoding,
datpath FROM pg_database WHERE datname = 'alibi'
pg_dumpall: pg_dump failed on database "alibi", exiting

pg_dumpall -i -U postgres > test.sql
pg_dumpall: could not connect to database "template1": FATAL: user
"postgres" does not exist

psql -U postgres
psql: FATAL: user "postgres" does not exist

And i cannot modify row of 'first' postgres user (without passwd set)
with or without 'second' present:

mw=> delete from pg_shadow where ctid = '(0,1)' ;
DELETE 0

mw=> update pg_catalog.pg_shadow set passwd='test' where
usename='postgres' and ctid = '(0,1)';
UPDATE 0

So further help will be welcomed And thank U for trying to help me.

Greetings,
Bartek

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:40 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com