Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 5FC549FB433 for ; Mon, 26 Mar 2007 10:58:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 11841-07 for ; Mon, 26 Mar 2007 10:58:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from actenon.computec.com.co (actenon.computec.com.co [200.74.143.146]) by postgresql.org (Postfix) with SMTP id 660679FB350 for ; Mon, 26 Mar 2007 10:58:27 -0300 (ADT) Received: from computecnew.redcorp.computec.com ([172.24.10.109]) by actenon.computec.com.co (SMSSMTP 4.1.11.41) with SMTP id M2007032608565409023 ; Mon, 26 Mar 2007 08:56:54 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C76FAE.C3F4C75C" Subject: Re: URGENT TABLE PG_SHADOW CORRUTEP Date: Mon, 26 Mar 2007 08:58:00 -0500 Message-ID: <873F3E256E0BF14EA84EAC54C2886B5D0B9836@computecnew.redcorp.computec.com> In-Reply-To: <4544e0330703251727xd988c1ue4de1494f79b8933@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ADMIN] URGENT TABLE PG_SHADOW CORRUTEP Thread-Index: AcdvPZR5bMgNd6xzQvuGOr+WgjXjpQAcOt/w From: "Daniel Ricardo Medina" To: "Peter Koczan" , "Tom Lane" Cc: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.651 tagged_above=0 required=5 tests=AWL, BAYES_50, HTML_50_60, HTML_MESSAGE, SUBJ_ALL_CAPS X-Spam-Level: X-Archive-Number: 200703/195 X-Sequence-Number: 25019 This is a multi-part message in MIME format. ------_=_NextPart_001_01C76FAE.C3F4C75C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ok thank, in single mode i try to erase two unique index on pg_shadow = but postgres show this messages =20 this index is used by system postgres... can=B4t erase it.... =20 =20 =20 Daniel Ricardo Medina Ing. de Desarrollo Computec S.A. Tel 260 71 11 Ext 1640 =20 ________________________________ De: Peter Koczan [mailto:pjkoczan@gmail.com]=20 Enviado el: Sunday, March 25, 2007 7:28 PM Para: Tom Lane CC: Daniel Ricardo Medina; pgsql-admin@postgresql.org Asunto: Re: [ADMIN] URGENT TABLE PG_SHADOW CORRUTEP I saw something along these lines recently when I was running stuff from = postgres 7.4.7 (we recently upgraded to 8.2.3). Basically, a unique = index somehow fails and allows duplicate rows...but I don't know why. Deleting doesn't work because postgres only looks for the record shown = by the index (though this may have been fixed in more recent releases). = At least this is the behaviour I observed. The way I fixed it was to drop the unique index, remove the offending = rows, reinsert only one of the offending rows (so things would once = again be unique), and remake the index. It worked.=20 There are two things that concern me: 1. Trying to do this on a system table is likely ill-advised at best, = and dangerous at worst. 2. If the table only has 3 rows in it and it got corrupted, there's = something really wrong. My table in question was a user table that had = almost a million rows.=20 On 3/25/07, Tom Lane wrote:=20 "Daniel Ricardo Medina" writes: > I have try to run this command in single user mod > > select * from pg_shadow; > delete from pg_shadow; > CREATE USER postgres WITH CREATEDB CREATEUSER PASSWORD '***' SYSID 1; > CREATE USER userradar PASSWORD '***' =09 > but the result is the same..... =09 What do you see if you look in pg_shadow right after doing the DELETE?=20 What PG version is this? =09 regards, tom lane =09 ---------------------------(end of = broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at=20 =09 http://www.postgresql.org/about/donate =09 ------_=_NextPart_001_01C76FAE.C3F4C75C Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
ok thank, in single mode  i try to erase = two unique=20 index on pg_shadow but postgres show this messages
 
this index is used by system postgres... = can=B4t erase=20 it....
 
 
 
Daniel Ricardo=20 Medina
Ing. de=20 Desarrollo
Computec=20 S.A.
Tel 260 71 11=20 Ext 1640
 


De: Peter Koczan = [mailto:pjkoczan@gmail.com]=20
Enviado el: Sunday, March 25, 2007 7:28 PM
Para: = Tom=20 Lane
CC: Daniel Ricardo Medina;=20 pgsql-admin@postgresql.org
Asunto: Re: [ADMIN] URGENT TABLE = PG_SHADOW=20 CORRUTEP

I saw something along these lines recently when I was running = stuff=20 from postgres 7.4.7 (we recently upgraded to 8.2.3). Basically, a unique = index=20 somehow fails and allows duplicate rows...but I don't know = why.

Deleting=20 doesn't work because postgres only looks for the record shown by the = index=20 (though this may have been fixed in more recent releases). At least this = is the=20 behaviour I observed.

The way I fixed it was to drop the unique = index,=20 remove the offending rows, reinsert only one of the offending rows (so = things=20 would once again be unique), and remake the index. It worked. =

There are=20 two things that concern me:
1. Trying to do this on a system table is = likely=20 ill-advised at best, and dangerous at worst.
2. If the table only has = 3 rows=20 in it and it got corrupted, there's something really wrong. My table in = question=20 was a user table that had almost a million rows.

On 3/25/07, Tom Lane=20 <tgl@sss.pgh.pa.us> = wrote:
"Daniel=20 Ricardo Medina" <dmedina@computec.com.co>=20 writes:
> I have try to run this command in single user=20 mod
>
> select * from pg_shadow;
> delete from=20 pg_shadow;
> CREATE USER postgres WITH CREATEDB CREATEUSER = PASSWORD=20 '***' SYSID 1;
> CREATE USER userradar PASSWORD = '***'

> but=20 the result is the same.....

What do you see if you look in = pg_shadow=20 right after doing the DELETE?
What PG version is=20 = this?

          =             &= nbsp; regards,=20 tom lane

---------------------------(end of=20 broadcast)---------------------------
TIP 7: You can help support = the=20 PostgreSQL project by donating at=20 =

           = ;     http://www.postgresql.org= /about/donate

------_=_NextPart_001_01C76FAE.C3F4C75C--