Re: Dont let those int8's drive you mad!!

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Jeff Amiel <jamiel(at)istreamimaging(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Dont let those int8's drive you mad!!
Date: 2004-12-04 00:07:14
Message-ID: 41B0FFB2.8020003@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>
> update transactions set state='O' where trans_id=int8(14332)
>
> Sped it up from 4 milliseconds to .07 milliseconds (and obviously now
> did an index scan)!!!!
> This HAS bitten me before.
> Questions:
> If postgres knows the field is an int8, why do I have to cast it in my
> query?

That is a long answer.

> Any way I can avoid having to watch for this particular column (and 3
> others in other tables) column in all my queries?

1. Automatically cast all your queries
2. Quote all parameters.

>
>
>
>
>
>
>

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd(at)commandprompt(dot)com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL

Attachment Content-Type Size
jd.vcf text/x-vcard 285 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message OpenMacNews 2004-12-04 00:27:45 Re: initdb error: "could not identify current directory" (or,
Previous Message Tom Lane 2004-12-03 23:49:08 Re: initdb error: "could not identify current directory" (or, what have i done now?)