[GENERAL] CHAR vs TEXT args

2003-08-28 Thread David Shadovitz
I've created two PL/pgSQL functions with the same name and different
signatures:

CREATE FUNCTION ABC(CHAR) ...
CREATE FUNCTION ABC(TEXT) 

I intended to call the CHAR-signature function like this:
SELECT ABC('R');

And the TEXT-signature function like this:
SELECT ABC('Right');

But I found that both calls invoke the TEXT-signature function.  So is
there any distinction between CHAR and TEXT?  Can I somehow specify
that the argument 'R' is to be treated as a CHAR, so the
CHAR-signature version of ABC is executed?

Thanks.
-David

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [GENERAL] CHAR vs TEXT args

2003-08-28 Thread Dennis Gearon
David Shadovitz wrote:

I've created two PL/pgSQL functions with the same name and different
signatures:
CREATE FUNCTION ABC(CHAR) ...
CREATE FUNCTION ABC(TEXT) 
I intended to call the CHAR-signature function like this:
SELECT ABC('R');
And the TEXT-signature function like this:
SELECT ABC('Right');
But I found that both calls invoke the TEXT-signature function.  

maybe you need to do this:

SELECT ABC('R':TEXT);
SELECT ABC('Right':CHAR);


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster