[GENERAL] Linux x Windows LOCALE/ENCODING compatibility

2010-11-01 Thread Carlos Henrique Reimer
Hi, I currently have my PostgreSQL server running in a windows box and now we're migrating it to a Linux operational system. Current windows configuration: pg_controldata shows the LC_COLLATE and LC_CTYPE are Portuguese_Brasil.1252 psql \l command shows we have databases with encoding WIN1252

[GENERAL] async queries in Perl and poll()/select() loop - how to make them work together?

2010-11-01 Thread Alexander Farber
Hello, I'm using CentOS 5.5 Linux with stock perl v5.8.8 and have installed DBD-Pg-2.17.1 via CPAN shell and I'm using postgresql-server-8.4.5-1PGDG.rhel5. I've prepared a simple test case demonstrating my problem - it is listed at the bottom. It works ok, when I remove {pg_async = PG_ASYNC}. I

[GENERAL] Temporary schemas

2010-11-01 Thread Thomas Kellerer
Hello, I have created a temporary table using create temporary table foo ( id integer ); and noticed this was created in a schema called pg_temp_2 My question is: is this always pg_temp_2? Or will the name of the temp schema change? If it isn't always the same, is there a way I can

Re: [GENERAL] Failover on Windows

2010-11-01 Thread Fujii Masao
On Fri, Oct 29, 2010 at 9:58 PM, Norberto Delle betode...@gmail.com wrote: I'm testing a warm standby setup using PostgreSQL 9 x64 on Windows 2008 R2. What command (pg_standby? cp?) is supplied in restore_command for warm-standby? Or you are testing streaming replication + hot standby? The

Re: [GENERAL] Temporary schemas

2010-11-01 Thread Thom Brown
On 1 November 2010 10:46, Thomas Kellerer spam_ea...@gmx.net wrote: Hello, I have created a temporary table using create temporary table foo ( id integer ); and noticed this was created in a schema called pg_temp_2 My question is: is this always pg_temp_2? Or will the name of the

Re: [GENERAL] Temporary schemas

2010-11-01 Thread Thomas Kellerer
Thom Brown wrote on 01.11.2010 12:33: You can use: SELECT nspname FROM pg_namespace WHERE oid = pg_my_temp_schema(); to get the name of the current temporary schema for your session. Thanks that's what I was looking for. Regards Thomas -- Sent via pgsql-general mailing list

Re: [GENERAL] Failover on Windows

2010-11-01 Thread Norberto Delle
Em 1/11/2010 09:00, Fujii Masao escreveu: On Fri, Oct 29, 2010 at 9:58 PM, Norberto Dellebetode...@gmail.com wrote: I'm testing a warm standby setup using PostgreSQL 9 x64 on Windows 2008 R2. What command (pg_standby? cp?) is supplied in restore_command for warm-standby? Or you are testing

Re: [GENERAL] Problem with Crosstab (Concatenate Problem)

2010-11-01 Thread Stefan Schwarzer
For one of the countries, I have a value for 2007, but not for 1960. When using only the inner query, than I see one line: Andorra - 2007 - 539 But when running the whole SQL, the value for year 2007 get's allocated to the year 1960. The table looks as follows: name |y_1960|

Re: [GENERAL] pgAdmin 3 index display problem

2010-11-01 Thread Eduardas Tcpa
Hello I'm getting into strange problem with pgAdmin 3. As we all know, PostgreSQL enforces index creation on primary key's. The problem with this is the fact, that when i create a table in pgAdmin's sql editor, in result window i'm getting success and a note that an index will be created on

[GENERAL] pgAdmin 3 index display problem

2010-11-01 Thread Eduardas Tcpa
Hello I'm getting into strange problem with pgAdmin 3. As we all know, PostgreSQL enforces index creation on primary key's. The problem with this is the fact, that when i create a table in pgAdmin's sql editor, in result window i'm getting success and a note that an index will be created on tables

Re: [GENERAL] pgAdmin 3 index display problem

2010-11-01 Thread Thom Brown
On 1 November 2010 13:41, Eduardas Tcpa tcp...@gmail.com wrote: Hello I'm getting into strange problem with pgAdmin 3. As we all know, PostgreSQL enforces index creation on primary key's. The problem with this is the fact, that when i create a table in pgAdmin's sql editor, in result window

Re: [GENERAL] pgAdmin 3 index display problem

2010-11-01 Thread Guillaume Lelarge
Le 01/11/2010 06:41, Eduardas Tcpa a écrit : Hello I'm getting into strange problem with pgAdmin 3. As we all know, PostgreSQL enforces index creation on primary key's. The problem with this is the fact, that when i create a table in pgAdmin's sql editor, in result window i'm getting success

[GENERAL] PHP PDO-bindValue() vs row execute speed difference

2010-11-01 Thread Georgi Ivanov
Hi, I have following situation: $q = 'select * from tbl1 where id = :id'; $stmt = $dbh-prepare($q); $stmt-bindValue(':id', $id , PDO::PARAM_INT); $stmt-execute(); //1000 ms and $q1 = ' select * from tbl1 where id = 100 '; $stmt = $dbh-prepare($q); //NO binding here ! $stmt-execute(); //2 ms The

Re: [GENERAL] Problem with Crosstab (Concatenate Problem)

2010-11-01 Thread Stefan Schwarzer
For one of the countries, I have a value for 2007, but not for 1960. When using only the inner query, than I see one line: Andorra - 2007 - 539 But when running the whole SQL, the value for year 2007 get's allocated to the year 1960. The table looks as follows: name |y_1960|

[GENERAL] pgAdmin 3 index display problem

2010-11-01 Thread Eduardas Tcpa
Hello I'm getting into strange problem with pgAdmin 3. As we all know, PostgreSQL enforces index creation on primary key's. The problem with this is the fact, that when i create a table in pgAdmin's sql editor, in result window i'm getting success and a note that an index will be created on tables

Re: [GENERAL] PHP PDO-bindValue() vs row execute speed difference

2010-11-01 Thread Cédric Villemain
2010/11/1 Georgi Ivanov georgi.r.iva...@gmail.com: Hi, I have following situation: $q = 'select * from tbl1 where id = :id'; $stmt = $dbh-prepare($q); $stmt-bindValue(':id', $id , PDO::PARAM_INT); $stmt-execute(); //1000 ms and $q1 = ' select * from tbl1 where id = 100 '; $stmt =

Re: [GENERAL] async queries in Perl and poll()/select() loop - how to make them work together?

2010-11-01 Thread Andy Colson
On 11/1/2010 4:29 AM, Alexander Farber wrote: Hello, I'm using CentOS 5.5 Linux with stock perl v5.8.8 and have installed DBD-Pg-2.17.1 via CPAN shell and I'm using postgresql-server-8.4.5-1PGDG.rhel5. I've prepared a simple test case demonstrating my problem - it is listed at the bottom. It

Re: [GENERAL] Problem with Crosstab (Concatenate Problem)

2010-11-01 Thread Joe Conway
On 11/01/2010 06:24 AM, Stefan Schwarzer wrote: I need to convert the integer values for the years into column names, i.e. 1965 into y_1965. How do I achieve this then? Try something like: create table foo ( name text, year_start int, value float8); insert into foo

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

2010-11-01 Thread zhong ming wu
I don't recall this being an issue with 8.4 I am also using Say your 8.1 server has SSL on. Even though pg_hba.conf have host or hostnossl md5 either server or 8.1 psql insists that you have .postgresql/postgresql.* Does that make sense to you? Note: no cert in pg_hba.conf

[GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-01 Thread Carlos Mennens
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/0S+ 12:28 0:00 grep postgres [r...@slave ~]# /etc/rc.d/postgresql

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

2010-11-01 Thread Bill Moran
In response to Carlos Mennens carlos.menn...@gmail.com: 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/0S+

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

2010-11-01 Thread Scott Marlowe
On Mon, Nov 1, 2010 at 10:36 AM, Carlos Mennens carlos.menn...@gmail.com 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

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

2010-11-01 Thread Carlos Mennens
On Mon, Nov 1, 2010 at 12:45 PM, Bill Moran wmo...@potentialtech.com wrote: I can't speak for Arch Linux' upgrade setup, but going from 8.4 - 9.0 requires that the data directory either be dumped/recreated, or ran through the new upgrade process (which (as yet) I have no experience with). If

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

2010-11-01 Thread Bill Moran
In response to Carlos Mennens carlos.menn...@gmail.com: On Mon, Nov 1, 2010 at 12:45 PM, Bill Moran wmo...@potentialtech.com wrote: I can't speak for Arch Linux' upgrade setup, but going from 8.4 - 9.0 requires that the data directory either be dumped/recreated, or ran through the new

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

2010-11-01 Thread Richard Broersma
On Mon, Nov 1, 2010 at 9:47 AM, Carlos Mennens carlos.menn...@gmail.com wrote: Sadly I blindly upgraded my database w/o doing a dump / restore so can anyone tell me if I am dead in the water or is there a way I can recover from this error on my part? No, but you'll want to read this document

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

2010-11-01 Thread Richard Broersma
On Mon, Nov 1, 2010 at 9:52 AM, Richard Broersma richard.broer...@gmail.com wrote: On Mon, Nov 1, 2010 at 9:47 AM, Carlos Mennens carlos.menn...@gmail.com wrote: Sadly I blindly upgraded my database w/o doing a dump / restore so can anyone tell me if I am dead in the water or is there a way

Re: [GENERAL] async queries in Perl and poll()/select() loop - how to make them work together?

2010-11-01 Thread Alexander Farber
Hello Andy and others, On Mon, Nov 1, 2010 at 3:33 PM, Andy Colson a...@squeakycode.net wrote: On 11/1/2010 4:29 AM, Alexander Farber wrote: I have a small multiplayer game, a non-forking daemon reading/writing to sockets and running in a IO::Poll loop. I.e. I would like to fire and forget

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

2010-11-01 Thread Carlos Mennens
On Mon, Nov 1, 2010 at 12:52 PM, Richard Broersma richard.broer...@gmail.com wrote: oops: http://www.postgresql.org/docs/9.0/interactive/pgupgrade.html Thanks for the URL. I will try this but I am confused how to proceed? Can I attempt this with PostgreSQL 9.0.1-2 server installed and the data

[GENERAL] Is it safe...( Upgrade questions)

2010-11-01 Thread Jerry LeVan
I am trying to screw up the courage to update my systems ( 2 macs, 2 fedora ) from the last 8.4 postgresql updates to the latest 9.0.1 versions. I have a couple of concerns... 1) I have developed my own gui apps using tcl/tk and wxpython for accessing and maintaining my db's. I use

Re: [GENERAL] async queries in Perl and poll()/select() loop - how to make them work together?

2010-11-01 Thread Andy Colson
On 11/1/2010 11:58 AM, Alexander Farber wrote: Hello Andy and others, On Mon, Nov 1, 2010 at 3:33 PM, Andy Colsona...@squeakycode.net wrote: On 11/1/2010 4:29 AM, Alexander Farber wrote: I have a small multiplayer game, a non-forking daemon reading/writing to sockets and running in a

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

2010-11-01 Thread Scott Marlowe
On Mon, Nov 1, 2010 at 11:06 AM, Carlos Mennens carlos.menn...@gmail.com wrote: On Mon, Nov 1, 2010 at 12:52 PM, Richard Broersma richard.broer...@gmail.com wrote: oops: http://www.postgresql.org/docs/9.0/interactive/pgupgrade.html Thanks for the URL. I will try this but I am confused how to

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

2010-11-01 Thread Carlos Mennens
On Mon, Nov 1, 2010 at 1:32 PM, Scott Marlowe scott.marl...@gmail.com wrote: you would do it with 9.0.x installed, and there should be a program in one of the 9.0 packages that has pg_upgrade in it. So I have my 8.4.4-6 databases backed up. I don't know if I needed the default 'postgres'

[GENERAL] Connection Pool

2010-11-01 Thread Jonathan Tripathy
Hi Everyone, I'm trying to work with connection pools. The example I'm looking at is lockated here: http://www.developer.com/img/2009/11/Listing1_ConnectionPoolClass.html You will notice that the getConnectionFromPool method does not implement any blocking, and only returns null. I would

[GENERAL] JDBC Transactions

2010-11-01 Thread Jonathan Tripathy
Hi Everyone, I'm trying to create a server for a database system which will be used by multiple clients. Of course, table locking is very important. Reading the Postgresql docs, locking occurs on a transaction-by-transaction basis. In our java code, we are doing this: //Start Code Block

[GENERAL] Why so many xlogs?

2010-11-01 Thread hubert depesz lubaczewski
Hi have strange situation - too many xlog files. PostgreSQL 8.3.11 on i386-pc-solaris2.10, compiled by cc -Xa config: # select name, setting from pg_settings where name ~ 'checkpoint|wal' order by 1; name |setting --+---

Re: [GENERAL] Linux x Windows LOCALE/ENCODING compatibility

2010-11-01 Thread Filip Rembiałkowski
2010/11/1 Carlos Henrique Reimer carlos.rei...@opendb.com.br Hi, I currently have my PostgreSQL server running in a windows box and now we're migrating it to a Linux operational system. Current windows configuration: pg_controldata shows the LC_COLLATE and LC_CTYPE are

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

2010-11-01 Thread Bill Moran
In response to Carlos Mennens carlos.menn...@gmail.com: On Mon, Nov 1, 2010 at 1:32 PM, Scott Marlowe scott.marl...@gmail.com wrote: you would do it with 9.0.x installed, and there should be a program in one of the 9.0 packages that has pg_upgrade in it. So I have my 8.4.4-6 databases

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

2010-11-01 Thread Tom Lane
Bill Moran wmo...@potentialtech.com writes: To clarify my earlier comments, if you're going to use pg_upgrade, you probably won't need to downgrade to 8.4. My comments about putting 8.4 back on would have be necessary if you were going to go the old dump/restore route. Note that pg_upgrade

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Jonathan Tripathy
On 01/11/10 18:08, Andy Colson wrote: On 11/1/2010 12:37 PM, Jonathan Tripathy wrote: Hi Everyone, I'm trying to create a server for a database system which will be used by multiple clients. Of course, table locking is very important. Reading the Postgresql docs, locking occurs on a

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Andy Colson
On 11/1/2010 12:37 PM, Jonathan Tripathy wrote: Hi Everyone, I'm trying to create a server for a database system which will be used by multiple clients. Of course, table locking is very important. Reading the Postgresql docs, locking occurs on a transaction-by-transaction basis. In our java

Re: [GENERAL] max_fsm_pages increase

2010-11-01 Thread Vick Khera
On Sun, Oct 31, 2010 at 4:43 AM, AI Rumman rumman...@gmail.com wrote: I using Postgresql 8.1 and during vacuum at night time, I am getting the following log: number of page slots needed (2520048) exceeds max_fsm_pages (356656) Do I need to increase max_fsm_pages to 2520048? Does it have any

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread Filip Rembiałkowski
2010/11/1 hubert depesz lubaczewski dep...@depesz.com: as I understand, max number of xlog files in pg_xlog should be ( 1 + 2 * checkpoint_segments ). why? for a server overloaded with R/W transactions, it's possible to go beyond this. checkpoints just do not keep up. right now I have an 8.3

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

2010-11-01 Thread Carlos Mennens
On Mon, Nov 1, 2010 at 2:00 PM, Bill Moran wmo...@potentialtech.com wrote: To clarify my earlier comments, if you're going to use pg_upgrade, you probably won't need to downgrade to 8.4.  My comments about putting 8.4 back on would have be necessary if you were going to go the old dump/restore

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread Cédric Villemain
2010/11/1 hubert depesz lubaczewski dep...@depesz.com: Hi have strange situation - too many xlog files. PostgreSQL 8.3.11 on i386-pc-solaris2.10, compiled by cc -Xa config: # select name, setting from pg_settings  where name  ~ 'checkpoint|wal' order by 1;             name             |  

Re: [GENERAL] avoiding nested loops when joining on partitioned tables

2010-11-01 Thread Vick Khera
On Sun, Oct 31, 2010 at 6:35 PM, Peter Neal doabackf...@gmail.com wrote: Is there any way I can explain this to postgres? When I query the parent table of the partitions,  SELECT * from A, B where a.id=b.id;, the planner does a sequential scan on A, A1, A2, ... an index scan on B, B1, B2, ...

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Filip Rembiałkowski
2010/11/1 Jonathan Tripathy jon...@abpni.co.uk: On 01/11/10 18:08, Andy Colson wrote: On 11/1/2010 12:37 PM, Jonathan Tripathy wrote: Hi Everyone, I'm trying to create a server for a database system which will be used by multiple clients. Of course, table locking is very important.

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread hubert depesz lubaczewski
On Mon, Nov 01, 2010 at 07:22:50PM +0100, Cédric Villemain wrote: as I understand, max number of xlog files in pg_xlog should be ( 1 + 2 * checkpoint_segments ). (2 + checkpoint_completion_target) * checkpoint_segments + 1 = 291 this is formula gave to me by rhodiumtoad on irc, but we

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread hubert depesz lubaczewski
On Mon, Nov 01, 2010 at 07:18:22PM +0100, Filip Rembiałkowski wrote: 2010/11/1 hubert depesz lubaczewski dep...@depesz.com: as I understand, max number of xlog files in pg_xlog should be ( 1 + 2 * checkpoint_segments ). why? for a server overloaded with R/W transactions, it's possible

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Jonathan Tripathy
Hi Andy, Thanks for your reply. Would the above code be classed as a single transaction then? Yes, assuming there's no explicit transaction control (COMMIT/ROLLBACK/END) in your queries. Actually, we do have maybe one or 2 queries that use ROLLBACK, however ROLLBACK happens at the end of a

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Jonathan Tripathy
On 01/11/10 18:38, Jonathan Tripathy wrote: Hi Andy, Thanks for your reply. Would the above code be classed as a single transaction then? Yes, assuming there's no explicit transaction control (COMMIT/ROLLBACK/END) in your queries. Actually, we do have maybe one or 2 queries that use

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

2010-11-01 Thread Carlos Mennens
On Mon, Nov 1, 2010 at 2:27 PM, Steve Crawford scrawf...@pinpointresearch.com 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 specific as to the path

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Andy Colson
On 11/1/2010 1:38 PM, Jonathan Tripathy wrote: Hi Andy, Thanks for your reply. Would the above code be classed as a single transaction then? Yes, assuming there's no explicit transaction control (COMMIT/ROLLBACK/END) in your queries. Actually, we do have maybe one or 2 queries that use

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Jonathan Tripathy
I'll give you the exact case where I'm worried: We have a table of customers, and each customer can have multiple memberships (which are stored in the memberships table). We want our deleteMembership(int membershipID) method to remove the membership, then check to see if there are no more

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Andy Colson
On 11/1/2010 2:01 PM, Jonathan Tripathy wrote: I'll give you the exact case where I'm worried: We have a table of customers, and each customer can have multiple memberships (which are stored in the memberships table). We want our deleteMembership(int membershipID) method to remove the

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread Cédric Villemain
2010/11/1 hubert depesz lubaczewski dep...@depesz.com: On Mon, Nov 01, 2010 at 07:22:50PM +0100, Cédric Villemain wrote: as I understand, max number of xlog files in pg_xlog should be ( 1 + 2 * checkpoint_segments ). (2 + checkpoint_completion_target) * checkpoint_segments + 1 = 291 this

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread Cédric Villemain
2010/11/1 hubert depesz lubaczewski dep...@depesz.com: On Mon, Nov 01, 2010 at 07:18:22PM +0100, Filip Rembiałkowski wrote: 2010/11/1 hubert depesz lubaczewski dep...@depesz.com: as I understand, max number of xlog files in pg_xlog should be ( 1 + 2 * checkpoint_segments ). why? for a

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

2010-11-01 Thread Adrian Klaver
On 11/01/2010 11:49 AM, Carlos Mennens wrote: On Mon, Nov 1, 2010 at 2:27 PM, Steve Crawford scrawf...@pinpointresearch.com 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

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread hubert depesz lubaczewski
On Mon, Nov 01, 2010 at 08:13:49PM +0100, Cédric Villemain wrote: 2010/11/1 hubert depesz lubaczewski dep...@depesz.com: On Mon, Nov 01, 2010 at 07:22:50PM +0100, Cédric Villemain wrote: as I understand, max number of xlog files in pg_xlog should be ( 1 + 2 * checkpoint_segments ). (2 +

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread hubert depesz lubaczewski
On Mon, Nov 01, 2010 at 08:18:24PM +0100, Cédric Villemain wrote: 2010/11/1 hubert depesz lubaczewski dep...@depesz.com: On Mon, Nov 01, 2010 at 07:18:22PM +0100, Filip Rembiałkowski wrote: 2010/11/1 hubert depesz lubaczewski dep...@depesz.com: as I understand, max number of xlog files

[GENERAL] Installing postgis-pg90-setup-1.5.2-3 on windows after installing postgresql-9.0.1-1-windows_x64 errors off

2010-11-01 Thread John Mitchell
Hi, Installing postgis-pg90-setup-1.5.2-3 on windows after installing postgresql-9.0.1-1-windows_x64 errors off (see below error). I believe that postgres is a 64 bit application and postgis is a 32 bit application so I don't know if that is the reason why it errors off. *psql:C:/Program

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Jonathan Tripathy
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 I'm worried: We have a table of customers, and each customer can have multiple memberships (which are stored in the memberships table). We want our deleteMembership(int

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread Cédric Villemain
2010/11/1 hubert depesz lubaczewski dep...@depesz.com: On Mon, Nov 01, 2010 at 08:13:49PM +0100, Cédric Villemain wrote: 2010/11/1 hubert depesz lubaczewski dep...@depesz.com: On Mon, Nov 01, 2010 at 07:22:50PM +0100, Cédric Villemain wrote: as I understand, max number of xlog files in

[GENERAL] A few [Python] tools for postgres

2010-11-01 Thread Matt Harrison
Hey Folks- I've got 2 projects out that I'm finding useful, so I thought I'd share with the wider postgres community. The first is PgPartition [0]. This (python) tool eliminates the monotony of dealing with partitions. It generates SQL to create/index/remove/alter partitions. The second is

[GENERAL] Replication

2010-11-01 Thread Jonathan Tripathy
Hi Everyone, I'm looking for the best solution for Hot Standbys where once the primary server fails, the standby will take over and act just like the master did. The standby must support INSERTS and UPDATES as well (once the master has failed) Are there any solutions like this? Looking on

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread hubert depesz lubaczewski
On Mon, Nov 01, 2010 at 08:31:10PM +0100, Cédric Villemain wrote: It should stick at a maximum of 3 * checkpoint_segments + 1, if it exceed it will remove the extra files after. if you'd look at the graph you'd notice that it never goes down to 2n+1. And really - so far I have not yet

Re: [GENERAL] Replication

2010-11-01 Thread Thomas Kellerer
Jonathan Tripathy wrote on 01.11.2010 20:53: Hi Everyone, I'm looking for the best solution for Hot Standbys where once the primary server fails, the standby will take over and act just like the master did. The standby must support INSERTS and UPDATES as well (once the master has failed) Are

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Jonathan Tripathy
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 I'm worried: We have a table of customers, and each customer can have multiple

Re: [GENERAL] Why so many xlogs?

2010-11-01 Thread Jehan-Guillaume (ioguix) de Rorthais
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Le 01/11/2010 20:54, hubert depesz lubaczewski a écrit : On Mon, Nov 01, 2010 at 08:31:10PM +0100, Cédric Villemain wrote: It should stick at a maximum of 3 * checkpoint_segments + 1, if it exceed it will remove the extra files after. if you'd

Re: [GENERAL] Replication

2010-11-01 Thread Jonathan Tripathy
On 01/11/10 20:01, Thomas Kellerer wrote: Jonathan Tripathy wrote on 01.11.2010 20:53: Hi Everyone, I'm looking for the best solution for Hot Standbys where once the primary server fails, the standby will take over and act just like the master did. The standby must support INSERTS and UPDATES

Re: [GENERAL] Temporary schemas

2010-11-01 Thread Merlin Moncure
On Mon, Nov 1, 2010 at 6:46 AM, Thomas Kellerer spam_ea...@gmx.net wrote: Hello, I have created a temporary table using create temporary table foo (  id integer ); and noticed this was created in a schema called pg_temp_2 My question is: is this always pg_temp_2? Or will the name of

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

2010-11-01 Thread Kevin Field
Hi everyone, I'm having a strange issue on PostgreSQL 9.0.1 on Windows Server 2003 SP2. I connect as a superuser and then SET SESSION AUTHORIZATION to user X who is a member of group role extranet_user which inherits membership from group role user. X, extranet_user, and even user are all

Re: [GENERAL] Replication

2010-11-01 Thread Scott Marlowe
On Mon, Nov 1, 2010 at 2:12 PM, Jonathan Tripathy jon...@abpni.co.uk wrote: On 01/11/10 20:01, Thomas Kellerer wrote: Jonathan Tripathy wrote on 01.11.2010 20:53: Hi Everyone, I'm looking for the best solution for Hot Standbys where once the primary server fails, the standby will take

Re: [GENERAL] async queries in Perl and poll()/select() loop - how to make them work together?

2010-11-01 Thread Merlin Moncure
On Mon, Nov 1, 2010 at 1:31 PM, Andy Colson a...@squeakycode.net wrote: I dont think you can start a second query until you have called $dbh-pg_result.  These constants just give you neat ways of waiting... its still just one at a time. Correct. The C api also supports the ability to test if

Re: [GENERAL] Replication

2010-11-01 Thread Thomas Kellerer
Jonathan Tripathy wrote on 01.11.2010 21:12: 9.0 has streaming replication and Hot Standby http://www.postgresql.org/docs/current/static/hot-standby.html http://www.postgresql.org/docs/current/static/warm-standby.html#STREAMING-REPLICATION But does that not only allow read-only things to

Re: [GENERAL] Replication

2010-11-01 Thread Jonathan Tripathy
On 01/11/10 20:21, Scott Marlowe wrote: On Mon, Nov 1, 2010 at 2:12 PM, Jonathan Tripathyjon...@abpni.co.uk wrote: On 01/11/10 20:01, Thomas Kellerer wrote: Jonathan Tripathy wrote on 01.11.2010 20:53: Hi Everyone, I'm looking for the best solution for Hot Standbys where once the primary

Re: [GENERAL] Replication

2010-11-01 Thread Jonathan Tripathy
On 01/11/10 20:26, Thomas Kellerer wrote: Jonathan Tripathy wrote on 01.11.2010 21:12: 9.0 has streaming replication and Hot Standby http://www.postgresql.org/docs/current/static/hot-standby.html http://www.postgresql.org/docs/current/static/warm-standby.html#STREAMING-REPLICATION But

Re: [GENERAL] Temporary schemas

2010-11-01 Thread Thomas Kellerer
Merlin Moncure wrote on 01.11.2010 21:13: On Mon, Nov 1, 2010 at 6:46 AM, Thomas Kellererspam_ea...@gmx.net wrote: Hello, I have created a temporary table using create temporary table foo ( id integer ); and noticed this was created in a schema called pg_temp_2 My question is: is this

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

2010-11-01 Thread Tom Lane
Kevin Field kevinjamesfi...@gmail.com writes: Strange, no? Anybody have any ideas why this might be? Worksforme: regression=# create group user; CREATE ROLE regression=# create group extranet_user in group user; CREATE ROLE regression=# create user x in group extranet_user; CREATE ROLE

[GENERAL] FTS phrase searches

2010-11-01 Thread Glenn Maynard
How are adjacent word searches handled with FTS? tsquery doesn't do this, so I assume this has to be done as a separate filter step, eg.: # large house sales SELECT * FROM data WHERE fts @@ to_tsquery('large house sales') AND tsvector_contains_phrase(fts, to_tsvector('large house'))); to

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Andy Colson
On 11/1/2010 3:02 PM, 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 I'm worried: We have a table of

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

2010-11-01 Thread Ray Stell
On Mon, Nov 01, 2010 at 11:54:25AM -0400, zhong ming wu wrote: I don't recall this being an issue with 8.4 I am also using Say your 8.1 server has SSL on. Even though pg_hba.conf have host or hostnossl md5 either server or 8.1 psql insists that you have .postgresql/postgresql.*

Re: [GENERAL] Replication

2010-11-01 Thread Vick Khera
On Mon, Nov 1, 2010 at 3:53 PM, Jonathan Tripathy jon...@abpni.co.uk wrote: The standby must support INSERTS and UPDATES as well (once the master has failed) Are there any solutions like this? Looking on the Postgresql site, all the standby solutions seem to be read only.. If they are RO it

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

2010-11-01 Thread Kevin Field
On Nov 1, 4:39 pm, t...@sss.pgh.pa.us (Tom Lane) wrote: Kevin Field kevinjamesfi...@gmail.com writes: Strange, no?  Anybody have any ideas why this might be? Worksforme: regression=# create group user; CREATE ROLE regression=# create group extranet_user in group user; CREATE ROLE

Re: [GENERAL] Temporary schemas

2010-11-01 Thread Merlin Moncure
On Mon, Nov 1, 2010 at 4:27 PM, Thomas Kellerer spam_ea...@gmx.net wrote: The problem is, that the JDBC driver only returns information about the temp tables, if I specify that schema directly. Have you filed a bug report to jdbc yet? :-D. merlin -- Sent via pgsql-general mailing list

[GENERAL] select problem

2010-11-01 Thread Adrian Johnson
Dear group: I have a table structure like following: city: city_blockage_from age_to name SF 10 20grade1 SF 21 30grade1 SF 35 40grade1 SF 53 19grade2 SF 100 153 grade2

Re: [GENERAL] Temporary schemas

2010-11-01 Thread Rob Sargent
On 11/01/2010 04:13 PM, Merlin Moncure wrote: On Mon, Nov 1, 2010 at 4:27 PM, Thomas Kellerer spam_ea...@gmx.net wrote: The problem is, that the JDBC driver only returns information about the temp tables, if I specify that schema directly. Have you filed a bug report to jdbc yet? :-D.

Re: [GENERAL] Temporary schemas

2010-11-01 Thread Thomas Kellerer
Merlin Moncure wrote on 01.11.2010 23:13: On Mon, Nov 1, 2010 at 4:27 PM, Thomas Kellererspam_ea...@gmx.net wrote: The problem is, that the JDBC driver only returns information about the temp tables, if I specify that schema directly. Have you filed a bug report to jdbc yet? :-D. I thought

Re: [GENERAL] Replication

2010-11-01 Thread Jonathan Tripathy
On 01/11/10 21:10, Vick Khera wrote: On Mon, Nov 1, 2010 at 3:53 PM, Jonathan Tripathyjon...@abpni.co.uk wrote: The standby must support INSERTS and UPDATES as well (once the master has failed) Are there any solutions like this? Looking on the Postgresql site, all the standby solutions seem

Re: [GENERAL] JDBC Transactions

2010-11-01 Thread Tom Lane
Andy Colson a...@squeakycode.net writes: now now we have a membership record (100), but no customer record. I haven't really been following this thread, but: isn't the answer to that to establish a foreign-key constraint? If there's an FK then the database will provide sufficient row locking to

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

2010-11-01 Thread Tom Lane
Kevin Field kevinjamesfi...@gmail.com writes: My guess is that it has something to do with the join to the table 'mandate'. I was wondering about that too, but the error message is pretty clear about which table it's complaining about. Please see if you can put together a self-contained

Re: [GENERAL] Replication

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

Re: [GENERAL] select problem

2010-11-01 Thread zab08
(SELECT * from mydata,city WHERE mydata.sample = 1 AND mydata.age_from = city.age_from AND mydata.age_to = city.age_to AND basen not in ('A', 'T', 'G','C')) INTERSECT (SELECT * from mydata,city WHERE mydata.sample = 2 AND mydata.age_from = city.age_from AND mydata.age_to = city.age_to AND basen