Re: Column name 'user' not allowed?

Поиск
Список
Период
Сортировка
От Alberto Cabello Sanchez
Тема Re: Column name 'user' not allowed?
Дата
Msg-id 20040708062326.GA18234@guadiana.unex.es
обсуждение исходный текст
Ответ на Re: Column name 'user' not allowed?  (Bill Moran <wmoran@potentialtech.com>)
Ответы Re: Column name 'user' not allowed?
Список pgsql-general
On Wed, Jul 07, 2004 at 05:17:08PM -0400, Bill Moran wrote:
> Thomas Mueller <news-exp-dec04@tmueller.com> wrote:
> > now I can create the table! I don't see a reason why column name USER
> > isn't allowed?!
>
> Because it's a reserved word in PostgreSQL's SQL syntax.
>
> You can also work around this by enclosing the name in quotes.  This also
> makes the column name case-sensitive though, so you need to be sure that
> _all_ processes/code/whatever that accesses this table can properly address
> the column with the proper case.  i.e. if you use "USER" and later try to
> SELECT user FROM poc_user_account, you'll get an error that the column
> doesn't exist.

Even worse, you don't get an error at all, but you get your current connection
username:

alberto=# select user from pg_database;
 current_user
--------------
 alberto
 alberto
 alberto
(3 rows)

--
-----------------------
Alberto Cabello Sánchez
alberto@unex.es
Servicio de Informática
924 289 351
-----------------------

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

Предыдущее
От:
Дата:
Сообщение: Re: enable thready safety on Mac OS X 10.3.4
Следующее
От: Shridhar Daithankar
Дата:
Сообщение: Re: Enough RAM for entire Database.. cost aside, is this