Re: [GENERAL] (replication) Detecting if server a slave, or a master in recovery

2011-09-12 Thread Toby Corkindale
On 12/09/11 16:54, Toby Corkindale wrote: Hi, What is the correct way to tell what mode a replicated Pg server is currently in, via a database connection? I can take a guess if it's the master or a slave by using the pg_current_xlog_location() and pg_last_xlog_replay_location() functions. Howev

Re: [GENERAL] (replication) Detecting if server a slave, or a master in recovery

2011-09-12 Thread Simon Riggs
On Mon, Sep 12, 2011 at 7:54 AM, Toby Corkindale wrote: > What is the correct way to tell what mode a replicated Pg server is > currently in, via a database connection? > > I can take a guess if it's the master or a slave by using the > pg_current_xlog_location() and pg_last_xlog_replay_location(

Re: [GENERAL] (replication) Detecting if server a slave, or a master in recovery

2011-09-12 Thread Toby Corkindale
On 12/09/11 17:13, Simon Riggs wrote: On Mon, Sep 12, 2011 at 7:54 AM, Toby Corkindale wrote: What is the correct way to tell what mode a replicated Pg server is currently in, via a database connection? I can take a guess if it's the master or a slave by using the pg_current_xlog_location()

Re: [GENERAL] (replication) Detecting if server a slave, or a master in recovery

2011-09-12 Thread Simon Riggs
On Mon, Sep 12, 2011 at 8:19 AM, Toby Corkindale wrote: > On 12/09/11 17:13, Simon Riggs wrote: >> >> On Mon, Sep 12, 2011 at 7:54 AM, Toby Corkindale >>> What is the best method for determining whether you're connected to the >>> master or slave database? >> >> SELECT pg_is_in_recovery(); > > > I

Re: [GENERAL] (replication) Detecting if server a slave, or a master in recovery

2011-09-12 Thread Toby Corkindale
On 12/09/11 17:27, Simon Riggs wrote: On Mon, Sep 12, 2011 at 8:19 AM, Toby Corkindale wrote: On 12/09/11 17:13, Simon Riggs wrote: On Mon, Sep 12, 2011 at 7:54 AM, Toby Corkindale What is the best method for determining whether you're connected to the master or slave database? SELECT pg_

Re: [GENERAL] writing block 6850 of relation 1663/17231/1259

2011-09-12 Thread Mudit Mishra
Thanks Bruce. If I upgrade the pg sql will it fix the problem - quite happy to do if it does. Else need way to recover the database. After some googling I found that 1259 represents PG_CLASS table. This drift me towards the conclusion that this table is in unstable state. I have run pg_reset

Re: [GENERAL] writing block 6850 of relation 1663/17231/1259

2011-09-12 Thread Grzegorz Jaśkiewicz
It probably won't fix it, but you'll avoid possible issues in the future. However you should look at possibly upgrading to 8.4 or later, as 8.0 is either out of its support life, or getting close to it. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

[GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Toby Corkindale
http://www.postgresql.org/docs/9.1/static/release-9-1.html contains the line: "Release Date: 2011-09-12" *bounces excitedly* Has the release candidate gone final today? -Toby -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.

Re: [GENERAL] (replication) Detecting if server a slave, or a master in recovery

2011-09-12 Thread Guillaume Lelarge
On Mon, 2011-09-12 at 17:09 +1000, Toby Corkindale wrote: > On 12/09/11 16:54, Toby Corkindale wrote: > > Hi, > > What is the correct way to tell what mode a replicated Pg server is > > currently in, via a database connection? > > > > I can take a guess if it's the master or a slave by using the >

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Magnus Hagander
On Mon, Sep 12, 2011 at 10:10, Toby Corkindale wrote: > http://www.postgresql.org/docs/9.1/static/release-9-1.html > contains the line: > "Release Date: 2011-09-12" > > *bounces excitedly* > > Has the release candidate gone final today? Not yet. But we are planning to put it out, and we need to l

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Magnus Hagander
On Mon, Sep 12, 2011 at 10:40, Gavin Flower wrote: > On 12/09/11 20:31, Magnus Hagander wrote: >> >> On Mon, Sep 12, 2011 at 10:10, Toby Corkindale >>  wrote: >>> >>> http://www.postgresql.org/docs/9.1/static/release-9-1.html >>> contains the line: >>> "Release Date: 2011-09-12" >>> >>> *bounces

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Magnus Hagander
On Mon, Sep 12, 2011 at 10:50, Gavin Flower wrote: > On 12/09/11 20:44, Magnus Hagander wrote: >> >> On Mon, Sep 12, 2011 at 10:40, Gavin Flower >>  wrote: >>> >>> On 12/09/11 20:31, Magnus Hagander wrote: On Mon, Sep 12, 2011 at 10:10, Toby Corkindale    wrote: > > http:/

[GENERAL] Pgpool outdated spec

2011-09-12 Thread Emanuel Araújo
Hi, I'm doing a rebuild to a rpm package postgresql-9.0 with pgpool but your spec is outdated, there is some spec updated or have to make my changes manually? -- * Emanuel Araújo* http://eacshm.wordpress.com/ * * *Linux Certified LPIC-1*

Re: [GENERAL] Pgpool outdated spec

2011-09-12 Thread Tatsuo Ishii
> I'm doing a rebuild to a rpm package postgresql-9.0 with pgpool but your > spec is outdated, there is some spec updated or have to make my changes > manually? Devrim is in charge of updating the spec file. Devrim? -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php

Re: [GENERAL] Pgpool outdated spec

2011-09-12 Thread Devrim GÜNDÜZ
On Mon, 2011-09-12 at 08:07 -0300, Emanuel Araújo wrote: > > I'm doing a rebuild to a rpm package postgresql-9.0 with pgpool but > your spec is outdated, there is some spec updated or have to make my > changes manually? Please hold on for 2-3 days. PgPool is the first RPM that I will need to upd

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Gavin Flower
On 12/09/11 20:44, Magnus Hagander wrote: On Mon, Sep 12, 2011 at 10:40, Gavin Flower wrote: On 12/09/11 20:31, Magnus Hagander wrote: On Mon, Sep 12, 2011 at 10:10, Toby Corkindale wrote: http://www.postgresql.org/docs/9.1/static/release-9-1.html contains the line: "Release Date: 2011-0

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Gavin Flower
On 12/09/11 20:31, Magnus Hagander wrote: On Mon, Sep 12, 2011 at 10:10, Toby Corkindale wrote: http://www.postgresql.org/docs/9.1/static/release-9-1.html contains the line: "Release Date: 2011-09-12" *bounces excitedly* Has the release candidate gone final today? Not yet. But we are planni

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Devrim GÜNDÜZ
On Mon, 2011-09-12 at 20:40 +1200, Gavin Flower wrote: > > Not yet. But we are planning to put it out, and we need to load the > > website documentation ahead of time. > > > Then how come was put on the download page over 24 hours ago? > > I already have it installed! PostgreSQL source code ship

[GENERAL] 8.4.4 locked after power failure

2011-09-12 Thread Grzegorz Jaśkiewicz
So here's the thing. I got a message from one of the developers, that running 'create temporary sequence xyz;' hangs on the database. That seemed suspicious. I tried running any ddl command, and that hang. No other connections to the database. It turned out that it had a power failure earlier in t

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Adrian Klaver
On Monday, September 12, 2011 1:50:24 am Gavin Flower wrote: > > So there is a probability (presumably very small) that the source may > change - if a significant problem is discoved late in the process, but > one that can be quickly fixed? It has been officially released per announcement on

[GENERAL] Index Corruption

2011-09-12 Thread Dylan Adams
We moved to PostgreSQL about 2 years ago and have been very happy with it overall. The only major issue that we've had is intermittent index corruption. This manifests itself as either "duplicate key value violates unique constraint" or "could not read block 37422 of relation 1663/18663/19063: read

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Gavin Flower
On 13/09/11 01:58, Devrim GÜNDÜZ wrote: On Mon, 2011-09-12 at 20:40 +1200, Gavin Flower wrote: Not yet. But we are planning to put it out, and we need to load the website documentation ahead of time. Then how come was put on the download page over 24 hours ago? I already have it installed! P

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Devrim GÜNDÜZ
On Tue, 2011-09-13 at 02:04 +1200, Gavin Flower wrote: > > > PostgreSQL source code ships with no warranty ;) > > You mean I don't get my money back if I don't like it??? :-) :) FWIW, 9.1.0 was just officially announced. Enjoy! -- Devrim GÜNDÜZ Principal Systems Engineer @ EnterpriseDB: http

Re: [GENERAL] 8.4.4 locked after power failure

2011-09-12 Thread Merlin Moncure
2011/9/12 Grzegorz Jaśkiewicz : > So here's the thing. I got a message from one of the developers, that > running 'create temporary sequence xyz;' hangs on the database. > That seemed suspicious. I tried running any ddl command, and that hang. > No other connections to the database. > > It turned o

Re: [GENERAL] Index Corruption

2011-09-12 Thread Tom Lane
Dylan Adams writes: > [ persistent occurrences of index corruption ] > My primary question: is this normal? No. It does sound like you're managing to tickle some bug or other. Can you extract a test case of any kind? We could fix it if we could see it happening, but there's not enough informat

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > You mean I don't get my money back if I don't like it??? :-) Are you kidding? You get *twice* your money back, and you get to keep the product! - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP

Re: [GENERAL] Index Corruption

2011-09-12 Thread pasman pasmański
Hi. Do you have triggers on corrupted tables? 2011/9/12, Dylan Adams : > We moved to PostgreSQL about 2 years ago and have been very happy with it > overall. The only major issue that we've had is intermittent index > corruption. > This manifests itself as either "duplicate key value violates uniq

[GENERAL] Problem with the 9.1 one-click installer Windows7 64bit

2011-09-12 Thread Thomas Kellerer
Hi, I tried to install 9.1 on a Windows7 64bit machine but the installation hangs during the initdb process. Looking at the taskmanager I could see that the installer script was waiting for icacls.exe to complete setting the approriate permissions on the data directory. As I know that proble

[GENERAL] Two 9.1 Questions

2011-09-12 Thread Andrew Hannon
Hello, Now that 9.1 has been released, I have two questions: 1. Can we upgrade a 9.0 hot standby (replicating from a 9.0 master) to a 9.1 standby while still replicating from the 9.0 master? Are there any version differences that would cause a problem? We would then eventually promote the 9.1

Re: [GENERAL] Two 9.1 Questions

2011-09-12 Thread Simon Riggs
On Mon, Sep 12, 2011 at 4:52 PM, Andrew Hannon wrote: > Hello, > > Now that 9.1 has been released, I have two questions: > > 1. Can we upgrade a 9.0 hot standby (replicating from a 9.0 master) to a 9.1 > standby while still replicating from the 9.0 master? Are there any version > differences tha

Re: [GENERAL] 8.4.4 locked after power failure

2011-09-12 Thread Grzegorz Jaśkiewicz
2011/9/12 Merlin Moncure : > > It seems odd that you could not create a temp sequence but you were > able to reindex the entire database.  did you confirm you were > blocking on a non-granted lock? I could revacuum/reindex all stuff, only if I had to do the system catalogues first. That seemed a

Re: [GENERAL] Index Corruption

2011-09-12 Thread Dylan Adams
On Mon, Sep 12, 2011 at 9:41 AM, Tom Lane wrote: > Dylan Adams writes: >> [ persistent occurrences of index corruption ] > >> My primary question: is this normal? > > No.  It does sound like you're managing to tickle some bug or other. > Can you extract a test case of any kind?  We could fix it i

Re: [GENERAL] Index Corruption

2011-09-12 Thread Dylan Adams
2011/9/12 pasman pasmański : > Hi. Do you have triggers on corrupted tables? I haven't checked all the occurences, but at least some of the tables that have had corrupted index have no triggers. dylan -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Index Corruption

2011-09-12 Thread Andy Colson
On 9/12/2011 1:10 PM, Dylan Adams wrote: On Mon, Sep 12, 2011 at 9:41 AM, Tom Lane wrote: Dylan Adams writes: [ persistent occurrences of index corruption ] My primary question: is this normal? No. It does sound like you're managing to tickle some bug or other. Can you extract a test ca

Re: [GENERAL] Problem with the 9.1 one-click installer Windows7 64bit

2011-09-12 Thread Merlin Moncure
On Mon, Sep 12, 2011 at 10:12 AM, Thomas Kellerer wrote: > Hi, > > I tried to install 9.1 on a Windows7 64bit machine but the installation > hangs during the initdb process. > > Looking at the taskmanager I could see that the installer script was waiting > for icacls.exe to complete setting the ap

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Aleksey Tsalolikhin
Congratulations on the release of 9.1.0! Lots of great features, I for one can't wait to try out unlogged tables, that should help a lot in our environment. Now that you have streaming replication both async and sync, are you working on multi-master replication? *excited* Or what's the roadmap?

Re: [GENERAL] Index Corruption

2011-09-12 Thread Dylan Adams
On Mon, Sep 12, 2011 at 1:20 PM, Andy Colson wrote: > On 9/12/2011 1:10 PM, Dylan Adams wrote: >> >> On Mon, Sep 12, 2011 at 9:41 AM, Tom Lane  wrote: >>> >>> Dylan Adams  writes: [ persistent occurrences of index corruption ] >>> My primary question: is this normal? >>> >>> No.  It

Re: [GENERAL] Index Corruption

2011-09-12 Thread Scott Marlowe
On Mon, Sep 12, 2011 at 8:03 AM, Dylan Adams wrote: > We moved to PostgreSQL about 2 years ago and have been very happy with it > overall. The only major issue that we've had is intermittent index corruption. > This manifests itself as either "duplicate key value violates unique > constraint" > o

[GENERAL] Unlogged table restart

2011-09-12 Thread Oliver Kohll
Hi, great to see unlogged tables. There was discussion in the lists a while ago about various options for what would happen on server restart. I understand after a crash they'll be truncated but what about after a clean restart? Are they guaranteed to retain all committed data? If so I'll defini

Re: [GENERAL] Unlogged table restart

2011-09-12 Thread Merlin Moncure
On Mon, Sep 12, 2011 at 3:56 PM, Oliver Kohll wrote: > Hi, great to see unlogged tables. There was discussion in the lists a while > ago about various options for what would happen on server restart. I > understand after a crash they'll be truncated but what about after a clean > restart? Are t

Re: [GENERAL] Index Corruption

2011-09-12 Thread Dylan Adams
On Mon, Sep 12, 2011 at 3:51 PM, Scott Marlowe wrote: > Are you sure you aren't having either server or RAID problems of some > kind?  Single bit memory errors or bad sectors not getting remapped > before corrupting data etc? Have you torture tested your hardware to > ensure it's rock solid stable

[GENERAL] Compatibility 9.1rc and 9.1.0

2011-09-12 Thread pasman pasmański
Hi. I have the cluster created under 9.1rc version. When i do upgrade to 9.1.0, i can only reinstall binaries or i should import data too? -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [GENERAL] Compatibility 9.1rc and 9.1.0

2011-09-12 Thread Tom Lane
=?ISO-8859-2?Q?pasman_pasma=F1ski?= writes: > I have the cluster created under 9.1rc version. When i do upgrade to > 9.1.0, i can only reinstall binaries or i should import data too? Should work to just update the binaries. regards, tom lane -- Sent via pgsql-general ma

[GENERAL] Foreign key check only if not null?

2011-09-12 Thread Phoenix Kiula
Hi, I bet this is a simple solution but I have been racking my brains. I have a column in my table: user_id varchar(100) ; This can be NULL, or it can have a value. If it has a value during INSERT or UPDATE, I want to check that the user exists against my "Users" table. Otherwise, NULL is

[GENERAL] 9.0, 9.1 RPM based parallel execution?

2011-09-12 Thread John R Pierce
so I have a centos6 machine running the 9.0.latest from the yum.postgresql.org repo... I'd like to bring up 9.1 on it in parallel, on a different port and directory.but I still want 9.0 to be the default install... I was looking at the PG wiki and didn't see this explained. does anyone

Re: [GENERAL] Foreign key check only if not null?

2011-09-12 Thread Eduardo Piombino
hi, fks do just that. you can create your fk with just one command: alter table xxx add constraint fk_name foreign key (user_id) references users (id); parent table's id field should also be of the same type and also it should be primary key or at least unique. you can create your pk with (if you

Re: [GENERAL] Foreign key check only if not null?

2011-09-12 Thread Richard Broersma
On Mon, Sep 12, 2011 at 6:48 PM, Phoenix Kiula wrote: > I have a column in my table: >    user_id  varchar(100) ; > > This can be NULL, or it can have a value. If it has a value during > INSERT or UPDATE, I want to check that the user exists against my > "Users" table. Otherwise, NULL is ok. (Bec

[GENERAL] Re: Need help with what I think is likely a simple query - for each distinct val, return only one record with the most recent date.

2011-09-12 Thread Reid Thompson
On 9/12/2011 9:54 PM, Reid Thompson wrote: Ack -- i flubbed the subject and sample. The sample data should be val val2date 11 2011-01-01 22 2011-01-02 33 2011-01-03 41 2011-01-04 52 2011-01-05 53 2011-01-01 41 2011-01-02

[GENERAL] pg_dump

2011-09-12 Thread Rogel Nocedo
Hi! How can I please a directory folder where my backup files will be placed? I am calling pg_dump C:\Program Files (x86)\PostgreSQL\9.0\bin>pg_dump -i -h localhost -p 5433 -U postgres -f add.sql --column-inserts -t address my_db C:\Program Files (x86)\PostgreSQL\9.0\bin>pg_dump -i -h

[GENERAL] Re: Need help with what I think is likely a simple query - for each distinct val, return only one record with the most recent date.

2011-09-12 Thread Reid Thompson
Ack -- i flubbed the subject and sample. The sample data should be val val2date 11 2011-01-01 22 2011-01-02 33 2011-01-03 41 2011-01-04 52 2011-01-05 53 2011-01-01 41 2011-01-02 62 2011-01-03 43 2011-01

[GENERAL] Need help with what I think is likely a simple query - for each distinct val, return only the record with the most recent date.

2011-09-12 Thread Reid Thompson
Could someone point me in the right direction.. Thanks - reid Given the example data, how do I write a query that will give me the resultset: 12011-01-01 22011-01-06 32011-01-05 42011-01-09 52011-01-05 62011-01-08 I.E. for each distinct val, return the record with the mo

Re: [GENERAL] Compatibility 9.1rc and 9.1.0

2011-09-12 Thread pasman pasmański
Thank you. Have a nice day :) 2011/9/13, Tom Lane : > =?ISO-8859-2?Q?pasman_pasma=F1ski?= writes: >> I have the cluster created under 9.1rc version. When i do upgrade to >> 9.1.0, i can only reinstall binaries or i should import data too? > > Should work to just update the binaries. > >

Re: [GENERAL] writing block 6850 of relation 1663/17231/1259

2011-09-12 Thread Craig Ringer
On 11/09/2011 10:37 PM, Mudit Mishra wrote: Can anyone help me to fix this issue? I keep getting following errors in the log. I do not have a backup of the database and want to recover the database as much as possible from this error. 2011-09-09 11:06:39 PANIC: xlog flush request 2/190490D8 i

Re: [GENERAL] 9.0, 9.1 RPM based parallel execution?

2011-09-12 Thread Devrim GÜNDÜZ
Hi, On Mon, 2011-09-12 at 18:58 -0700, John R Pierce wrote: > so I have a centos6 machine running the 9.0.latest from the > yum.postgresql.org repo... > > I'd like to bring up 9.1 on it in parallel, on a different port and > directory.but I still want 9.0 to be the default install... I wa

Re: [GENERAL] Need help with what I think is likely a simple query - for each distinct val, return only the record with the most recent date.

2011-09-12 Thread Toby Corkindale
On 13/09/11 10:54, Reid Thompson wrote: Could someone point me in the right direction.. Thanks - reid Given the example data, how do I write a query that will give me the resultset: [snip] > I.E. for each distinct val, return the record with the most recent date. Isn't it something simple like