Re: Using psql to insert character codes

Поиск
Список
Период
Сортировка
Искать
От
Ian Barwick
Тема
Re: Using psql to insert character codes
Дата
в 12:54:09
Msg-id
200305101853.20266.barwick@gmx.net
Ответ на
Список
Дерево обсуждения
Using psql to insert character codes Ian Barwick <barwick@gmx.net>
Re: Using psql to insert character codes Ian Barwick <barwick@gmx.net>
Re: Using psql to insert character codes Randall Lucas <rlucas@tercent.net>
Re: Using psql to insert character codes Ian Barwick <barwick@gmx.net>
Re: Using psql to insert character codes Randall Lucas <rlucas@tercent.net>
merge-join for domain with underlying type text Randall Lucas <rlucas@tercent.net>
Re: merge-join for domain with underlying type text Rod Taylor <rbt@rbt.ca>
Re: merge-join for domain with underlying type text Randall Lucas <rlucas@tercent.net>
Re: merge-join for domain with underlying type text Rod Taylor <rbt@rbt.ca>
Re: merge-join for domain with underlying type text Randall Lucas <rlucas@tercent.net>
Re: merge-join for domain with underlying type text Tom Lane <tgl@sss.pgh.pa.us>
Re: Using psql to insert character codes Peter Eisentraut <peter_e@gmx.net>
Re: Using psql to insert character codes Ian Barwick <barwick@gmx.net>
Re: Using psql to insert character codes Peter Eisentraut <peter_e@gmx.net>
On Saturday 10 May 2003 18:15, Randall Lucas wrote:
> Yes, use a Mac!
>
> I'm not being entirely facetious -- if you can use a Mac OS X terminal
> prompt (and if your pg config is substantially similar to mine),
> inserting any unicode stuff is quite easy.  Simply typing or
> cutting-and-pasting at the terminal let me visually put in accented
> Latin, Cyrillic, and Chinese (don't ask me what kind, I am a
> sinoignoramus) no sweat.

Thanks, but right answer to wrong question ;-). "mlterm" in Linux / FreeBSD 
works fine for me; the "problem" is not inputting in general, but the
ability to use psql to input using the hexadecimal (or decimal) character
code, which I need to do occasionally for some obscure character not
reachable by other means.

The solution I posted works, I was just wondering whether there was some more 
elegant method I had overlooked.

Ian Barwick
barwick@gmx.net

> On Saturday, May 10, 2003, at 10:20 AM, Ian Barwick wrote:
> > Say using psql I wish to insert a character into a VARCHAR / TEXT /
> > whatever
> > column using the its hexadecimal representation in the relevant
> > character set
> > / encoding. E.g.: C3A4, which represents the character 'ä' (lower case
> > a with
> > umlaut) in UTF-8.
> >
> > I can do this:
> > INSERT INTO my_tbl (unitxt) VALUE(encode(decode('c3a4','hex'),
> > 'escape'))
> >
> > Is there any other, shorter way of doing the same?
> >
> >
> > Ian Barwick
> > barwick@gmx.net
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >     (send "unregister YourEmailAddressHere" to
> > majordomo@postgresql.org)


В списке pgsql-sql по дате отправления
От: Randall Lucas
Дата:
От: Ian Barwick
Дата:
FAQ