Re: [SQL] How do I convice postgres to use an index?

2004-07-15 Thread SZUCS Gábor
Try casting the constant to the type of the field, i.e. WHERE timestamp >= '7/12/2004'::"timestamp without time zone" (iirc the quotes are necessary) Also, I'd try to avoid naming attributes like (built-in) types. (iirc "timestamp" is a type without time zone in 7.3, and with time zone in 7.4

Re: [SQL] How do I convice postgres to use an index?

2004-07-15 Thread Achilleus Mantzios
O kyrios SZUCS Gαbor egrapse stis Jul 15, 2004 : > Try casting the constant to the type of the field, i.e. > > WHERE timestamp >= '7/12/2004'::"timestamp without time zone" > > (iirc the quotes are necessary) > > Also, I'd try to avoid naming attributes like (built-in) types. (iirc > "timesta

[SQL] 'UPDATE OR INSERT' command

2004-07-15 Thread Jeff Kowalczyk
Is there a postgresql SQL idiom to perform an UPDATE, which becomes an INSERT if the primary key does not exist? I'm not sure I *should* use it in my application, I just want to know if it can be done. Thanks. ---(end of broadcast)--- TIP 2: you ca

Re: [SQL] 'UPDATE OR INSERT' command

2004-07-15 Thread Bruno Wolff III
On Thu, Jul 15, 2004 at 13:20:57 -0500, Jeff Kowalczyk <[EMAIL PROTECTED]> wrote: > Is there a postgresql SQL idiom to perform an UPDATE, which becomes an > INSERT if the primary key does not exist? > > I'm not sure I *should* use it in my application, I just want to know if > it can be done. Th

Re: [SQL] 'UPDATE OR INSERT' command

2004-07-15 Thread Stephen Frost
* Jeff Kowalczyk ([EMAIL PROTECTED]) wrote: > Is there a postgresql SQL idiom to perform an UPDATE, which becomes an > INSERT if the primary key does not exist? > > I'm not sure I *should* use it in my application, I just want to know if > it can be done. Thanks. Unfortunately, I don't believe th