Gregory S. Williamson | 1 Jul 2006 12:40

vacuum can't find clog

This is on a linux box, postgres 8.0.3 (yes, I know it's out of date but it was a test setup which seems to become
live and I have not had time to upgrade the thing) which runs a daily process to crunch some logs and do some
postGIS processing on them.

Tonight I got this message from my program:

Skipping the copy to disk
Done at Sat Jul  1 02:32:37 2006
Starting vacuum at Sat Jul  1 02:32:41 2006
Can't do the final vacuum and stats! ERROR:  could not access status of transaction 1081340514
SQL is <VACUUM ANALYZE;>

Running a vacuum verbose in the afflicted database got this complaint:
DETAIL:  0 dead row versions cannot be removed yet.
There were 19 unused item pointers.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO:  analyzing "pg_catalog.pg_operator"
INFO:  "pg_operator": scanned 14 of 14 pages, containing 651 live rows and 0 dead rows; 651 rows in sample,
651 estimated total rows
INFO:  vacuuming "public.weekly_log_data"
ERROR:  could not access status of transaction 1081340514
DETAIL:  could not open file "/data/postgres/psql8_test/pg_clog/0407": No such file or directory

Sure enough, there is no such beast:
[postgres <at> pogo cmnd_logs]$ ls -lt /data/postgres/psql8_test/pg_clog/
total 1716
-rw-------    1 postgres postgres   155648 Jul  1 02:36 0007
-rw-------    1 postgres postgres   262144 Jun 15 02:09 0006
-rw-------    1 postgres postgres   262144 Apr 12 05:27 0005
(Continue reading)

Tom Lane | 1 Jul 2006 16:28
Picon

Re: vacuum can't find clog

"Gregory S. Williamson" <gsw <at> globexplorer.com> writes:
> INFO:  vacuuming "public.weekly_log_data"
> ERROR:  could not access status of transaction 1081340514
> DETAIL:  could not open file "/data/postgres/psql8_test/pg_clog/0407": No such file or directory

This is a data-corruption problem, ie, something has stomped on the xmin
or xmax field of a tuple.  (It may or may not be relevant that the high
order half of that number looks like ASCII "s <at> " ...)  Since xmin/xmax
are the first fields looked at that can be checked with any specificity,
"could not access status of transaction" is a common symptom even when
most of a page has been trashed :-(

I don't recall whether we've fixed any bugs post-8.0.3 that might
explain this.  My experience is that if you inquire in any detail
you tend to find symptoms that look more like OS- or hardware-level
problems than anything that looks like it could have come from a
Postgres bug ... for instance, I recall finding a block of mail-message
text smack in the middle of a Postgres file in one case.

If you care to investigate exactly what happened, you could break out
pg_filedump and other implements of destruction and see if you can
determine exactly what's bogus in that table.  You could probably
also recover whatever data hasn't been overwritten, but the extent
of damage is impossible to guess at this point.

Otherwise, you might just consider this a wake-up call to update your
Postgres and kernel, and maybe run some memory and disk testing.

			regards, tom lane

(Continue reading)

Andy Shellam | 3 Jul 2006 09:05

Re: reinstalling postgres on windows

Hi Dragan,

On Windows 2000/XP/2003, run lusrmgr.msc (or right-click My Computer, Manage
- then Local Users and Groups) - find the postgres account and delete it (or
right-click and Set Password to change it.)

Regards,

Andy

> -----Original Message-----
> From: pgsql-admin-owner <at> postgresql.org [mailto:pgsql-admin-
> owner <at> postgresql.org] On Behalf Of Dragan Matic
> Sent: 30 June 2006 7:47 am
> To: pgsql-admin-owner <at> postgresql.org
> Subject: [ADMIN] reinstalling postgres on windows
> 
> During the installation process installer creates postgresql account
> name needed for windows service start. I didn't give it a password and
> installer has put some random password for the account. After that I
> uninstalled postgres, and now when I want to install it again, I can't
> use postgres account name for service installation since I don't know
> the password. Where can I delete this postgres account?
> 
> Thanks in advance,
> 
> Dragan Matic
> 
> ---------------------------(end of broadcast)--------------------------
> -
(Continue reading)

H.J. Sanders | 4 Jul 2006 13:21
Picon

FW: 2 instances

 

 
Hello.
 
I would like to run 2 instances of postgresql with 2 different data-directories: dir-a en dir-b.
 
Looking trough the archives I came to the next setup:
 
I created this 2 different directories and 2 users each with a different PGDATA(dir-a and dir-b) in their .profile
Using this 2 users i did twice initdb and createdb xyz with the first user.
 
in postgresql.conf of the second directory I changed  the port to 5433 and also entered this port in /etc/services and started the second
postmaster, ps -f shows it is running.
 
If I now want to create the same database xyz in the second directory using the second user,
the database is already there!
 
What am I missing?
 
Many thanks
 
Henk Sander
 
 
 

Andy Shellam | 4 Jul 2006 13:27

Re: FW: 2 instances

How are you connecting to Postgres?

 

Note that you’ll always need to give the port 5433 to connect to the second instance in any tool you use (psql, pg_dump, other management utilities etc), otherwise you’ll always connect to the “default” instance on 5432.

 

Andy

 

From: pgsql-admin-owner <at> postgresql.org [mailto:pgsql-admin-owner <at> postgresql.org] On Behalf Of H.J. Sanders
Sent: 04 July 2006 12:22 pm
To: pgsql-admin <at> postgresql.org
Subject: [ADMIN] FW: 2 instances

 

 


 

Hello.

 

I would like to run 2 instances of postgresql with 2 different data-directories: dir-a en dir-b.

 

Looking trough the archives I came to the next setup:

 

I created this 2 different directories and 2 users each with a different PGDATA(dir-a and dir-b) in their .profile

Using this 2 users i did twice initdb and createdb xyz with the first user.

 

in postgresql.conf of the second directory I changed  the port to 5433 and also entered this port in /etc/services and started the second

postmaster, ps -f shows it is running.

 

If I now want to create the same database xyz in the second directory using the second user,

the database is already there!

 

What am I missing?

 

Many thanks

 

Henk Sander

 

 

 

!DSPAM:14,44aa4fb8256841932014477!

Andy Shellam | 4 Jul 2006 15:27

Re: FW: 2 instances

The problem you’ve got is that there’ll always be 2 configurations – one for your “default” instance and one for your 5433 instance.

 

I believe (I could be wrong here), that postgresql.conf is just for the server side – it’s the client tools you’re connecting with, so they need to know which port to connect to (of which 5432 is default, unless changed in your configure script.)

 

You could put:

 

PGPORT=XXXX

export PGPORT

 

in each of your user’s .profile (or .bash_profile) scripts (replacing XXXX with either 5432 or 5433 dependent on which cluster you want the user to connect to.)  Then the PG client tools will read that as the port number (to save putting “-p 5433” in the command line.)

 

Regards

 

Andy

 

From: H.J. Sanders [mailto:hjs <at> rmax.nl]
Sent: 04 July 2006 1:54 pm
To: andy <at> andycc.net
Subject: RE: [ADMIN] FW: 2 instances

 

Hello Andy.

 

This does indeed the tric  ( -p 5433).

 

I expected that this port 5433 would be taken from $PGDATA/postgresql.conf

 

Is this also possible?

 

Many thanks

 

Henk

 

-----Oorspronkelijk bericht-----
Van: Andy Shellam [mailto:andy <at> andycc.net]
Verzonden: dinsdag 4 juli 2006 13:28
Aan: 'H.J. Sanders'
CC: pgsql-admin <at> postgresql.org
Onderwerp: RE: [ADMIN] FW: 2 instances

How are you connecting to Postgres?

 

Note that you’ll always need to give the port 5433 to connect to the second instance in any tool you use (psql, pg_dump, other management utilities etc), otherwise you’ll always connect to the “default” instance on 5432.

 

Andy

 

From: pgsql-admin-owner <at> postgresql.org [mailto:pgsql-admin-owner <at> postgresql.org] On Behalf Of H.J. Sanders
Sent: 04 July 2006 12:22 pm
To: pgsql-admin <at> postgresql.org
Subject: [ADMIN] FW: 2 instances

 

 


 

Hello.

 

I would like to run 2 instances of postgresql with 2 different data-directories: dir-a en dir-b.

 

Looking trough the archives I came to the next setup:

 

I created this 2 different directories and 2 users each with a different PGDATA(dir-a and dir-b) in their .profile

Using this 2 users i did twice initdb and createdb xyz with the first user.

 

in postgresql.conf of the second directory I changed  the port to 5433 and also entered this port in /etc/services and started the second

postmaster, ps -f shows it is running.

 

If I now want to create the same database xyz in the second directory using the second user,

the database is already there!

 

What am I missing?

 

Many thanks

 

Henk Sander

 

 

 

 

!DSPAM:14,44aa651c256842130418775!

Rodrigo De Leon | 4 Jul 2006 19:53
Picon

Wrap (obfuscate) code

Good afternoon.

I'm not sure if this is the correct list, so please forgive me if it's not.

I was wondering if there's a mechanism (or if not, a workaround) to
obfuscate server code (PL/PgSQL), a la Oracle's PL/SQL Wrap Utility:

http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/c_wrap.htm#LNPLS016

Thanks for your time.

Regards,

Rodrigo

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

Jonah H. Harris | 4 Jul 2006 20:41
Picon
Gravatar

Re: Wrap (obfuscate) code

On 7/4/06, Rodrigo De Leon <rdeleonp <at> gmail.com> wrote:
> I was wondering if there's a mechanism (or if not, a workaround) to
> obfuscate server code (PL/PgSQL), a la Oracle's PL/SQL Wrap Utility:

No, there is no such utility for PostgreSQL.  And, even if there were,
it wouldn't actually stop someone from reverse engineering it quite
easily as the source code to PL/pgSQL itself is readily available.

--

-- 
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation            | fax: 732.331.1301
33 Wood Ave S, 2nd Floor            | jharris <at> enterprisedb.com
Iselin, New Jersey 08830            | http://www.enterprisedb.com/

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Rodrigo De Leon | 4 Jul 2006 21:34
Picon

Re: Wrap (obfuscate) code

On 7/4/06, Jonah H. Harris <jonah.harris <at> gmail.com> wrote:
> No, there is no such utility for PostgreSQL.  And, even if there were,
> it wouldn't actually stop someone from reverse engineering it quite
> easily as the source code to PL/pgSQL itself is readily available.

I see. Thanks for the reply, both to you and Mr. Momjian.

Regards,

Rodrigo

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Tom O'Brien | 4 Jul 2006 21:47
Favicon

space not reclaimed after repeated full vacuums

Hi all:
I'm running Pgsql 7.4.6 on Red Hat Enterprise Linux 3.0 (UR4 and UR6).

My question/problem is around how much disk space PostgreSQL uses when tables are grown (by a restore) and then shrunk down again (delete + vacuum --full).

When I initialize my database and load my schema df tells me that 62MB of space is used in my DB data partition (with the database running).

I then restore a backup to the new server with pg_restore, I get a final data size of 49500 MB. This is all fine/expected.

I then want to reduce the space taken by the data down to say 10GB of data, so I wrote a simple minded script that does the following (on a test system):

While df returns more than 10GB of data in DB data partition
        DELETE 33% of rows from all non-static tables in the schema
        /usr/local/pgsql/bin/vacuumdb --analyze --all --full
End while.

I left this running over the weekend, and was surprised to find the script still running in it's 25th iteration this morning, with basically no rows left in any of the non-static tables.

The interesting thing was that the data partition still had almost 26GB of space used, no matter how much data was actually in the database.

I'm probably missing something rather fundimental here. Anything obvious jump out at anyone? Restarting the DB doesn't change anything.

Du output shows:
[root <at> customer3 root]# du -h /var/pgsql/entu
4.5M    /var/pgsql/entu/base/1
4.4M    /var/pgsql/entu/base/17141
4.0K    /var/pgsql/entu/base/17142/pgsql_tmp
26G     /var/pgsql/entu/base/17142
26G     /var/pgsql/entu/base
140K    /var/pgsql/entu/global
129M    /var/pgsql/entu/pg_xlog
20K     /var/pgsql/entu/pg_clog
26G     /var/pgsql/entu

Where /var/pgsql/entu is the root of our database data directory.

Thanks
Tom.


Gmane