Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 22nd, 2005, 08:47 AM
Dave Smith
Guest
 
Posts: n/a
Default A strange Vacuum error ...

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




  #2  
Old November 22nd, 2005, 08:47 AM
W. van den Akker
Guest
 
Posts: n/a
Default PQtrace doesn't work

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 majordomo@postgresql.org)

  #3  
Old November 22nd, 2005, 08:47 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: A strange Vacuum error ...

Dave Smith <dave.smith@candata.com> writes:[color=blue]
> 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[/color]
[color=blue]
> How do I fix this?[/color]

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 majordomo@postgresql.org

  #4  
Old November 22nd, 2005, 08:47 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: PQtrace doesn't work

"W. van den Akker" <listsrv@wilsoft.nl> writes:[color=blue]
> 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.[/color]

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 majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.