> ... gsames00.ano_mes = to_char(ftnfco00.data_emissao,'YYYYMM') AND ...
> Then it uses the gsames00 index instead of a SeqScan 'cuz it is
> camparing same data type, but .. I don't want to create this function 'cuz
> this aplication is used with Oracle too.
You should have said that earlier ....
> I need to know if there is a way to set the to_char output to varchar
> instead of text !
Did you try:
... gsames00.ano_mes = (to_char(ftnfco00.data_emissao,'YYYYMM')::VARCHAR) AND
Aglio Database Solutions
In response to
pgsql-performance by date
|Next:||From: Josh Berkus||Date: 2003-09-18 17:53:57|
|Subject: Re: Find one record|
|Previous:||From: Josh Berkus||Date: 2003-09-18 17:34:13|
|Subject: Re: rewrite in to exists?|
pgsql-admin by date
|Next:||From: Josh Berkus||Date: 2003-09-18 18:02:10|
|Subject: Re: How to force an Index ?|
|Previous:||From: Chris White (cjwhite)||Date: 2003-09-18 17:01:28|
|Subject: Re: Testing for a record before update or insert without using a function.|