Re: [GENERAL] speaking of 8.4...

2009-02-25 Thread Scara Maccai
What? Hot standby won't make it in 8.4? That's a shame... - Messaggio originale - Da: Fujii Masao masao.fu...@gmail.com A: pie...@hogranch.com Cc: pgsql-general@postgresql.org Inviato: Martedì 24 febbraio 2009, 20:47:05 Oggetto: Re: [GENERAL] speaking of 8.4... Hi, On Tue,

Re: [GENERAL] where to divide application and database

2009-02-25 Thread Ivan Sergio Borgonovo
On Sat, 21 Feb 2009 15:02:55 -0800 Ron Mayer rm...@cheapcomplexdevices.com wrote: Ivan Sergio Borgonovo wrote: I was wondering if checks may have an impact on performances and if pg does some optimisation over them. Are you suggesting thee would be a positive or negative impact on

Re: [GENERAL] speaking of 8.4...

2009-02-25 Thread Dave Page
On Wed, Feb 25, 2009 at 8:16 AM, Scara Maccai m_li...@yahoo.it wrote: What? Hot standby won't make it in 8.4? Hot standby != synch-rep. The former is still being reviewed, though it's starting to look like it's cutting it pretty fine for inclusion in 8.4. -- Dave Page EnterpriseDB UK:

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Thom Brown
Thanks for the link Simon, but this doesn't recommend any method for triggering failover, or telling the primary that another server is now primary. We've set up a primary server in archive mode to continuously archive to an NFS mount, and the standby server to continuously recovery from that

Re: [GENERAL] where to divide application and database

2009-02-25 Thread Ivan Sergio Borgonovo
On Fri, 20 Feb 2009 20:45:20 + Sam Mason s...@samason.me.uk wrote: On Fri, Feb 20, 2009 at 04:51:33PM +0100, Ivan Sergio Borgonovo wrote: What I find a bit annoying is politely deal with the error once it is reported back to the application *and* connection and *bandwidth* costs of

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Karsten Hilbert
On Wed, Feb 25, 2009 at 09:26:26AM +, Thom Brown wrote: We've set up a primary server in archive mode to continuously archive to an NFS mount, and the standby server to continuously recovery from that directory (although I'm not sure that's actually working... I've probably overlooked

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Thom Brown
2009/2/25 Karsten Hilbert karsten.hilb...@gmx.net Think backwards: How would it automatically *dis*appear from there. Have the secondary create it and check for existance at regular intervals. Have the primary delete it at slightly shorter intervals. When the secondary finds it again after

[GENERAL] Can I use a query with UPDATE on its SET?

2009-02-25 Thread Eus
Hi Ho! Since I can do: INSERT INTO table (SELECT a_transaction.*); I am wondering whether I can do: UPDATE table SET (SELECT a_transaction.*) WHERE primary_key = (SELECT a_transaction.primary_key); instead of: DELETE FROM table WHERE primary_key = (SELECT a_transaction.primary_key); INSERT

[GENERAL] funny view/temp table problem with query

2009-02-25 Thread Grzegorz Jaśkiewicz
So I have a 'accounts' table, with id and name, and than some hypothetical 'packages' table, containing some info per customer. I need to retrive distinct pairs , of random packages assigned per customer. Packages table contains 10 packages, id:=[1:10], there's 1M customers for testing purposes.

Re: [GENERAL] restore single table

2009-02-25 Thread Alban Hertroys
On Feb 24, 2009, at 1:07 PM, Albe Laurenz wrote: Kevin Duffy wrote: I need guidance on how move some changes that I have made to my production database. A few thoughts: Maybe you do not need to delete and recreate the table. An ALTER TABLE statement can, for example, add a column to an

Re: [GENERAL] Large object loading stalls

2009-02-25 Thread Michael Akinde
Tom Lane wrote: Michael Akinde michael.aki...@met.no writes: Tom Lane wrote: In the past we've seen this type of thing caused by multithreaded client programs in which more than one thread tried to use the same PGconn object without adequate interlocking. Our application is

[GENERAL] Using xmin to identify last modified rows

2009-02-25 Thread Stéphane A. Schildknecht
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Trying to identify last modified (updated or inserted) rows in a table, I thought I could use xmin. I tried is to get some lines sorted by xmin. When doing it on a slonified database, I had no problem getting these lines. But, trying the same

[GENERAL] Restore DB

2009-02-25 Thread Shahbaz A. Tyagi
Hi, We are using Postgres 8.3. We have backed up our db and while trying to restore, its not able to. We are using PgAdminIII for the same. What all other ways we have to restore the db. We have both the old data directory as well as backed up data. Shabz

Re: [GENERAL] Restore DB

2009-02-25 Thread Ashish Karalkar
Shahbaz A. Tyagi wrote: Hi, We are using Postgres 8.3. We have backed up our db and while trying to restore, its not able to. We are using PgAdminIII for the same. What all other ways we have to restore the db. We have both the old data directory as well as backed up data.

Re: [GENERAL] Restore DB

2009-02-25 Thread Ashish Karalkar
Shahbaz A. Tyagi wrote: Hi, We are using Postgres 8.3. We have backed up our db and while trying to restore, its not able to. We are using PgAdminIII for the same. What all other ways we have to restore the db. We have both the old data directory as well as backed up data.

Re: [GENERAL] funny view/temp table problem with query

2009-02-25 Thread Grzegorz Jaśkiewicz
all explains: Query without view: QUERY PLAN Aggregate (cost=94419553.37..94419553.38 rows=1 width=16) - Sort

Re: [GENERAL] Using xmin to identify last modified rows

2009-02-25 Thread Gregory Stark
Stéphane A. Schildknecht stephane.schildkne...@postgresqlfr.org writes: But, trying the same query on a non slonified DB, I got an error, as there is no ordering operator for xid. I think that in the slon case, the query uses the implicit cast xid-xxid, and then the operator to sort xxid.

Re: [GENERAL] Using xmin to identify last modified rows

2009-02-25 Thread Richard Broersma
On Wed, Feb 25, 2009 at 5:21 AM, Gregory Stark st...@enterprisedb.com wrote: I'm not sure using xmin is such a great idea really. It's handy for ad-hoc queries but there are all kinds of cases where it might not give you the results you expect. Its been a while since the following emails

Re: [GENERAL] Restore DB

2009-02-25 Thread Shahbaz A. Tyagi
We took using PgAdminIII right click action. And it generated .backup files. However while restoring whole machine is getting hanged for unlimited time. So just checking do we have some other way also, as we have complete Postgre directory also. Thanks, Shahbaz A. Tyagi Sphere Networks

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Thom Brown
I'm still trying to work out how this file creation/deletion thing will work. If I can tag a touch /tmp/pg.trigger command to the end of the recovery command, how often will that be called? If I can't, I still need to ensure that it is created and deleted before the recovery command is called,

Re: [GENERAL] Using xmin to identify last modified rows

2009-02-25 Thread Stéphane A. Schildknecht
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gregory Stark a écrit : Stéphane A. Schildknecht stephane.schildkne...@postgresqlfr.org writes: (...) You could order by age(xmin) instead What would be the best way to get last modified rows? I'm not sure using xmin is such a great idea

Re: [GENERAL] Restore DB

2009-02-25 Thread Ashish Karalkar
Shahbaz A. Tyagi wrote: We took using PgAdminIII right click action. And it generated .backup files. However while restoring whole machine is getting hanged for unlimited time. So just checking do we have some other way also, as we have complete Postgre directory also. Thanks, Shahbaz A.

Re: [GENERAL] Using xmin to identify last modified rows

2009-02-25 Thread Albe Laurenz
Stéphane A. Schildknecht wrote: Trying to identify last modified (updated or inserted) rows in a table, I thought I could use xmin. I tried is to get some lines sorted by xmin. When doing it on a slonified database, I had no problem getting these lines. But, trying the same query on a

Re: [GENERAL] Using xmin to identify last modified rows

2009-02-25 Thread Gregory Stark
Richard Broersma richard.broer...@gmail.com writes: On Wed, Feb 25, 2009 at 5:21 AM, Gregory Stark st...@enterprisedb.com wrote: I'm not sure using xmin is such a great idea really. It's handy for ad-hoc queries but there are all kinds of cases where it might not give you the results you

[GENERAL] cursor question

2009-02-25 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, short question. Why is this not possible: CREATE OR REPLACE FUNCTION user_cursor_open(text) RETURNS refcursor AS $$ DECLARE curs1 CURSOR FOR SELECT * FROM $1; BEGIN OPEN curs1; RETURN curs1; END; $$ LANGUAGE plpgsql; Or,

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Joshua D. Drake
On Wed, 2009-02-25 at 13:54 +, Thom Brown wrote: I'm still trying to work out how this file creation/deletion thing will work. If I can tag a touch /tmp/pg.trigger command to the end of the recovery command, how often will that be called? If I can't, I still need to ensure that it is

Re: [GENERAL] cursor question

2009-02-25 Thread Pavel Stehule
Hello when you would to change name of table - you have to use dynamic query 38.7.2.2. OPEN FOR EXECUTE OPEN unbound_cursor [ [ NO ] SCROLL ] FOR EXECUTE query_string; http://www.postgresql.org/docs/8.3/interactive/plpgsql-cursors.html regards Pavel Stehule 2009/2/25 Andreas Wenk

Re: [GENERAL] Using xmin to identify last modified rows

2009-02-25 Thread Tom Lane
Richard Broersma richard.broer...@gmail.com writes: On Wed, Feb 25, 2009 at 5:21 AM, Gregory Stark st...@enterprisedb.com wrote: I'm not sure using xmin is such a great idea really. It's handy for ad-hoc queries but there are all kinds of cases where it might not give you the results you

[GENERAL] Several simultaneous libpq connections from the same application to different servers using different SSL certs

2009-02-25 Thread Knut P. Lehre
When using a libpq-based clientlib with SSL, libpq gets crt and key files from %APPDATA%\postgresql (on MS Windows) (from now on called DIR). I'd like to connect from the same app to two different pg servers using a different set of crt/key files. One way of doing that could have been to first

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Thom Brown
You are doing this the hard way. Grab PITRTTools. https://projects.commandprompt.com/public/pitrtools I can't really dispute a recommendation from JD. I'll have to look into that. It's a shame because we've spent ages trying to work out where we've been going wrong in this whole process

[GENERAL] Valid characters for user/role/group names?

2009-02-25 Thread Roderick A. Anderson
In my continuing quest for multi-tenant ways I'm trying to come up with a method to name roles, users, and groups that will not clash across the cluster. The plans are to have one database per tenant and place applications in different schema in those databases. This is working fine so far

Re: [GENERAL] Valid characters for user/role/group names?

2009-02-25 Thread Sam Mason
On Wed, Feb 25, 2009 at 08:50:15AM -0800, Roderick A. Anderson wrote: http://www.postgresql.org/docs/current/interactive/sql-syntax-lexical.html SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_).

Re: [GENERAL] Valid characters for user/role/group names?

2009-02-25 Thread Tom Lane
Sam Mason s...@samason.me.uk writes: You'd want to put double quotes around the identifier. Try searching for quoted identifier in the above page. Note that the double quotes would be needed when referencing the role identifier in SQL commands (eg CREATE ROLE). In other contexts, such as

Re: [GENERAL] Several simultaneous libpq connections from the same application to different servers using different SSL certs

2009-02-25 Thread Magnus Hagander
Knut P. Lehre wrote: When using a libpq-based clientlib with SSL, libpq gets crt and key files from %APPDATA%\postgresql (on MS Windows) (from now on called DIR). I'd like to connect from the same app to two different pg servers using a different set of crt/key files. One way of doing that

Re: [GENERAL] cursor question

2009-02-25 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pavel Stehule schrieb: Hello when you would to change name of table - you have to use dynamic query 38.7.2.2. OPEN FOR EXECUTE OPEN unbound_cursor [ [ NO ] SCROLL ] FOR EXECUTE query_string;

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Joshua D. Drake
On Wed, 2009-02-25 at 16:33 +, Thom Brown wrote: You are doing this the hard way. Grab PITRTTools. https://projects.commandprompt.com/public/pitrtools I can't really dispute a recommendation from JD. I'll have to look into that. It's a shame

[GENERAL] Postgres SRPMs for RHEL

2009-02-25 Thread Justin Pasher
Is there a reason why the source RPMs for PG 8.1.16 on RHEL don't show up here? http://www.postgresql.org/ftp/binary/v8.1.16/linux/srpms/redhat/rhel-4-i386/ If I cycle through the versions, the last version in the 8.1 branch I can find with source RPMs is 8.1.14. -- Justin Pasher -- Sent

Re: [GENERAL] Postgres SRPMs for RHEL

2009-02-25 Thread Joshua D. Drake
On Wed, 2009-02-25 at 12:10 -0600, Justin Pasher wrote: Is there a reason why the source RPMs for PG 8.1.16 on RHEL don't show up here? http://www.postgresql.org/ftp/binary/v8.1.16/linux/srpms/redhat/rhel-4-i386/ If I cycle through the versions, the last version in the 8.1 branch I can

Re: [GENERAL] Postgres SRPMs for RHEL

2009-02-25 Thread Justin Pasher
Joshua D. Drake wrote: On Wed, 2009-02-25 at 12:10 -0600, Justin Pasher wrote: Is there a reason why the source RPMs for PG 8.1.16 on RHEL don't show up here? http://www.postgresql.org/ftp/binary/v8.1.16/linux/srpms/redhat/rhel-4-i386/ If I cycle through the versions, the last version in

Re: [GENERAL] Postgres SRPMs for RHEL

2009-02-25 Thread Devrim GÜNDÜZ
On Wed, 2009-02-25 at 12:10 -0600, Justin Pasher wrote: Is there a reason why the source RPMs for PG 8.1.16 on RHEL don't show up here? http://www.postgresql.org/ftp/binary/v8.1.16/linux/srpms/redhat/rhel-4-i386/ 'cause I was a bit lazy to sync srpms from main repository. It is my bad, and

Re: [GENERAL] Postgres SRPMs for RHEL

2009-02-25 Thread Joshua D. Drake
On Wed, 2009-02-25 at 12:19 -0600, Justin Pasher wrote: If I cycle through the versions, the last version in the 8.1 branch I can find with source RPMs is 8.1.14. http://yum.pgsqlrpms.org/8.1/redhat/rhel-4ES-i386/ Unless I'm just looking for the wrong filename, I still

Re: [GENERAL] Postgres SRPMs for RHEL

2009-02-25 Thread Justin Pasher
Devrim GÜNDÜZ wrote: On Wed, 2009-02-25 at 12:10 -0600, Justin Pasher wrote: Is there a reason why the source RPMs for PG 8.1.16 on RHEL don't show up here? http://www.postgresql.org/ftp/binary/v8.1.16/linux/srpms/redhat/rhel-4-i386/ 'cause I was a bit lazy to sync srpms from main

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Thom Brown
As a note, all PITRTools does is wrap around all the tools that you are trying to make work. So you will still need pg_standby, rsync, ssh etc... I have updated the wiki to make it a bit more friendly. https://projects.commandprompt.com/public/pitrtools/wiki I've given PITRTools a try,

[GENERAL] foxpro, odbc, data types and unnecessary convertions

2009-02-25 Thread Fernando Moreno
Hi all, I'm using visual foxpro 9 -not my decision- for a client application. Statements are writen as the typical sql string and sent through ODBC. For numbers, I have to convert them first to string and then remove the spaces, the code looks like this: sql_string = some sql + alltrim( str(

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Joshua D. Drake
On Wed, 2009-02-25 at 21:39 +, Thom Brown wrote: As a note, all PITRTools does is wrap around all the tools that you are trying to make work. So you will still need pg_standby, rsync, ssh etc... I have updated the wiki to make

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Thom Brown
Looks like you didn't run cmd_archiver -C config_file -I Ahh, okay, that did something, which I think means it created a directory named after the slave IP in the archive directory. I didn't see any mention of that switch in the README file, unless it's mentioned elsewhere and I missed it. Now

Re: [GENERAL] Warm standby failover mechanism

2009-02-25 Thread Joshua D. Drake
On Wed, 2009-02-25 at 22:06 +, Thom Brown wrote: Looks like you didn't run cmd_archiver -C config_file -I Ahh, okay, that did something, which I think means it created a directory named after the slave IP in the archive directory. Right that is the queue

Tangent Ref: [GENERAL] Valid characters for user/role/group names?

2009-02-25 Thread Roderick A. Anderson
Roderick A. Anderson wrote: In my continuing quest for multi-tenant ways I'm trying to come up with a method to name roles, users, and groups that will not clash across the cluster. snip / While testing and researching I discovered prior work. I was using different terminology.

Re: [GENERAL] foxpro, odbc, data types and unnecessary convertions

2009-02-25 Thread Tom Lane
Fernando Moreno azaze...@gmail.com writes: For numbers, I have to convert them first to string and then remove the spaces, the code looks like this: sql_string = some sql + alltrim( str( some_number ) ) + more sql; I can combine alltrim and str in a third function but it's still tricky. A

Re: [GENERAL] Can I use a query with UPDATE on its SET?

2009-02-25 Thread Craig Ringer
Eus wrote: Hi Ho! Since I can do: INSERT INTO table (SELECT a_transaction.*); I am wondering whether I can do: UPDATE table SET (SELECT a_transaction.*) WHERE primary_key = (SELECT a_transaction.primary_key); UPDATE table SET fieldname = (SELECT ..) WHERE primary_key = (SELECT...)