CHAR vs TEXT args

From: david_shadovitz(at)xontech(dot)com (David Shadovitz)
To: pgsql-general(at)postgresql(dot)org
Subject: CHAR vs TEXT args
Date: 2003-08-27 17:08:27
Message-ID: 8b37e2e5.0308270908.bb390df@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2003-08-27 17:40:11 Re: postgresql not using index even though it's faster
Previous Message Ivar 2003-08-27 16:55:43 Functions have 32 args limt ???