Re: PostgreSQL Naming Rules

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: PostgreSQL Naming Rules
Дата
Msg-id 4EAB6233.5050808@ringerc.id.au
обсуждение исходный текст
Ответ на PostgreSQL Naming Rules  (Robert Buckley <robertdbuckley@yahoo.com>)
Список pgsql-general
On 10/28/2011 06:49 PM, Robert Buckley wrote:

> according to this article
> http://www.informit.com/articles/article.aspx?p=409471, the naming of
> tables, and fields is restricted to 63 characters and must start with an
> underscore or letter. Nothing is however said about in which character set.
>
> Am I allowed to name a table field < Änderung_1 >. The Ä is a german
> letter contained within the UTF8 character set.

It'll work, but sadly you will at some point run into badly written
tools that mangle anything but 7-bit-ascii text.

psql on the Windows command line needs some extra love to behave
correctly; you may have to issue a chcp command to change the console to
unicode before starting psql if you're working with data that cannot be
represented in the charset your version of Windows uses. That won't be
an issue for umlauts etc, but if you wanted (say) hebrew table names on
a German windows you'd probably have to change the codepage.

Other than that, PostgreSQL and its tools should be fine. You are likely
to run into badly written tools elsewhere that mangle anything that
isn't 7-bit ascii, though, so be careful.

In general, if PostgreSQL doesn't like a table identifier you can
"double quote" it to get it to accept it. Table identifiers in
double-quotes also have their case preserved rather than automatically
being lower-cased like unquoted identifiers. Because the downcasing
rules for anything except 7-bit ascii are less than clear, I'd recommend
double-quoting all identifiers that use characters outside that range.

--
Craig Ringer

В списке pgsql-general по дате отправления:

Предыдущее
От: aperi2007
Дата:
Сообщение: Re: PG 9.1.1 - availability of xslt_process()
Следующее
От: Arvind Singh
Дата:
Сообщение: question related to pg_stat_database