Re: [SQL] Help with optional parameters

2006-08-16 Thread Michael Fuhr
On Wed, Aug 16, 2006 at 08:39:49PM -0700, Rob Tester wrote: > What is the best way to write a query and get the planner to use indexes > when you have optional parameters and columns that can contain NULL values? Have you considered building a query string and using EXECUTE? That's not as "neat" a

[SQL] Help with optional parameters

2006-08-16 Thread Rob Tester
I have the need to have optional values for a query in a stored procedure that I am building. (using postgres 8.1.4). This particular query executes against a huge table (several million rows) and has six optional parameters that can be sent to the function. If one of the parameters is null then th

Re: [SQL] Using bitmap index scans-more efficient

2006-08-16 Thread Tom Lane
Kyle Bateman <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Before 8.2 the optimizer has no ability to rearrange the order of outer >> joins. Do you have time to try your test case against CVS HEAD? > OK, I figured it out--grabbed the latest snapshot (hope that is what you > need). > My result

Re: [SQL] Using bitmap index scans-more efficient

2006-08-16 Thread Kyle Bateman
Tom Lane wrote: Kyle Bateman <[EMAIL PROTECTED]> writes: I'm wondering if this might expose a weakness in the optimizer having to do with left joins. Before 8.2 the optimizer has no ability to rearrange the order of outer joins. Do you have time to try your test case against CVS HEAD

Re: [SQL] OT: OpenDatabase Model ?

2006-08-16 Thread Jesper K. Pedersen
Andrew Sullivan wrote: On Wed, Aug 16, 2006 at 06:12:06PM +0200, Jesper K. Pedersen wrote: Doing a bit of database work for several friends (golf clubs and so on) I was very keen to start using a sort of "standard" and not least open database model with predefined tables. If I unders

Re: [SQL] DB creation script questions

2006-08-16 Thread Andrew Sullivan
On Wed, Aug 16, 2006 at 02:44:58PM -0400, Jon Horsman wrote: > I have previously used MySQL and was able to accomplish this very > simply using IF NOT EXISTS for the table and database creation but > this doesn't seem to be available for postgres and i'm looking for a > more robust solution anyways

Re: [SQL] OT: OpenDatabase Model ?

2006-08-16 Thread Andrew Sullivan
On Wed, Aug 16, 2006 at 06:12:06PM +0200, Jesper K. Pedersen wrote: > > Doing a bit of database work for several friends (golf clubs and so on) > I was very keen to start using a sort of "standard" and not least open > database model with predefined tables. If I understand your question correct

[SQL] OT: OpenDatabase Model ?

2006-08-16 Thread Jesper K. Pedersen
Doing a bit of database work for several friends (golf clubs and so on) I was very keen to start using a sort of "standard" and not least open database model with predefined tables. Up to now I have been writing and defining the tables by hand but I can see an advantage in using a "standard".

[SQL] DB creation script questions

2006-08-16 Thread Jon Horsman
Hey All, I'm new to postgres and am wondering what the recommended way of creating an automated db creation script is. I've reading the postgres 8.1 manual but haven't seen much on this and google doesn't seem to be bringing up much either. I need to create a script that will create a database

Re: [SQL] Undo an update

2006-08-16 Thread Rodrigo De León
On 8/16/06, Markus Schaber <[EMAIL PROTECTED]> wrote: Hi, Kis, Kis János Tamás wrote: > So, if you send every insert, update, delete command to a > logger-table, then you can to undo anything. But this is just re-inventing the wheel, we already have Point-in-Time recovery. Or do I miss someth

Re: [SQL] Using bitmap index scans-more efficient

2006-08-16 Thread Tom Lane
Kyle Bateman <[EMAIL PROTECTED]> writes: > I'm wondering if this might expose a weakness in the optimizer having to > do with left joins. Before 8.2 the optimizer has no ability to rearrange the order of outer joins. Do you have time to try your test case against CVS HEAD?

Re: [SQL] problem with sequence.....

2006-08-16 Thread Andrew Sullivan
On Wed, Aug 16, 2006 at 05:01:09PM +0530, Penchalaiah P. wrote: > If again I pass correct values to that function that values can see in > view data with increment value of sequence > > > Any one can tell me how to stop that sequence value when ever I was > passing wrong values to that function..

[SQL] problem with sequence.....

2006-08-16 Thread Penchalaiah P.
Hi good evening every one………   I have a problem with sequence ..   I created one sequence with the name of famaseq.. I am using this sequence in my function.. This is the function   Create or replace function getFamanewcase1(in_cda_no varchar,in_dak_id varchar,in_name_of_beneficia

Re: [SQL] Undo an update

2006-08-16 Thread Markus Schaber
Hi, Kis, Kis János Tamás wrote: > So, if you send every insert, update, delete command to a > logger-table, then you can to undo anything. But this is just re-inventing the wheel, we already have Point-in-Time recovery. Or do I miss something? Markus -- Markus Schaber | Logical Tracking&T