By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,634 Members | 1,898 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,634 IT Pros & Developers. It's quick & easy.

A strange Vacuum error ...

P: n/a
I am running 7.2.4 and when running a vacuum on my database I get

NOTICE: Child itemid in update-chain marked as unused - can't continue
repair_frag
ERROR: No one parent tuple was found
vacuumdb: vacuum import failed

How do I fix this?

--
Dave Smith
CANdata Systems Ltd
416-493-9020
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello,

I have a little test program (see at the end of the message). The program
crashes when PQTrace is called (instruction xxxx referenced memory at
"0x00000010", the
memory could not be written" (obvious ... )
I use the library libpqdll.lib and postgresql v7.3.4. When I comment the
line the program runs fine.

Any ideas?

gr,

Willem.
#include <stdio.h>
#include <stdlib.h>
#include <libpq-fe.h>
#include <winsock.h>

void main ()
{
int nFields;
int i, j;

PGconn *conn;
PGresult *res;

char *pghost = "linux";
char *dbName = "some_db";

FILE *debug;

WSADATA wsadata;
WSAStartup(0x0101, &wsadata);

conn = PQsetdbLogin (pghost, NULL, NULL, NULL, dbName, "user","");

if (PQstatus(conn) == CONNECTION_BAD)
{
printf ("Connection to database %s is failed\n", dbName);
printf ("%s", PQerrorMessage (conn));
PQfinish (conn);
exit (1);
}

debug = fopen ("trace.out", "w");
--->> PQtrace (conn, debug);

res = PQexec (conn, "BEGIN");
if (!res || PQresultStatus (res) != PGRES_COMMAND_OK)
{
printf ("BEGIN command failed\n");
PQclear (res);
PQfinish (conn);
exit (1);
}

PQclear (res);

res = PQexec (conn, "DECLARE mycursor CURSOR FOR select sum(id) from
relaties");
if (!res || PQresultStatus (res) != PGRES_COMMAND_OK)
{
printf ("DECLARE CURSOR command failed\n");
PQclear (res);
PQfinish (conn);
exit (1);
}

PQclear (res);
res = PQexec (conn, "FETCH ALL in mycursor");
if (!res || PQresultStatus (res) != PGRES_TUPLES_OK)
{
printf ("FETCH ALL command didn't return tuples properly\n");
PQclear (res);
PQfinish (conn);
exit (1);
}

nFields = PQnfields (res);
for (i = 0; i < nFields; i++)
printf ("%-15s", PQfname (res, i));

printf ("\n\n");

for (i = 0; i < PQntuples (res); i++)
{
for (j = 0; j < nFields; j++)
printf ("%-15s", PQgetvalue (res, i, j));
printf ("\n");
}

PQclear (res);

res = PQexec (conn, "CLOSE mycursor");
PQclear (res);

res = PQexec (conn, "COMMIT");
PQclear (res);

PQfinish (conn);

fclose (debug);

WSACleanup();
}

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 22 '05 #2

P: n/a
Dave Smith <da********@candata.com> writes:
I am running 7.2.4 and when running a vacuum on my database I get
NOTICE: Child itemid in update-chain marked as unused - can't continue
repair_frag
ERROR: No one parent tuple was found
vacuumdb: vacuum import failed How do I fix this?


I believe this error will go away once the problematic tuple is older
than the oldest running transaction. Find which client is sitting on a
longstanding open transaction and kill it ...

We later realized that this shouldn't be an error condition at all,
since it can happen in corner cases like the one you have. But the fix
was not back-patched as far as 7.2.*. If you can't move to 7.3 or 7.4
soon, you might consider trying to back-patch it yourself:

2002-08-13 16:14 tgl

* src/backend/commands/vacuum.c: Fix tuple-chain-moving tests to
handle marked-for-update tuples correctly (they are not part of a
chain). When failing to find a parent tuple in an update chain,
emit a warning and abandon repair_frag, but do not give an error as
before. This should eliminate the infamous 'No one parent tuple
was found' failure, which we now realize is not a can't-happen
condition but a perfectly valid database state. Per recent
pghackers discussion.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #3

P: n/a
"W. van den Akker" <li*****@wilsoft.nl> writes:
I have a little test program (see at the end of the message). The program
crashes when PQTrace is called (instruction xxxx referenced memory at
"0x00000010", the
memory could not be written" (obvious ... )
I use the library libpqdll.lib and postgresql v7.3.4. When I comment the
line the program runs fine.


Your test program works fine for me, after removal of the WSA-related
lines (I'm not using Windows). I suspect some Windows-specific issue,
but hard to say what.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.