[GENERAL] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-06 Thread Aleksey Tsalolikhin
We're replicating a PostgreSQL 8.4.x database using Slony1-1.2.x The origin database "data/base" directory is 197 GB in size. The slave database "data/base" directory is 562 GB in size and is over 75% filesystem utilization which has set off the "disk free" siren. My biggest table* measures

Re: [GENERAL] Single server multiple databases - extension

2012-03-06 Thread Brian Trudal
That solved the issue. Apart from hstore, I needed to drop ghstore as well. Thanks again From: Tom Lane To: Brian Trudal Cc: Bartosz Dmytrak ; "pgsql-general@postgresql.org" Sent: Tuesday, March 6, 2012 4:09 PM Subject: Re: [GENERAL] Single server multiple

Re: [GENERAL] corrupted table postgresql 8.3

2012-03-06 Thread Matteo Sgalaberni
- Original Message - > On 6.3.2012 21:24, Matteo Sgalaberni wrote: > > Hi people! > > > > I have a pg 8.3. Today I issued in a database that comand: > > Which minor version? The last one in this branch is 8.3.18 and if > you're > running an old one, there might be an important bugfix ...

Re: [GENERAL] replication between US <-> EU

2012-03-06 Thread Ondrej Ivanič
Hi, On 7 March 2012 10:36, John R Pierce wrote: > On 03/06/12 3:31 PM, Ondrej Ivanič wrote: >> >> - one side completely down: Client should use switch to other side >> transparently (Failover / High Availability) > > > what happens if the link between the sites is down and both sides decide > the

Re: [GENERAL] Single server multiple databases - extension

2012-03-06 Thread Tom Lane
Brian Trudal writes: > Thanks for getting back to me. Still no luck; and I tried all possibilities.. > For example, when I tried on new DB: > db1=# CREATE EXTENSION hstore >   SCHEMA public >   VERSION "1.0"; > ERROR:  type "hstore" already exists > db1=# create table foo(id hstore); > ERROR:  t

Re: [GENERAL] Single server multiple databases - extension

2012-03-06 Thread Brian Trudal
Thanks for getting back to me. Still no luck; and I tried all possibilities.. For example, when I tried on new DB: db1=# CREATE EXTENSION hstore    SCHEMA public   VERSION "1.0"; ERROR:  type "hstore" already exists db1=# create table foo(id hstore); ERROR:  type "hstore" is only a shel

Re: [GENERAL] replication between US <-> EU

2012-03-06 Thread John R Pierce
On 03/06/12 3:31 PM, Ondrej Ivanič wrote: - one side completely down: Client should use switch to other side transparently (Failover / High Availability) what happens if the link between the sites is down and both sides decide they are master? then how do you put the pieces back together ?

[GENERAL] replication between US <-> EU

2012-03-06 Thread Ondrej Ivanič
Hi, I would like to get some ideas about subject. I do not have any preferred solution (hot-standby, Slony or pgpoll) so anything which can deliver/satisfy the following will good: - one side completely down: Client should use switch to other side transparently (Failover / High Availability) - d

Re: [GENERAL] Complex transactions without using plPgSQL Functions. It is possible?

2012-03-06 Thread Chris Angelico
On Wed, Mar 7, 2012 at 9:25 AM, Tom Lane wrote: > In psql, see "\set AUTOCOMMIT off".  In other frontends, it would depend > on the client-side code whether or how you can do that. > > (We once made an attempt to provide this sort of behavioral option on > the server side; but it was a complete di

Re: [GENERAL] Unable to write inside TEMP environment variable path

2012-03-06 Thread hello_world
there's another reason for this message. I solve this problem by installing postgre in folder with name that have no spaces, such as C:\PostgreSQL -- View this message in context: http://postgresql.1045698.n5.nabble.com/Unable-to-write-inside-TEMP-environment-variable-path-tp3315027p5542027.html

Re: [GENERAL] Complex transactions without using plPgSQL Functions. It is possible?

2012-03-06 Thread Tom Lane
Chris Angelico writes: > As a side point: Is it possible to disable Postgres's default > autocommit behavior and have it automatically open a transaction on > connection and after commit/rollback? That's what I grew up on with > DB2 - you do some work, then you commit, then you do more work, then

Re: [GENERAL] Single server multiple databases - extension

2012-03-06 Thread Bartosz Dmytrak
Hi, there shouldn't be any problem in installing extensions to multiple databases in the same server. Extensions are per database: http://www.postgresql.org/docs/9.1/static/sql-createextension.html You can use pgAdmin, or try this syntax: CREATE EXTENSION hstore SCHEMA public VERSION "1.0";

Re: [GENERAL] corrupted table postgresql 8.3

2012-03-06 Thread Tomas Vondra
On 6.3.2012 21:24, Matteo Sgalaberni wrote: > Hi people! > > I have a pg 8.3. Today I issued in a database that comand: Which minor version? The last one in this branch is 8.3.18 and if you're running an old one, there might be an important bugfix ... > =# ALTER TABLE cliente ADD COLUMN pwd_expi

Re: [GENERAL] Complex transactions without using plPgSQL Functions. It is possible?

2012-03-06 Thread Chris Angelico
On Wed, Mar 7, 2012 at 6:30 AM, Andre Lopes wrote: > I'm writing a web application that uses PostgreSQL and I need to do > some operations where I read/write to 3 tables in the same > transaction. Is what you're looking for simply the "begin transaction"[1] and "commit"[2] commands? With those, y

[GENERAL] corrupted table postgresql 8.3

2012-03-06 Thread Matteo Sgalaberni
Hi people! I have a pg 8.3. Today I issued in a database that comand: =# ALTER TABLE cliente ADD COLUMN pwd_expired boolean DEFAULT FALSE; WARNING: unexpected attrdef record found for attr 22 of rel cliente WARNING: unexpected attrdef record found for attr 22 of rel cliente WARNING: unexpected

Re: [GENERAL] Single server multiple databases - extension

2012-03-06 Thread Brian Trudal
Any one know how to install extensions to multiple databases in the same server ? Thanks in advance Brian From: Brian Trudal To: "pgsql-general@postgresql.org" Sent: Monday, March 5, 2012 4:52 PM Subject: Single server multiple databases - extension Hi I

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Bosco Rama
Tom Lane wrote: > > Fascinating. So maybe there is something to Bosco's theory of something > holding open the old pidfile. There could also have been a corrupt in-memory/cached descriptor in the filesystem code that never needed flushing to disk? That would help explain why it fully went away

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 19:28, Tom Lane wrote: > Thom Brown writes: >> On 6 March 2012 18:20, Tom Lane wrote: >>> Still, I agree with your point: Thom should reboot and see if the >>> misbehavior is still there, because that would be useful info for his >>> bug report. > >> After a reboot, initdb comple

Re: [GENERAL] Complex transactions without using plPgSQL Functions. It is possible?

2012-03-06 Thread Adrian Klaver
On 03/06/2012 11:30 AM, Andre Lopes wrote: Hi, I'm writing a web application that uses PostgreSQL and I need to do some operations where I read/write to 3 tables in the same transaction. To do this I need to store the values of variables and I'm not sure if it is possible to do this without usin

[GENERAL] Complex transactions without using plPgSQL Functions. It is possible?

2012-03-06 Thread Andre Lopes
Hi, I'm writing a web application that uses PostgreSQL and I need to do some operations where I read/write to 3 tables in the same transaction. To do this I need to store the values of variables and I'm not sure if it is possible to do this without using plPgSQL. [code] SELECT count(email) INTO v

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Tom Lane
Thom Brown writes: > On 6 March 2012 18:20, Tom Lane wrote: >> Still, I agree with your point: Thom should reboot and see if the >> misbehavior is still there, because that would be useful info for his >> bug report. > After a reboot, initdb completes successfully. I don't think it > performed

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 18:51, dennis jenkins wrote: > On Tue, Mar 6, 2012 at 10:11 AM, Thom Brown wrote: >> On 6 March 2012 16:04, Adrian Klaver wrote: >>> The postmaster.pid is located outside the data directory, but points back >>> to the >>> data directory.   Not sure where Debian, though at a gues

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 18:20, Tom Lane wrote: > Bosco Rama writes: >> Thom Brown wrote: >>> I've done that a couple times, but no effect.  I think Tom's point >>> about a filesystem bug is probably right. > >> Have you rebooted since this started?  There may be a process that is >> holding the pid file

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread dennis jenkins
On Tue, Mar 6, 2012 at 10:11 AM, Thom Brown wrote: > On 6 March 2012 16:04, Adrian Klaver wrote: >> The postmaster.pid is located outside the data directory, but points back to >> the >> data directory.   Not sure where Debian, though at a guess somewhere in /var. >> Any way search for postmaste

Re: [GENERAL] Adding a lot of tables

2012-03-06 Thread Raymond O'Donnell
On 06/03/2012 16:58, jan.mus...@giub.unibe.ch wrote: > Dear All, > > When I am adding (just commands CREATE TABLE and CREATE TRIGER) a > bunch of tables (3000) to my db first everything goes fast but after > some minutes the new tables are added at the speed of a snail. Does > anybody know what co

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Tom Lane
Bosco Rama writes: > Thom Brown wrote: >> I've done that a couple times, but no effect. I think Tom's point >> about a filesystem bug is probably right. > Have you rebooted since this started? There may be a process that is > holding the pid file 'deleted but present' until the process terminat

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Bosco Rama
Sry, forgot to add list. Thom Brown wrote: > > I've done that a couple times, but no effect. I think Tom's point > about a filesystem bug is probably right. Have you rebooted since this started? There may be a process that is holding the pid file 'deleted but present' until the process termina

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Tom Lane
Thom Brown writes: > On 6 March 2012 18:01, Adrian Klaver wrote: >> A thought, what if you do rm -rf * in the data directory? > I've done that a couple times, but no effect. I think Tom's point > about a filesystem bug is probably right. Yeah, given your "touch" experiment I think that you hav

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Magnus Hagander
On Tue, Mar 6, 2012 at 19:03, Thom Brown wrote: > On 6 March 2012 18:01, Adrian Klaver wrote: >> On Tuesday, March 06, 2012 9:53:52 am Tom Lane wrote: >>> Thom Brown writes: >>> > /home/thom/Development/data was causing problems so: >>> > >>> > mv data databroken >>> > mkdir data >>> > initdb >>

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 18:01, Adrian Klaver wrote: > On Tuesday, March 06, 2012 9:53:52 am Tom Lane wrote: >> Thom Brown writes: >> > /home/thom/Development/data was causing problems so: >> > >> > mv data databroken >> > mkdir data >> > initdb >> > >> > ... working fine again.  I then used the postmaste

[GENERAL] pg_dump : no tables were found.

2012-03-06 Thread Piyush Lenka
Hi, I m trying to take backup of data of a particular table using pg_dump. I used double quotes for table name but output is : pg_dump : no tables were found. Command used : -h localhost -p 5432 -U postgres -W -F p -a -t '"TestTable"' -f DbBackup/BackupTableActions.sql TestDataBase This problem

Re: [GENERAL] what Linux to run

2012-03-06 Thread Gavin Flower
Hmm... I also use 64 bit Fedora 16, on an AMD quad core at home, and on a dual Xeon quad cores at work. For a desktop environment, I would recommend xfce for serious work over GNOME 3. However, GNOME 3 is fine if you prefer fashion over functionality. I have 25 virtual desktops, and make ful

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Adrian Klaver
On Tuesday, March 06, 2012 9:53:52 am Tom Lane wrote: > Thom Brown writes: > > /home/thom/Development/data was causing problems so: > > > > mv data databroken > > mkdir data > > initdb > > > > ... working fine again. I then used the postmaster.pid from this when > > started up. But if I do: >

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 17:53, Tom Lane wrote: > Thom Brown writes: >> /home/thom/Development/data was causing problems so: > >> mv data databroken >> mkdir data >> initdb > >> ... working fine again.  I then used the postmaster.pid from this when >> started up.  But if I do: > >> pg_ctl stop >> rm -rf d

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Adrian Klaver
On Tuesday, March 06, 2012 9:48:51 am Thom Brown wrote: > On 6 March 2012 17:45, Adrian Klaver wrote: > > On Tuesday, March 06, 2012 9:25:17 am Thom Brown wrote: > >> These are in my env output: > >> > >> PATH=/home/thom/Development/psql/bin/:/usr/lib/lightdm/lightdm:/usr/loca > >> l/s bin:/usr/l

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Tom Lane
Thom Brown writes: > /home/thom/Development/data was causing problems so: > mv data databroken > mkdir data > initdb > ... working fine again. I then used the postmaster.pid from this when > started up. But if I do: > pg_ctl stop > rm -rf data > mv databroken data > initdb > ... error messag

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 17:46, Tom Lane wrote: > Thom Brown writes: >> On 6 March 2012 16:31, Tom Lane wrote: >>> [ scratches head... ]  I can't reproduce it with current git tip. > >> And I don't think I can reproduce this if I remove that directory. >> I've seen this issue about 3 or 4 times in the pa

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 17:45, Adrian Klaver wrote: > On Tuesday, March 06, 2012 9:25:17 am Thom Brown wrote: > >> >> These are in my env output: >> >> PATH=/home/thom/Development/psql/bin/:/usr/lib/lightdm/lightdm:/usr/local/s >> bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games >> PGDATA=/home

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Adrian Klaver
On Tuesday, March 06, 2012 9:43:00 am Tom Lane wrote: > Adrian Klaver writes: > > The postmaster.pid is located outside the data directory, but points back > > to the data directory. Not sure where Debian, though at a guess > > somewhere in /var. Any way search for postmaster.pid. > > Really?

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Tom Lane
Thom Brown writes: > On 6 March 2012 16:31, Tom Lane wrote: >> [ scratches head... ]  I can't reproduce it with current git tip. > And I don't think I can reproduce this if I remove that directory. > I've seen this issue about 3 or 4 times in the past, and fixed it by > ditching the old data dir

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Adrian Klaver
On Tuesday, March 06, 2012 9:25:17 am Thom Brown wrote: > > These are in my env output: > > PATH=/home/thom/Development/psql/bin/:/usr/lib/lightdm/lightdm:/usr/local/s > bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games > PGDATA=/home/thom/Development/data/ > PGPORT=5488 > > This appe

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Tom Lane
Adrian Klaver writes: > The postmaster.pid is located outside the data directory, but points back to > the > data directory. Not sure where Debian, though at a guess somewhere in /var. > Any way search for postmaster.pid. Really? That seems like an extremely dangerous/stupid/unnecessary hac

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 17:16, Tom Lane wrote: > Thom Brown writes: >> Looking back through my terminal log, one thing might lend a clue from >> before I tried rebuliding it: > >> thom@swift:~/Development$ pg_ctl stop >> waiting for server to shut downcd .postgre.s >> . >> > > > >> .

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Adrian Klaver
On Tuesday, March 06, 2012 9:09:41 am Thom Brown wrote: > On 6 March 2012 17:00, Adrian Klaver wrote: > > On Tuesday, March 06, 2012 8:44:10 am Thom Brown wrote: > >> >> And if I start my development copy, this is the content of its > >> >> postmaster.pid: > >> >> > >> >> 27061 > >> >> /home/thom

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Tom Lane
Thom Brown writes: > Looking back through my terminal log, one thing might lend a clue from > before I tried rebuliding it: > thom@swift:~/Development$ pg_ctl stop > waiting for server to shut downcd .postgre.s > . > > ^C > thom@swift:~/Development$ pg_ctl stop > pg_ct

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 17:00, Adrian Klaver wrote: > On Tuesday, March 06, 2012 8:44:10 am Thom Brown wrote: > >> >> And if I start my development copy, this is the content of its >> >> postmaster.pid: >> >> >> >> 27061 >> >> /home/thom/Development/data >> >> 1331050950 >> >> 5488 >> >> /tmp >> >> localh

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Adrian Klaver
On Tuesday, March 06, 2012 8:44:10 am Thom Brown wrote: > >> And if I start my development copy, this is the content of its > >> postmaster.pid: > >> > >> 27061 > >> /home/thom/Development/data > >> 1331050950 > >> 5488 > >> /tmp > >> localhost > >> 5488001 191365126 > > > > So how are getting

[GENERAL] Adding a lot of tables

2012-03-06 Thread jan.musial
Dear All, When I am adding (just commands CREATE TABLE and CREATE TRIGER) a bunch of tables (3000) to my db first everything goes fast but after some minutes the new tables are added at the speed of a snail. Does anybody know what could be the reason? All the best, Jan Musial -- Sent via pgs

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 16:40, Adrian Klaver wrote: > On Tuesday, March 06, 2012 8:24:20 am Thom Brown wrote: >> >> >> No, only the ones running as the postgres user. > > In my original read, I missed the part you had the Ubuntu/Debian packaged > version running. > >> >> Here's the contents of the pid fil

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Adrian Klaver
On Tuesday, March 06, 2012 8:24:20 am Thom Brown wrote: > > > No, only the ones running as the postgres user. In my original read, I missed the part you had the Ubuntu/Debian packaged version running. > > Here's the contents of the pid file in /var/lib/postgresql/9.1/main/ > > 1199 > /var/lib

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 16:31, Tom Lane wrote: > Thom Brown writes: >> On 6 March 2012 16:02, Tom Lane wrote: >>> Um ... I assume this is some patched version rather than pristine >>> sources?  It's pretty hard to explain why it's falling over like that. > >> No, I did a "git stash", "git clean -f" and

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Tom Lane
Thom Brown writes: > On 6 March 2012 16:02, Tom Lane wrote: >> Um ... I assume this is some patched version rather than pristine >> sources?  It's pretty hard to explain why it's falling over like that. > No, I did a "git stash", "git clean -f" and "git pull" before trying to build. [ scratches

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 16:18, Adrian Klaver wrote: > On Tuesday, March 06, 2012 8:11:20 am Thom Brown wrote: >> On 6 March 2012 16:04, Adrian Klaver wrote: >> > The postmaster.pid is located outside the data directory, but points back >> > to the data directory.   Not sure where Debian, though at a gues

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 16:11, Thom Brown wrote: > On 6 March 2012 16:04, Adrian Klaver wrote: >> The postmaster.pid is located outside the data directory, but points back to >> the >> data directory.   Not sure where Debian, though at a guess somewhere in /var. >> Any way search for postmaster.pid. > >

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Adrian Klaver
On Tuesday, March 06, 2012 8:11:20 am Thom Brown wrote: > On 6 March 2012 16:04, Adrian Klaver wrote: > > The postmaster.pid is located outside the data directory, but points back > > to the data directory. Not sure where Debian, though at a guess > > somewhere in /var. Any way search for postma

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 16:04, Adrian Klaver wrote: > The postmaster.pid is located outside the data directory, but points back to > the > data directory.   Not sure where Debian, though at a guess somewhere in /var. > Any way search for postmaster.pid. I'm not sure, because if I use a new data director

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
On 6 March 2012 16:02, Tom Lane wrote: > Thom Brown writes: >> thom@swift:~/Development$ initdb >> The files belonging to this database system will be owned by user "thom". >> This user must also own the server process. > >> The database cluster will be initialized with locale en_GB.UTF-8. >> The

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Adrian Klaver
On Tuesday, March 06, 2012 7:46:37 am Thom Brown wrote: > Hi all, > > After building Postgres and trying an initdb, I'm getting the following: > > > thom@swift:~/Development$ initdb > The files belonging to this database system will be owned by user "thom". > This user must also own the server p

Re: [GENERAL] Unhelpful initdb error message

2012-03-06 Thread Tom Lane
Thom Brown writes: > thom@swift:~/Development$ initdb > The files belonging to this database system will be owned by user "thom". > This user must also own the server process. > The database cluster will be initialized with locale en_GB.UTF-8. > The default database encoding has accordingly been

[GENERAL] Unhelpful initdb error message

2012-03-06 Thread Thom Brown
Hi all, After building Postgres and trying an initdb, I'm getting the following: thom@swift:~/Development$ initdb The files belonging to this database system will be owned by user "thom". This user must also own the server process. The database cluster will be initialized with locale en_GB.UTF-

Re: [GENERAL] [ADMIN] pg_dump : no tables were found.

2012-03-06 Thread Julien Rouhaud
On Tue, Mar 6, 2012 at 7:22 AM, Piyush Lenka wrote: > Hi, > > I m trying to take backup of data of a particular table using pg_dump. > I used double quotes for table name but output is : > pg_dump : no tables were found. > > Command used : > -h localhost -p 5432 -U postgres -W -F p -a -t '"TestTa

Re: [GENERAL] Lost data Folder, but have WAL files--- How to recover the database ?? Windows

2012-03-06 Thread Simon Riggs
On Tue, Mar 6, 2012 at 2:38 AM, chinnaobi wrote: > Recently i was doing streaming replication, I lost the data folder on both > the servers and left with WAL archives (some how). > > Can any one tell me how to recover database with WAL archives. > > Thanks in advance. There are no standard tools