Re: decode('hallo',???)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Fritz Lehmann-Grube <lehmannf(at)math(dot)TU-Berlin(dot)DE>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: decode('hallo',???)
Date: 2002-08-27 20:27:56
Message-ID: 200208272027.g7RKRvg11422@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Fritz Lehmann-Grube wrote:
>
> hallo somebody,
>
> what do the functions "encode" and "decode" expect as arguments ?

test=> \df decode
List of functions
Result data type | Schema | Name | Argument data types
------------------+------------+--------+---------------------
bytea | pg_catalog | decode | text, text
(1 row)

> I was puzzled when I got the following:
>
> pgdocsample=# \encoding
> SQL_ASCII
> pgdocsample=# select decode('hallo','SQL_ASCII');
> ERROR: No such encoding as 'SQL_ASCII'
>
> What have I understood wrong ?

Decode is working. The message is complaining about the encoding you
have for the session.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2002-08-27 20:59:20 Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?
Previous Message Fritz Lehmann-Grube 2002-08-27 20:23:18 decode('hallo',???)