Re: Error seen when vacuuming pg_largeobject table

From: "Chris White (cjwhite)" <cjwhite(at)cisco(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Error seen when vacuuming pg_largeobject table
Date: 2004-01-27 01:54:38
Message-ID: 003501c3e478$87e4c0b0$24976b80@amer.cisco.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Here is the info. I am running 7.2.1.

bash-2.05b$ ./postgres -P -O -D /t/data/sql aesop

POSTGRES backend interactive interface
$Revision: 1.245.2.2 $ $Date: 2002/02/27 23:17:01 $

backend> reindex index pg_largeobject_loid_pn_index;
backend>

bash-2.05b$ ./psql -d aesop -U chris
Welcome to psql, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

aesop=# vacuum full;
NOTICE: Index pg_largeobject_loid_pn_index: NUMBER OF INDEX' TUPLES (0)
IS NOT THE SAME AS HEAP' (1390).
Recreate the index.
ERROR: Cannot insert a duplicate key into unique index
pg_largeobject_loid_pn_index
aesop=# \q

It is slightly different in that the number of tuples in the index is
(0) compared with (1044) before.

Tried again, this time I tried to reindex the pg_largeobject table
first. This caused even problems:

bash-2.05b$ ./postgres -D /t/data/sql -P -O aesop

POSTGRES backend interactive interface
$Revision: 1.245.2.2 $ $Date: 2002/02/27 23:17:01 $

backend> reindex table pg_largeobject;
backend> reindex index pg_largeobject_loid_pn_index;
backend>

bash-2.05b$ ./psql -d aesop -U voicemail
Welcome to psql, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

aesop=# vacuum full;
NOTICE: RelationBuildDesc: can't open pg_largeobject_loid_pn_index: No
such file or directory
ERROR: _mdfd_getrelnfd: cannot open relation
pg_largeobject_loid_pn_index: No such file or directory
aesop=# \q

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Monday, January 26, 2004 5:24 PM
To: cjwhite(at)cisco(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Error seen when vacuuming pg_largeobject table

"Chris White (cjwhite)" <cjwhite(at)cisco(dot)com> writes:
> VACUUM: DEBUG sql sql sql DEBUG: Index pg_largeobject_loid_pn_index:
> Pages 14; Tuples 1044: Deleted 232. ...
> VACUUM: WARNING sql sql sql ERROR: Cannot insert a duplicate key into
> unique index pg_largeobject_loid_pn_index

> When I run postgres with the -P and -O options to reindex the index,
> everything seem to run okay, I see no error messages. However, when I
> restart postmaster and try and do a vacuum again, I get the same error

> messages.

I don't think you can have reindexed the index. With only 1044 rows in
it, it shouldn't take up more than 3 or 4 pages when freshly created;
certainly not 14. Are you sure you reindexed in the right database?

If you're sure it's not pilot error, let's see the exact transcript of
what you did with the standalone postgres, and also the exact transcript
(no "sql sql sql") of the failing VACUUM afterwards. Also, what PG
version is this?

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Iain 2004-01-27 02:37:41 Re: Can I change the character encoding for a DB?
Previous Message Tom Lane 2004-01-27 01:23:39 Re: Error seen when vacuuming pg_largeobject table