Re: Problem with encode() function

From: Glenn_Wiens(at)via-christi(dot)org
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Problem with encode() function
Date: 2004-05-24 21:24:25
Message-ID: OF1AD33728.53EFE07E-ON86256E9E.00735329-86256E9E.0075A6B7@via-christi.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Thanks -- that did the trick! And when I went to consult my documentation
about this command, I realized I was looking at 7.2 docs (downloaded) vs my
currently running version of 7.3.


Manuel Sugawara
<masm(at)fciencias(dot)una To: Glenn_Wiens(at)via-christi(dot)org
m.mx> cc: pgsql-novice(at)postgresql(dot)org
Sent by: Fax to:
masm(at)conexa(dot)fcienci Subject: Re: [NOVICE] Problem with encode() function
as.unam.mx


05/21/2004 05:21 PM

Glenn_Wiens(at)via-christi(dot)org writes:

> but I still get the error:
>
> ERROR: Function encode(text, "unknown") does not exist
> Unable to identify a function that satisfies the given argument
> types
> You may need to add explicit typecasts
>
> Is there a way I can accomplish this task?

The problem is that there is no cast from varchar to bytea (which is
what encode takes as first argument). Try creating the cast first:

CREATE CAST (varchar as bytea) WITHOUT FUNCTION;
SELECT encode(password::bytea, 'base64'::text) FROM texttable;

You may want to drop the cast afterwards.

Regards,
Manuel.

Browse pgsql-novice by date

  From Date Subject
Next Message Aarni Ruuhimäki 2004-05-25 12:19:16 Sequence error ?
Previous Message Nabil Sayegh 2004-05-24 18:31:21 Re: Copy From problem