473,383 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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

Nov 22 '05 #1
3 1540
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dmitry Tkach | last post by:
Hi, everybody! I am getting a weird failure, trying to vacuum a table in 7.3 - it says "ERROR: Index pg_toast_89407_index is not a btree". Does it ring a bell to anyone? Any ideas what's wrong?...
10
by: Stephen | last post by:
Hello, Is it normal for plain VACUUM on large table to degrade performance by over 9 times? My database becomes unusable when VACUUM runs. From reading newsgroups, I thought VACUUM should only...
3
by: Lynn.Tilby | last post by:
The following program produces the output below... It is built with: vrfy_prob: vrfy_prob.cpg /usr/local/pgsql/bin/ecpg -I/usr/local/pgsql/include -o vrfy_prob.c vrfy_prob.cpg gcc -g${DEBUG}...
5
by: Carmen Gloria Sepulveda Dedes | last post by:
Hello! Can I execute VACUUM ANALYZE from ecpg? How I do that??? /* I do: EXEC SQL VACUUM ANALYZE <table>; But I get error: 'ERROR: VACUUM cannot run inside a transaction block'
8
by: Sean Shanny | last post by:
To all, The facts: PostgreSQL 7.4.0 running on BSD 5.1 on Dell 2650 with 4GB RAM, 5 SCSI drives in hardware RAID 0 configuration. Database size with indexes is currently 122GB. DB size...
8
by: Dave Smith | last post by:
I am running 7.2 and when doing a vacuum I am getting the following error.... ERROR: Cannot insert a duplicate key into unique index pg_statistic_relid_att_index Where do I start to fix...
2
by: Shelby Cain | last post by:
I'm putting 8.0 through its paces and here are a few things I've noticed on the native win32 port running on my workstation (2.0g p4 w/256 megs of ram). Here is the output of "vacuum verbose...
4
by: Ilia Chipitsine | last post by:
Dear Sirs I'm about to write plpgsql function which will "vacuum full" all existing databases. Below is an example how to get list of databases. What should I write instead of "raise notice" ?...
10
by: Henk Ernst Blok | last post by:
Hi Posgres users/developers, Can anyone explain why PosgreSQL (version 7.4.5 on Linux) does a full table scan to compute a count(*) on a base table after a vacuum analyze has been done with no...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.