From: | "kumar" <sgnerd(at)yahoo(dot)com(dot)sg> |
---|---|
To: | "Richard Huxton" <dev(at)archonet(dot)com> |
Cc: | <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Customised Encoding |
Date: | 2004-04-28 06:18:43 |
Message-ID: | 006601c42ce8$a9cee580$7502a8c0@hdsc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
The idea is I wanna store any number from 1 to 2^16 in 2 strings only - This
is the requirement.
Since in Unicode a 16 bit is represented in a Single chararctor.
So i wanna convert any number into a 32 bit and then convert each 16 bit
into one char and stored it in database.
So I wanna know how to convert any 16 bit to a single charactor.
Is there any function to do that in Postgres.
Thanks
Kumar
----- Original Message -----
From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "kumar" <sgnerd(at)yahoo(dot)com(dot)sg>
Cc: <pgsql-sql(at)postgresql(dot)org>
Sent: Tuesday, April 27, 2004 9:16 AM
Subject: Re: [SQL] Customised Encoding
> On Tuesday 27 April 2004 13:55, kumar wrote:
> > Hi Richar,
>
> Kumar - try to make sure you reply to the list.
>
> > It didnt work for me.
> >
> > select encode('65536'::bytea,'UTF-8')
> > ERROR: Cannot cast type integer to bytea
> >
> > select encode('65536'::bytea,'UTF-8')
> > ERROR: No such encoding as 'UTF-8'
>
> I think you're using the encode() function wrongly. The second parameter
is
> supposed to be something like "base64" or "hex". I'm not sure it makes
sense
> to try and cast an integer to a bytea either.
>
> Can you say what you're trying to achieve here?
>
> --
> Richard Huxton
> Archonet Ltd
From | Date | Subject | |
---|---|---|---|
Next Message | Bruno Wolff III | 2004-04-28 06:48:13 | Re: date arithmetic over calender year boundaries |
Previous Message | Tom Lane | 2004-04-28 04:16:28 | Re: Which SQL command creates ExclusiveLock? |