Re: [GENERAL] Replication

2010-11-02 Thread Jonathan Tripathy
On 02/11/10 01:56, Scott Marlowe wrote: On Mon, Nov 1, 2010 at 4:39 PM, Jonathan Tripathy wrote: On 01/11/10 21:10, Vick Khera wrote: On Mon, Nov 1, 2010 at 3:53 PM, Jonathan Tripathy wrote: The standby must support INSERTS and UPDATES as well (once the master has failed) Are there any so

Re: [GENERAL] Connection Pool

2010-11-02 Thread Craig Ringer
On 11/02/2010 01:42 AM, Jonathan Tripathy wrote: I would like my application to try and get a connection from the pool, and if there are none free, wait until either one is free or time is up. Rather than rolling your own connection pool, consider using one of the well-established existing on

Re: [GENERAL] JDBC Transactions

2010-11-02 Thread Radosław Smogura
On Mon, 01 Nov 2010 20:02:30 +, Jonathan Tripathy wrote: > On 01/11/10 19:56, Andy Colson wrote: >> On 11/1/2010 2:29 PM, Jonathan Tripathy wrote: >>> >>> On 01/11/10 19:12, Andy Colson wrote: On 11/1/2010 2:01 PM, Jonathan Tripathy wrote: > >>> I'll give you the exact case where

[GENERAL] index in desc order

2010-11-02 Thread AI Rumman
Is it possible to create an index in descending order?

Re: [GENERAL] index in desc order

2010-11-02 Thread Sergey Konoplev
On 2 November 2010 12:36, AI Rumman wrote: > Is it possible to create an index in descending order? > Yes it is - http://www.postgresql.org/docs/current/interactive/indexes-ordering.html -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JI

Re: [GENERAL] index in desc order

2010-11-02 Thread Szymon Guz
On 2 November 2010 10:36, AI Rumman wrote: > Is it possible to create an index in descending order? > yes... create index i on t(i desc); regards Szymon

[GENERAL] Dealing with locking on batch updates.

2010-11-02 Thread RP Khare
Hi, Though the following issue we are facing at present with Oracle 10g database, but I just want to know how PostgreSQL would solve this problem. We are planning a migration to any open-source RDBMS in future, so just wanted to clear this issue. Let me clear the scenario, the real-life issue

Re: [GENERAL] JDBC Transactions

2010-11-02 Thread Craig Ringer
On 11/02/2010 03:01 AM, Jonathan Tripathy wrote: user1 goes to customer page, clicks on "delete membership" of the last member ship, which blows away the membership, user2 goes to customer page, clicks on "add membership" and starts filling out info. user1 then blows away the customer. However

Re: [GENERAL] index in desc order

2010-11-02 Thread AI Rumman
But I am using Postgresql 8.1. Is it possible here? On Tue, Nov 2, 2010 at 3:42 PM, Szymon Guz wrote: > > > On 2 November 2010 10:36, AI Rumman wrote: > >> Is it possible to create an index in descending order? >> > > yes... > > create index i on t(i desc); > > > regards > Szymon >

Re: [GENERAL] Dealing with locking on batch updates.

2010-11-02 Thread Szymon Guz
On 2 November 2010 10:47, RP Khare wrote: > Hi, > > Though the following issue we are facing at present with Oracle 10g > database, but I just want to know how PostgreSQL would solve this problem. > We are planning a migration to any open-source RDBMS in future, so just > wanted to clear this iss

Re: [GENERAL] index in desc order

2010-11-02 Thread Sergey Konoplev
On 2 November 2010 12:57, AI Rumman wrote: > But I am using Postgresql 8.1. Is it possible here? I am afraid not. You could try to do the index using kind of 1/field trick but I am not sure if it performs better than backward index scan in general. > > On Tue, Nov 2, 2010 at 3:42 PM, Szymon Guz

Re: [GENERAL] JDBC Transactions

2010-11-02 Thread Jonathan Tripathy
On 02/11/10 09:53, Craig Ringer wrote: On 11/02/2010 03:01 AM, Jonathan Tripathy wrote: user1 goes to customer page, clicks on "delete membership" of the last member ship, which blows away the membership, user2 goes to customer page, clicks on "add membership" and starts filling out info. user

[GENERAL] postgre...@fosdem 2011 - Call for talks

2010-11-02 Thread Andreas 'ads' Scherbaum
FOSDEM is one of the biggest Free and Open Source event held annually in Brussels, Belgium, and attended by around 4000 people. As in recent years, the PostgreSQL project will have a devroom where we will be presenting a number of talks. The event will be held on the 5 - 6th February 2011.

Re: [GENERAL] Replication

2010-11-02 Thread Vick Khera
On Tue, Nov 2, 2010 at 2:59 AM, Jonathan Tripathy wrote: > What is the difference between the "Hot-Standby" and "Warm-Standby"? Is the > only different that the "Hot-Standby" standby servers are read-only, whereas > the "Warm-Standby" standbys can't be queried at all? > That's the general definit

Re: [GENERAL] Replication

2010-11-02 Thread Vick Khera
On Mon, Nov 1, 2010 at 6:39 PM, Jonathan Tripathy wrote: > So in the "Hot Standby" setup as described in > http://www.postgresql.org/docs/current/static/hot-standby.html , how would I > automatically make the slave a master? If you plan to make it automatic, be absolutely 100% sure that your

Re: [GENERAL] Dealing with locking on batch updates.

2010-11-02 Thread Vick Khera
On Tue, Nov 2, 2010 at 5:47 AM, RP Khare wrote: > I want to know how we can handle this issue in PostgreSQL. > When you load your 50,000 record batch, do it inside a transaction block and "SELECT FOR UPDATE" the rows instead of plain "SELECT". That will lock those rows from being updated by other

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Carlos Mennens
So I am still in the dark about the entire upgrade or step up process from 8.4.4-6 to 9.0.1-2. I have my 4 databases all backed up which I did when my server was 8.4.4-6 using the 'pg_dump' utility. That worked fine. So after I backed up my databases, I then upgraded the daemon to 9.0.1-2 and from

Re: [GENERAL] Implementing replace function

2010-11-02 Thread Matthieu Huin
Hello, If you expect your data to reach some kind of "critical size" at some point ( ie updates will be more likely than inserts at that point ), you can optimize your UPSERT code by trying to UPDATE before INSERTing. Otherwise trying to INSERT first should decrease the average UPSERT executi

Re: [GENERAL] index in desc order

2010-11-02 Thread Tom Lane
Szymon Guz writes: > On 2 November 2010 10:36, AI Rumman wrote: >> Is it possible to create an index in descending order? > create index i on t(i desc); Note that there is actually no point at all in such a declaration. The planner is perfectly capable of using backwards indexscans at need, so

Re: [GENERAL] index in desc order

2010-11-02 Thread Michal Politowski
On Tue, 2 Nov 2010 10:10:19 -0400, Tom Lane wrote: > Szymon Guz writes: > > On 2 November 2010 10:36, AI Rumman wrote: > >> Is it possible to create an index in descending order? > > > create index i on t(i desc); > > Note that there is actually no point at all in such a declaration. > The pla

Re: [GENERAL] Replication

2010-11-02 Thread Jonathan Tripathy
From: pgsql-general-ow...@postgresql.org on behalf of Vick Khera Sent: Tue 02/11/2010 13:18 To: pgsql-general Subject: Re: [GENERAL] Replication On Tue, Nov 2, 2010 at 2:59 AM, Jonathan Tripathy wrote: > What is the difference between the "Hot-Standby" and "Wa

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Adrian Klaver
On Tuesday 02 November 2010 7:02:05 am Carlos Mennens wrote: > So I am still in the dark about the entire upgrade or step up process > from 8.4.4-6 to 9.0.1-2. I have my 4 databases all backed up which I > did when my server was 8.4.4-6 using the 'pg_dump' utility. That > worked fine. So after I ba

[GENERAL] Group by and lmit

2010-11-02 Thread Bill Reynolds
Hey Folks - have a coded myself into a corner yet? I have a situation with a select count / group by / order by query that I need to limit each group to 500 entries. Not seeing a way to do this in a single query, do I need to use multiple queries? Group x has about 200 entries in it; group y

Re: [GENERAL] pg_get_procdef ?

2010-11-02 Thread Dimitri Fontaine
hubert depesz lubaczewski writes: > and check the queries. getting function definition from there should be > simple. Check getddl to see how much simple it is: https://labs.omniti.com/labs/pgtreats/wiki/getddl http://pgsql.tapoueh.org/getddl/ http://pgsql.tapoueh.org/getddl/sql/function.b

Re: [GENERAL] how to get the height of index tree?

2010-11-02 Thread Dimitri Fontaine
John R Pierce writes: >> 2010/10/22 sunpeng mailto:blueva...@gmail.com>> >> >> Hi, how to get the height of R* or B tree of created index ? You could use Gevel for GiST and GIN: http://www.sai.msu.su/~megera/wiki/Gevel Don't know if something similar exists for btree, but I guess it would

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Diego Schulz
On Mon, Nov 1, 2010 at 1:36 PM, Carlos Mennens wrote: > I did an upgrade on my database server this past weekend and the > database fails to start. I checked /var/log/postgresql and found the > reason: > > [r...@slave ~]# ps aux | grep postgres > root      5189  0.0  0.0   8128   956 pts/0    S+  

Re: [GENERAL] Replication

2010-11-02 Thread Dimitri Fontaine
Jonathan Tripathy writes: > What is the difference between the "Hot-Standby" and "Warm-Standby"? Is the > only different that the "Hot-Standby" standby servers are read-only, whereas > the "Warm-Standby" standbys can't be queried at all? That and the fact that running queries are not canceled at

Re: [GENERAL] index in desc order

2010-11-02 Thread Dimitri Fontaine
Michal Politowski writes: > Cannot there be a (system/hardware) setup where there is a perceptible > performance difference between forward and backward index scans? I think it's been reported already that backward index scans indeed can be much slower than forward index scan, but that how to mod

Re: [GENERAL] Is this a known feature of 8.1 SSL connection?

2010-11-02 Thread zhong ming wu
On Tue, Nov 2, 2010 at 11:25 AM, Ray Stell wrote: > On Tue, Nov 02, 2010 at 09:03:59AM -0400, zhong ming wu wrote: >> On Mon, Nov 1, 2010 at 5:06 PM, Ray Stell wrote: >> > >> > no, that does not make sense to me, however, I don't have an 8.x to play >> with. >> > >> > In 9.0.1, >> > with hostnos

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Steve Clark
On 11/01/2010 02:49 PM, Carlos Mennens wrote: On Mon, Nov 1, 2010 at 2:27 PM, Steve Crawford wrote: I'm guessing you are missing an initdb. Move your old data directory somewhere else for now and do a new initdb so you can start up version 9. When you say 'old data' can you be more

[GENERAL] Feature request for this mail list

2010-11-02 Thread zhong ming wu
I looked on PG website but couldn't find admin email for this list I would like list emails to have extra 'reply-to' header addressed to the list Is it too much to ask? When replying from a mobile client it can be tricky without + even from a bigger client most often I forgot

Re: [GENERAL] can select contents of view but not view itself, despite indirect membership

2010-11-02 Thread Kevin Field
> My guess is that it has something to do with the join to the table > 'mandate'.  If your view definition includes a CASE WHEN... that would My new guess is something to do with permissions being cached somewhere, because this morning when I tried it (SET followed by SELECT from page_startup) fro

Re: [GENERAL] Feature request for this mail list

2010-11-02 Thread Tom Lane
zhong ming wu writes: > I would like list emails to have extra 'reply-to' header addressed to the > list > Is it too much to ask? Yes. This is something that would break the messaging style that everyone on these lists uses. Reply-to-all is the standard custom around here.

Re: [GENERAL] Implementing replace function

2010-11-02 Thread Martijn van Oosterhout
On Tue, Nov 02, 2010 at 10:46:42AM +0100, Matthieu Huin wrote: > Hello, > > If you expect your data to reach some kind of "critical size" at some > point ( ie updates will be more likely than inserts at that point ), you > can optimize your UPSERT code by trying to UPDATE before INSERTing. >

[GENERAL] pg_migrator segfault

2010-11-02 Thread hernan gonzalez
I am stuck with a segmentation fault while running pg_upgrade, from 8.4.3 to 9.0.1 $ ./pg_upgrade -d /var/pgsql-8_4_3/data/ -D /var/pgsql-9_0_1/data/ -b /var/pgsql-8_4_3/bin/ -B /var/pgsql-9_0_1/bin/ --check -P 5433 -v -g -G debug Running in verbose mode Running in debug mode PerForming Consistenc

Re: [GENERAL] pg_migrator segfault

2010-11-02 Thread Grzegorz Jaśkiewicz
try gdb --args ./pg_upgrade -d /var/pgsql-8_4_3/data/ -D /var/pgsql-9_0_1/data/ -b /var/pgsql-8_4_3/bin/ -B /var/pgsql-9_0_1/bin/ --check -P 5433 -v -g -G debug and when it fails, type in 'bt' and paste it here please. -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] Replication

2010-11-02 Thread Simon Riggs
On Tue, 2010-11-02 at 06:59 +, Jonathan Tripathy wrote: > >>> > >> So in the "Hot Standby" setup as described in > >> http://www.postgresql.org/docs/current/static/hot-standby.html , how would > >> I > >> automatically make the slave a master? > > I think you're looking for this: > > http://w

Re: [GENERAL] Is this a known feature of 8.1 SSL connection?

2010-11-02 Thread zhong ming wu
On Tue, Nov 2, 2010 at 1:43 PM, Ray Stell wrote: >> >> Good question. First, it's not easy to get confused like this because server >> logs lives in $PGDATA/pg_log/ > > > this is configurable in postgresql.conf. you can set the logs to any dir > that exists and is writable by the software owner.

Re: [GENERAL] pg_migrator segfault

2010-11-02 Thread hernan gonzalez
2010/11/2 Grzegorz Jaśkiewicz > try gdb --args ./pg_upgrade -d /var/pgsql-8_4_3/data/ -D > /var/pgsql-9_0_1/data/ -b /var/pgsql-8_4_3/bin/ -B > /var/pgsql-9_0_1/bin/ --check -P 5433 -v -g -G debug > and when it fails, type in 'bt' and paste it here please. > > -- > GJ > Well, this is strange. I

Re: [GENERAL] Feature request for this mail list

2010-11-02 Thread Martijn van Oosterhout
On Tue, Nov 02, 2010 at 11:58:35AM -0400, zhong ming wu wrote: > I looked on PG website but couldn't find admin email for this list > > I would like list emails to have extra 'reply-to' header addressed to the > list > > Is it too much to ask? When replying from a mobile client it can be tricky

Re: [GENERAL] pg_upgrade segfault (was: pg_migrator segfault)

2010-11-02 Thread hernan gonzalez
2010/11/2 hernan gonzalez > 2010/11/2 Grzegorz Jaśkiewicz > > try gdb --args ./pg_upgrade -d /var/pgsql-8_4_3/data/ -D >> /var/pgsql-9_0_1/data/ -b /var/pgsql-8_4_3/bin/ -B >> /var/pgsql-9_0_1/bin/ --check -P 5433 -v -g -G debug >> and when it fails, type in 'bt' and paste it here please. >> >>

Re: [GENERAL] pg_migrator segfault

2010-11-02 Thread Tom Lane
hernan gonzalez writes: > Well, this is strange. I run the same command line with gbd, it does not > throw the segfault. Interesting. Do "ulimit -c unlimited", then run pg_upgrade normally, and then try "gdb ./pg_upgrade core" (the name of the corefile might be something different depending on l

Re: [GENERAL] Is this a known feature of 8.1 SSL connection?

2010-11-02 Thread zhong ming wu
Sorry to top post but it's this email client .. pg_hba.conf is bare bone Besides it asks for certs but it obviously does not do SSL connection at the end On Nov 2, 2010 2:12 PM, "Ray Stell" wrote: On Tue, Nov 02, 2010 at 01:54:34PM -0400, zhong ming wu wrote: > On Tue, Nov 2, 2010 at 1:43 PM,

Re: [GENERAL] pg_upgrade segfault (was: pg_migrator segfault)

2010-11-02 Thread Tom Lane
hernan gonzalez writes: > Running gbd with the core generated by the segfault, it outputs this: > Program terminated with signal 11, Segmentation fault. > #0 0xb7df84ed in _int_realloc () from /lib/libc.so.6 > Missing separate debuginfos, use: debuginfo-install glibc-2.11.1-4.i686 > (gdb) bt > #

Re: [GENERAL] pg_upgrade segfault (was: pg_migrator segfault)

2010-11-02 Thread hernan gonzalez
In pg_upgrade/controldata.c , putenv2 function : char *envstr = (char *) pg_malloc(ctx, strlen(var) + strlen(val) + 1); sprintf(envstr, "%s=%s", var, val); Shouldn't it be "+ 2 " instead of "+ 1" ? (one for the '=', plus one for the null terminating char) ? I think that

Re: [GENERAL] pg_upgrade segfault (was: pg_migrator segfault)

2010-11-02 Thread hernan gonzalez
Replacing that 1 for 2 it's enough for making it work, for me, it seems. But it's not enough to get valgrind happy (It still reports 4 "definitely lost" blocks, all from that putenv2 function). Perhaps that's related to the comment: /* * Do not free envstr because it becomes pa

Re: [GENERAL] pg_upgrade segfault (was: pg_migrator segfault)

2010-11-02 Thread Tom Lane
hernan gonzalez writes: > In pg_upgrade/controldata.c , putenv2 function : > char *envstr = (char *) pg_malloc(ctx, strlen(var) > + strlen(val) + 1); > sprintf(envstr, "%s=%s", var, val); > Shouldn't it be "+ 2 " instead of "+ 1" ? Yup, it sure should. So probably the r

[GENERAL] Return key from query

2010-11-02 Thread Jonathan Tripathy
Hi everyone, When adding a new record, we run an insert query which auto-increments the primary key for the table. However the method (in java) which calls this query must return the newly created key. Any ideas on how to do this, preferably using a single transaction? Thanks -- Sent via pg

Re: [GENERAL] Return key from query

2010-11-02 Thread Steve Crawford
On 11/02/2010 01:43 PM, Jonathan Tripathy wrote: Hi everyone, When adding a new record, we run an insert query which auto-increments the primary key for the table. However the method (in java) which calls this query must return the newly created key. Any ideas on how to do this, preferably u

Re: [GENERAL] Return key from query

2010-11-02 Thread Szymon Guz
On 2 November 2010 21:43, Jonathan Tripathy wrote: > Hi everyone, > > When adding a new record, we run an insert query which auto-increments the > primary key for the table. However the method (in java) which calls this > query must return the newly created key. > > Any ideas on how to do this, p

Re: [GENERAL] Return key from query

2010-11-02 Thread Rob Sargent
On 11/02/2010 02:43 PM, Jonathan Tripathy wrote: > Hi everyone, > > When adding a new record, we run an insert query which auto-increments > the primary key for the table. However the method (in java) which calls > this query must return the newly created key. > > Any ideas on how to do this, p

Re: [GENERAL] Return key from query

2010-11-02 Thread Szymon Guz
On 2 November 2010 21:59, Rob Sargent wrote: > > > On 11/02/2010 02:43 PM, Jonathan Tripathy wrote: > > Hi everyone, > > > > When adding a new record, we run an insert query which auto-increments > > the primary key for the table. However the method (in java) which calls > > this query must retur

[GENERAL] postgres videos - copyright issues or something else?

2010-11-02 Thread Aljoša Mohorović
it's very hard to find postgres related videos although i regularly read various blog posts mentioning some talk/conference. is this because some copyright issues or somethings else? i've tried finding a videos/talks page on postgres site but didn't find anything (other then fosdem videos). any li

Re: [GENERAL] postgres videos - copyright issues or something else?

2010-11-02 Thread Rodrigo Gonzalez
Maybe this link can help you http://vimeo.com/channels/postgres On Tue, 2 Nov 2010 22:11:34 +0100 Aljoša Mohorović wrote: > it's very hard to find postgres related videos although i regularly > read various blog posts mentioning some talk/conference. > is this because some copyright issues or

Re: [GENERAL] postgres videos - copyright issues or something else?

2010-11-02 Thread Aljoša Mohorović
On Tue, Nov 2, 2010 at 10:17 PM, Rodrigo Gonzalez wrote: > Maybe this link can help you http://vimeo.com/channels/postgres thanks, i was looking for something like that. somebody who has access to postgres site should put this link (and similar) somewhere where users can find it. Aljosa -- Sen

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Carlos Mennens
On Tue, Nov 2, 2010 at 10:53 AM, Steve Clark wrote: > mv /var/lib/postgres/data  /var/lib/postgres/data.old Before I move or rename '/var/lib/postgres/data', what version of PostgreSQL should I be at? 8.4 or 9.0? > You will then have to do an initdb to create the basic 9.x databases. > You can t

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Leif Biberg Kristensen
On Tuesday 2. November 2010 22.37.33 Carlos Mennens wrote: > On Tue, Nov 2, 2010 at 10:53 AM, Steve Clark wrote: > > mv /var/lib/postgres/data /var/lib/postgres/data.old > > Before I move or rename '/var/lib/postgres/data', what version of > PostgreSQL should I be at? 8.4 or 9.0? You should be

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Thomas Kellerer
Carlos Mennens, 02.11.2010 22:37: Before I move or rename '/var/lib/postgres/data', what version of PostgreSQL should I be at? 8.4 or 9.0? Actually both, because pg_upgrade needs the binaries of the old *and* new version. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Adrian Klaver
On 11/02/2010 02:54 PM, Thomas Kellerer wrote: Carlos Mennens, 02.11.2010 22:37: Before I move or rename '/var/lib/postgres/data', what version of PostgreSQL should I be at? 8.4 or 9.0? Actually both, because pg_upgrade needs the binaries of the old *and* new version. Part of the confusio

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Thomas Kellerer
Adrian Klaver, 02.11.2010 23:23: Before I move or rename '/var/lib/postgres/data', what version of PostgreSQL should I be at? 8.4 or 9.0? Actually both, because pg_upgrade needs the binaries of the old *and* new version. Part of the confusion Carlos is experiencing is that he is caught betwee

[GENERAL] Postgres connection errors

2010-11-02 Thread Tim Uckun
Hello. I have lots of ruby daemons running connected to postgres. Some of them start getting connection errors after about a day or two of running. The odd thing is that they don't all get the same error. Some get this error: PGError: lost synchronization with server: got message type "T" Others

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Raymond O'Donnell
On 02/11/2010 21:37, Carlos Mennens wrote: # /etc/rc.d/postgresql initdb usage: /etc/rc.d/postgresql {start|stop|restart} That's the daemon start/stop script. You need something like this: /path/to/pg/binaries/initdb /path/to/data/dir Ray. -- Raymond O'Donnell :: Galway :: Ireland r...@i

Re: [GENERAL] Postgres connection errors

2010-11-02 Thread Tom Lane
Tim Uckun writes: > I have lots of ruby daemons running connected to postgres. Some of > them start getting connection errors after about a day or two of > running. The odd thing is that they don't all get the same error. > Some get this error: PGError: lost synchronization with server: got > me

Re: [GENERAL] JDBC Transactions

2010-11-02 Thread Craig Ringer
On 02/11/10 18:29, Jonathan Tripathy wrote: > I don't really mind what happens, as > long as the user is made aware of what has happen, and there aren’t any > memberships with no corresponding customers. Well, that's taken care of by a referential integrity constraint. You don't need anything el

Re: [GENERAL] Replication

2010-11-02 Thread Craig Ringer
On 02/11/10 21:21, Vick Khera wrote: > On Mon, Nov 1, 2010 at 6:39 PM, Jonathan Tripathy wrote: >> So in the "Hot Standby" setup as described in >> http://www.postgresql.org/docs/current/static/hot-standby.html , how would I >> automatically make the slave a master? > > If you plan to make it aut

Re: [GENERAL] Postgres connection errors

2010-11-02 Thread Tim Uckun
> > Most of the cases we've seen like that have been because multiple > threads in the client application were trying to use the same PGconn > connection object concurrently.  There's no cross-thread synchronization > built into libpq, so you have to provide the interlocks yourself if > there's any

Re: [GENERAL] JDBC Transactions

2010-11-02 Thread Jonathan Tripathy
On 02/11/10 23:11, Craig Ringer wrote: On 02/11/10 18:29, Jonathan Tripathy wrote: I don't really mind what happens, as long as the user is made aware of what has happen, and there aren’t any memberships with no corresponding customers. Well, that's taken care of by a referential integrity c

[GENERAL] Group by and limit

2010-11-02 Thread Reid Thompson
Reposting as I noticed that the original was in reply to a different subject. Hey Folks – have a coded myself into a corner yet? I have a situation with a select count / group by / order by query that I need to limit each group to 500 entries. Not seeing a way to do this in a single query, do

[GENERAL] A strange SQL grammar issue with postgreSql 8.4.4 & Hibernate 3.5

2010-11-02 Thread Sheng Hui
Hi, This is the sql statement that causes the problem in Hibernate. It's actually generated by Hibernate. select this_.ENTITY_ID as ENTITY1_54_0_, this_.objecthandle_id as objectha2_54_0_, this_.remoteId as remoteId55_0_, this_.MANAGEMENTSERVER_ID as MANAGEME2_55_0_, this_.configFile as confi

[GENERAL] use wal archiving scheme from 8.1 on 9.0

2010-11-02 Thread zhong ming wu
Hello List I have a nicely working system of maintaining a cold standby of master 8.1.11 server. System consists of a set of scripts to do a base backup to standby and scheme to send wal files and restoring the cold standby should the master server break down I have another totally separate post

Re: [GENERAL] A strange SQL grammar issue with postgreSql 8.4.4 & Hibernate 3.5

2010-11-02 Thread Tom Lane
Sheng Hui writes: > the exception from this statement is > JDBCExceptionReporter - ERROR: unterminated quoted string at or near "'\')" > The unwrapped SQL exception is pretty much the same, complaining about the > escape '\' at the end of the statement. Looks to me like somebody's on the wron

[GENERAL] timestamps in Australia

2010-11-02 Thread Jasen Betts
set timezone to 'Australia/Sydney'; set timezone_abbreviations to 'Australia'; set datestyle to 'SQL,DMY'; select '2011-04-03 01:00'::timestamptz+generate_series(0,3)*'1h'::interval,generate_series(0,3); notice how the middle two look the same. (this is Australias DST change-back) This has th