Skip site navigation (1) Skip section navigation (2)

Re: plpgsql and index usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ryan Mahoney <ryan(at)flowlabs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: plpgsql and index usage
Date: 2002-12-21 16:37:52
Message-ID: 486.1040488672@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Ryan Mahoney <ryan(at)flowlabs(dot)com> writes:
>> Hmm ... evidently zipcode is declared as type char(5) (note the "bpchar"
>> coercion).  Is the plpgsql variable it's being compared to declared the
>> same way?  This could be ye olde cross-datatype-coercion problem.

> Interesting!  I think in plpgsql the data type of the argument coming
> in to the function is "text".

Bingo.

>  Are you suggesting that I:
> 	a. use a different datatype in plpgsql or 
> 	b. cast the values or
> 	c. change the data type in the table

Yes ;-).  Presumably (b) would be the least painful route, but any of
these would do the trick.

> I am not familiar with the bpchar type, but I am looking into it now.

Internal name for char(n).

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Kenji SugitaDate: 2002-12-21 16:38:10
Subject: How to write make rules for shared library and loadable library
Previous:From: Michael PaesoldDate: 2002-12-21 09:49:19
Subject: Re: Resource management in 7.4

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group