[GENERAL] What type of index should I use?

2010-06-21 Thread Mike Christensen
I have a varying(200) text column that I need to be able to do lookups on very fast (WHERE col = 'foo') - The data in this table will pretty much never change (when it does I have to restart the entire server, so updates of any sort are extremely rare). I estimate the table will hold around 5,000

Re: [GENERAL] Inserting additional data into pg_statistics

2010-06-21 Thread Teodor Macicas
--- Hi Tom, Modifying the pg_statistics is not a good idea for most practical purposes. The modification, however, becomes a necessity to implement automatic physical design techniques. We are developing an automatic physical designer for Postgres. The designer will add features that most

[GENERAL] pgpool

2010-06-21 Thread Geoffrey
So, I've got it installed, and tweaked the configuration, but I simply can not figure out how to connect to my databases via pgpool. Is this simply transparent? I don't see how. So I have a postmaster running on port 5434, how do I connect to that database via pgpool? I simply can not find

Re: [GENERAL] pgpool

2010-06-21 Thread Gerd Koenig
Hi Geoffrey, you do not need to connect to your database directly, just connect to pgpool itself. e.g.: your database runs on port 5434, pgpool runs on port 5432 = * pgpool has to be configured in that way that it connects to the database on port 5434 * you/your app's should connect to the

[GENERAL] disable password prompt - command line

2010-06-21 Thread Ravi Katkar
Hi List, I need a small help regarding the password options available with PGSQL, I found POSTGRE SQL has -W and -password options available which is prompting for the password. But I want to take the password thru command line argument and keep the password in a variable. Is there any option

Re: [GENERAL] disable password prompt - command line

2010-06-21 Thread A. Kretschmer
In response to Ravi Katkar : Hi List, I need a small help regarding the password options available with PGSQL, I found POSTGRE SQL has ?W and ?password options available which is prompting for the password. But I want to take the password thru command line argument and keep the

Re: [GENERAL] Inserting additional data into pg_statistics

2010-06-21 Thread Cédric Villemain
2010/6/21 Teodor Macicas teodor.maci...@epfl.ch: --- Hi Tom,         Modifying the pg_statistics is not a good idea for most practical purposes. The modification, however, becomes a necessity to implement automatic physical design techniques. We are developing an automatic physical designer

Re: [GENERAL] pgpool

2010-06-21 Thread Geoffrey
Gerd Koenig wrote: Hi Geoffrey, you do not need to connect to your database directly, just connect to pgpool itself. e.g.: your database runs on port 5434, pgpool runs on port 5432 = * pgpool has to be configured in that way that it connects to the database on port 5434 * you/your app's

Re: [GENERAL] pgpool

2010-06-21 Thread Geoffrey
Gerd Koenig wrote: Hi Geoffrey, you do not need to connect to your database directly, just connect to pgpool itself. e.g.: your database runs on port 5434, pgpool runs on port 5432 = * pgpool has to be configured in that way that it connects to the database on port 5434 What parameter in

Re: [GENERAL] pgpool

2010-06-21 Thread Geoffrey
Geoffrey wrote: Gerd Koenig wrote: Hi Geoffrey, you do not need to connect to your database directly, just connect to pgpool itself. e.g.: your database runs on port 5434, pgpool runs on port 5432 = * pgpool has to be configured in that way that it connects to the database on port 5434

Re: [GENERAL] pgpool

2010-06-21 Thread Geoffrey
So I've got the following: port = . . backend_hostname0 = 'localhost' backend_port0 = 5434 backend_weight0 = 1 backend_data_directory0 = '/data/pgsql/master' backend_hostname1 = 'localhost' backend_port1 = 5435 backend_weight1 = 1 backend_data_directory1 = '/data/pgsql/mwv' In my

Re: [GENERAL] Inserting additional data into pg_statistics

2010-06-21 Thread Tom Lane
Teodor Macicas teodor.maci...@epfl.ch writes: Modifying the pg_statistics is not a good idea for most practical purposes. That's what I've been telling you. We want to extend the system by doing the physical design outside the production database, and hence need to replicate the

Re: [GENERAL] Inserting additional data into pg_statistics

2010-06-21 Thread Adrian Klaver
On Monday 21 June 2010 7:23:06 am Tom Lane wrote: Teodor Macicas teodor.maci...@epfl.ch writes: Modifying the pg_statistics is not a good idea for most practical purposes. That's what I've been telling you. We want to extend the system by doing the physical design outside the

Re: [GENERAL] pgpool

2010-06-21 Thread Guillaume Lelarge
Le 21/06/2010 15:52, Geoffrey a écrit : So I've got the following: port = . . backend_hostname0 = 'localhost' backend_port0 = 5434 backend_weight0 = 1 backend_data_directory0 = '/data/pgsql/master' backend_hostname1 = 'localhost' backend_port1 = 5435 backend_weight1 = 1

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread Lew
Sim Zacks wrote: database agnostic code is theoretically a great idea. However, you lose most of the advantages of the chosen database engine. For example, if you support an engine that does not support relational integrity you cannot use delete cascades. The most efficient way is to have a

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread Lew
David Goodenough wrote: I don't support anyone has written a how to write database agnostic code guide? That way its not a matter of porting, more a matter of starting off right. There is no real way to write database[-]agnostic SQL, although of course middleware code can and should be.

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread David Goodenough
On Monday 21 June 2010, Lew wrote: Sim Zacks wrote: database agnostic code is theoretically a great idea. However, you lose most of the advantages of the chosen database engine. For example, if you support an engine that does not support relational integrity you cannot use delete

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread David Fetter
On Mon, Jun 21, 2010 at 08:35:02AM -0400, Lew wrote: David Goodenough wrote: I don't support anyone has written a how to write database agnostic code guide? That way its not a matter of porting, more a matter of starting off right. There is no real way to write database[-]agnostic SQL,

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread Martin Gainty
then you want your code to call stub functions (with DBSpecific stack parameters) Insert Update Delete(-with-cascade) Select I ran into a problem recently where i wanted to LOCK table MySQL which of course is a no-op in MySQL so I carried the driver string as a stack param e.g. public

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread David Fetter
On Mon, Jun 21, 2010 at 04:14:10PM +0100, David Goodenough wrote: On Monday 21 June 2010, Lew wrote: Sim Zacks wrote: database agnostic code is theoretically a great idea. However, you lose most of the advantages of the chosen database engine. For example, if you support an engine

Re: [GENERAL] pgpool

2010-06-21 Thread Geoffrey
Guillaume Lelarge wrote: Le 21/06/2010 15:52, Geoffrey a écrit : So I've got the following: port = . . backend_hostname0 = 'localhost' backend_port0 = 5434 backend_weight0 = 1 backend_data_directory0 = '/data/pgsql/master' backend_hostname1 = 'localhost' backend_port1 = 5435

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread Scott Marlowe
As with phrases like, the quickest way to grill a unicorn steak, that it can be stated in a few words does not make in possible. Exactly. The big issue here is that nobody's saying what kind of app they want to write. If it's a simple web content management system, the possibility of having

Re: [GENERAL] Optimizer: ranges and partial indices? Or use partitioning?

2010-06-21 Thread Davor J.
I have the same table as yours with potential to grow over 50 billion of records once operational. But our hardware is currently very limited (8GB RAM). I concur with Tom Lane about the fact that partial indexes aren't really an option, but what about partitioning? I read from the Postgres

Re: [GENERAL] pgpool

2010-06-21 Thread Geoffrey
Guillaume Lelarge wrote: If you want to be able to connect on various databases from various servers, pgBouncer is what you're looking for. It does not appear that pgbouncer will 'limit exceeding connections' as does pgpool. So if I have a pool of 20 connections and 20 connections are

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread Brad Nicholson
Scott Marlowe wrote: As with phrases like, the quickest way to grill a unicorn steak, that it can be stated in a few words does not make in possible. Exactly. The big issue here is that nobody's saying what kind of app they want to write. Or what sort of performance requirements are

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread David Fetter
On Mon, Jun 21, 2010 at 01:55:36PM -0400, Brad Nicholson wrote: Scott Marlowe wrote: As with phrases like, the quickest way to grill a unicorn steak, that it can be stated in a few words does not make in possible. Exactly. The big issue here is that nobody's saying what kind of app they

Re: [GENERAL] pgpool

2010-06-21 Thread John R Pierce
On 06/21/10 5:37 AM, Geoffrey wrote: So I've got 13 different databases on 13 different postmasters, now does pgpool know which databases I'm trying to connect to? you would need 13 different connection pools. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

[GENERAL] How to force select to return exactly one row

2010-06-21 Thread Andrus
Autogenerated select statement contains 0 .. n left joins: SELECT somecolumns FROM ko LEFT JOIN t1 ON t1.primarykey= ko.t1foreignkwey ... LEFT JOIN tn ON tn.primarykey= ko.tnforeignkwey WHERE ko.primarykey='someprimarykeyvalue'; This select can return only 0 or 1 rows depending if ko row with

Re: [GENERAL] How to force select to return exactly one row

2010-06-21 Thread Martin
Try wrapping the entire statement in a COALESCE((statement), DEFAULT_VALUE); -m 2010/6/21 Andrus kobrule...@hot.ee Autogenerated select statement contains 0 .. n left joins: SELECT somecolumns FROM ko LEFT JOIN t1 ON t1.primarykey= ko.t1foreignkwey ... LEFT JOIN tn ON tn.primarykey=

Re: [GENERAL] High Availability with Postgres

2010-06-21 Thread Dimitri Fontaine
John R Pierce pie...@hogranch.com writes: Two DB servers will be using a common external storage (with raid). This is also one of the only postgres HA configurations that won't lose /any/ committed transactions on a failure. Most all PITR/WAL replication/Slony/etc configs, the standby

Re: [GENERAL] How to force select to return exactly one row

2010-06-21 Thread Andrus
Martin, Thank you. SELECT statement returns lot of columns. I tried select coalesce( (select 1,2 ), null); but got ERROR: subquery must return only one column How to use your suggestion if select returns lot of columns ? Andrus. - Original Message - From: Martin To:

Re: [GENERAL] High Availability with Postgres

2010-06-21 Thread John R Pierce
On 06/21/10 12:23 PM, Dimitri Fontaine wrote: John R Piercepie...@hogranch.com writes: Two DB servers will be using a common external storage (with raid). This is also one of the only postgres HA configurations that won't lose /any/ committed transactions on a failure. Most all

Re: [GENERAL] pgpool

2010-06-21 Thread Geoffrey
John R Pierce wrote: On 06/21/10 5:37 AM, Geoffrey wrote: So I've got 13 different databases on 13 different postmasters, now does pgpool know which databases I'm trying to connect to? you would need 13 different connection pools. Can this be done? -- Until later, Geoffrey I predict

Re: [GENERAL] pgpool

2010-06-21 Thread Scott Marlowe
On Mon, Jun 21, 2010 at 1:45 PM, Geoffrey li...@serioustechnology.com wrote: John R Pierce wrote: On 06/21/10 5:37 AM, Geoffrey wrote: So I've got 13 different databases on 13 different postmasters, now does pgpool know which databases I'm trying to connect to? you would need 13 different

Re: [GENERAL] pgpool

2010-06-21 Thread Geoffrey
Scott Marlowe wrote: On Mon, Jun 21, 2010 at 1:45 PM, Geoffrey li...@serioustechnology.com wrote: John R Pierce wrote: On 06/21/10 5:37 AM, Geoffrey wrote: So I've got 13 different databases on 13 different postmasters, now does pgpool know which databases I'm trying to connect to? you would

Re: [GENERAL] How to force select to return exactly one row

2010-06-21 Thread Tim Landscheidt
Andrus kobrule...@hot.ee wrote: Autogenerated select statement contains 0 .. n left joins: SELECT somecolumns FROM ko LEFT JOIN t1 ON t1.primarykey= ko.t1foreignkwey ... LEFT JOIN tn ON tn.primarykey= ko.tnforeignkwey WHERE ko.primarykey='someprimarykeyvalue'; This select can return

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread Ivan Sergio Borgonovo
On Mon, 21 Jun 2010 11:27:20 -0700 David Fetter da...@fetter.org wrote: On Mon, Jun 21, 2010 at 01:55:36PM -0400, Brad Nicholson wrote: Scott Marlowe wrote: As with phrases like, the quickest way to grill a unicorn steak, that it can be stated in a few words does not make in possible.

Re: [GENERAL] How to force select to return exactly one row

2010-06-21 Thread Martin
Ah yes sorry I missed the multi-columns. My way doesn't work for that. If Tim's suggestion doesn't work for you, you could try a union... it's fairly nasty and you will always have your fake row in the result. Also I too am confused by empty row. Are you trying to loop through the results in code

Re: [GENERAL] pgpool

2010-06-21 Thread Scott Marlowe
On Mon, Jun 21, 2010 at 2:42 PM, Geoffrey li...@serioustechnology.com wrote: Scott Marlowe wrote: On Mon, Jun 21, 2010 at 1:45 PM, Geoffrey li...@serioustechnology.com wrote: John R Pierce wrote: On 06/21/10 5:37 AM, Geoffrey wrote: So I've got 13 different databases on 13 different

Re: [GENERAL] pgpool

2010-06-21 Thread Geoffrey
Scott Marlowe wrote: On Mon, Jun 21, 2010 at 2:42 PM, Geoffrey li...@serioustechnology.com wrote: Scott Marlowe wrote: On Mon, Jun 21, 2010 at 1:45 PM, Geoffrey li...@serioustechnology.com wrote: John R Pierce wrote: On 06/21/10 5:37 AM, Geoffrey wrote: So I've got 13 different databases on

Re: [GENERAL] How to force select to return exactly one row

2010-06-21 Thread Brent Wood
Use a case staement to test for a null output, return whatever you want in the event of it being null, else the actual value: from the top of my head, something like: SELECT case when (select somecolumns FROM ko RIGHT JOIN (SELECT 1) _forceonerow ON true LEFT JOIN t1 ON t1.primarykey=

Re: [GENERAL] How to force select to return exactly one row

2010-06-21 Thread Brett Mc Bride
How about: SELECT * from ( SELECT somecolumns FROM ko LEFT JOIN t1 ON t1.primarykey= ko.t1foreignkwey ... LEFT JOIN tn ON tn.primarykey= ko.tnforeignkwey WHERE ko.primarykey='someprimarykeyvalue' UNION ALL SELECT default_value ) LIMIT 1; -Original Message- From:

Re: [GENERAL] How to force select to return exactly one row

2010-06-21 Thread Tim Landscheidt
Brett Mc Bride brett.mcbr...@deakin.edu.au wrote: How about: SELECT * from ( SELECT somecolumns FROM ko LEFT JOIN t1 ON t1.primarykey= ko.t1foreignkwey ... LEFT JOIN tn ON tn.primarykey= ko.tnforeignkwey WHERE ko.primarykey='someprimarykeyvalue' UNION ALL SELECT default_value ) LIMIT

Re: [GENERAL] How to force select to return exactly one row

2010-06-21 Thread Brett Mc Bride
My understanding of UNION ALL is that it won't sort the rows...? -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Tim Landscheidt Sent: Tuesday, 22 June 2010 9:41 AM To: pgsql-general@postgresql.org Subject: Re:

Re: [GENERAL] How to force select to return exactly one row

2010-06-21 Thread Tim Landscheidt
Brett Mc Bride brett.mcbr...@deakin.edu.au wrote: My understanding of UNION ALL is that it won't sort the rows...? [...] It doesn't, but that's not promised for every data set, ev- ery PostgreSQL version, every phase of the moon. To quote

[GENERAL] Trying to install ODBC driver on Windows XP notebook

2010-06-21 Thread Phil Jackson
I have latest Postgresql installed on a notebook and now trying to install the driver which I have downloaded and run so that it is now available in the ODBC Data Source Administrator This machine has CA security suite, latest version installed and I have added a network rule that allows all

Re: [GENERAL] Trying to install ODBC driver on Windows XP notebook

2010-06-21 Thread Dann Corbit
Assuming a TCP/IP connection, does the server machine know about your tcp/ip address in pg_hba.conf? Otherwise, what kind of connection protocol are you using? I promise, no Lakers jokes. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-

Re: [GENERAL] Unable to determine what has a particular OID

2010-06-21 Thread Greg Smith
Tom Lane wrote: Doing pg_dump would expose the mistake if you'd removed an actual table's files. But I'm not sure it would expose it if you removed an index ... Right, but in theory if you screwed up and accidentally deleted a file holding an index, you could recover from that in the

[GENERAL] Problem Using RowType Declaration with Table Domains

2010-06-21 Thread George Weaver
Hi all, I have the following (very simplified) scenario: CREATE DOMAIN orderstatus AS text NOT NULL DEFAULT 'Open'; ALTER DOMAIN orderstatus ADD CONSTRAINT orderstatus_valid CHECK (VALUE IN ('Open', 'Shipped', Cancelled')); CREATE TABLE orders ( orderno serial

Re: [GENERAL] High Availability with Postgres

2010-06-21 Thread Greg Smith
John R Pierce wrote: the commercial cluster software vendors insist on using dedicated connections for the heartbeat messages between the cluster members and insist on having fencing capabilities (for instance, disabling the fiber switch port of the formerly active server and enabling the port

[GENERAL] No PL/PHP ? Any reason?

2010-06-21 Thread Carlo Stonebanks
Is there any technical obstacle to anyone creating PL/PHP? I am cruious as to why it doesn't alreay exist. I mean, I love my Tcl support, and I know this is part of PG's legacy... but Tcl and no PHP? I figure there's a tech reason for this - the demand must be there! No? -- Sent via

Re: [GENERAL] No PL/PHP ? Any reason?

2010-06-21 Thread Shoaib Mir
On Tue, Jun 22, 2010 at 1:28 PM, Carlo Stonebanks stonec.regis...@sympatico.ca wrote: Is there any technical obstacle to anyone creating PL/PHP? I am cruious as to why it doesn't alreay exist. I mean, I love my Tcl support, and I know this is part of PG's legacy... but Tcl and no PHP? I

Re: [GENERAL] No PL/PHP ? Any reason?

2010-06-21 Thread Scott Marlowe
On Mon, Jun 21, 2010 at 9:55 PM, Devrim GUNDUZ dev...@gunduz.org wrote: 22.Haz.2010 tarihinde 06:43 saatinde, Shoaib Mir shoaib...@gmail.com şunları yazdı: On Tue, Jun 22, 2010 at 1:28 PM, Carlo Stonebanks stonec.regis...@sympatico.ca wrote: Is there any technical obstacle to anyone

Re: [GENERAL] High Availability with Postgres

2010-06-21 Thread John R Pierce
On 06/21/10 8:08 PM, Greg Smith wrote: The hard part of shared storage failover is always solving the shoot the other node in the head problem, to keep a down node from coming back once it's no longer the active one. In order to do that well, you really need to lock the now unavailable node