Re: [PERFORM] How to force an Index ? - Mailing list pgsql-admin

From Josh Berkus
Subject Re: [PERFORM] How to force an Index ?
Date
Msg-id 200309181050.34270.josh@agliodbs.com
Whole thread Raw
In response to Re: [PERFORM] How to force an Index ?  (Rhaoni Chiu Pereira <rhaoni@sistemica.info>)
List pgsql-admin
Rhaoni,

>  ... 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
...


--
Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-admin by date:

Previous
From: Gustavo Pérez
Date:
Subject: varchar too long strange problem
Next
From: Alumne FIB - GUSTAVO PEREZ QUEROL
Date:
Subject: Re: dump among different versions of postgreSQL