pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Rhaoni Chiu Pereira <rhaoni@sistemica.info>
Cc: PostgreSQL ADMIN <pgsql-admin@postgresql.org>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: [PERFORM] How to force an Index ?
Date: Thu, 18 Sep 2003 10:50:34 -0700
Message-ID: <200309181050.34270.josh@agliodbs.com> (raw)
In-Reply-To: <1063896309.3f69c4f5cd16a@sistemica.info>
References: <1063837067.3f68dd8b5a62b@sistemica.info>
	<200309171538.33515.josh@agliodbs.com>
	<1063896309.3f69c4f5cd16a@sistemica.info>

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



view thread (6+ messages)  latest in thread

Message-ID: <200309181050.34270.josh@agliodbs.com>
Permalink:  ../200309181050.34270.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200309181050.34270.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: josh@agliodbs.com, rhaoni@sistemica.info, pgsql-admin@postgresql.org
  Subject: Re: [PERFORM] How to force an Index ?
  In-Reply-To: <200309181050.34270.josh@agliodbs.com>
  References: <1063837067.3f68dd8b5a62b@sistemica.info> <200309171538.33515.josh@agliodbs.com> <1063896309.3f69c4f5cd16a@sistemica.info> <200309181050.34270.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox