Re: cross-database time extract?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: cross-database time extract?
Дата
Msg-id 20091229141459.GD4569@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: cross-database time extract?  (Osvaldo Kussama <osvaldo.kussama@gmail.com>)
Список pgsql-general
Osvaldo Kussama escribió:

> bdteste=# SELECT "time"(CURRENT_TIMESTAMP);
>       time
> -----------------
>  10:55:20.679684
> (1 registro)
>
> bdteste=# SELECT $$time$$(CURRENT_TIMESTAMP);
> ERRO:  erro de sintaxe em ou próximo a "("
> LINE 1: SELECT $$time$$(CURRENT_TIMESTAMP);
>                        ^

Note that the reason the second query doesn't work is that $$ is a way
to replace quoting for string literals, i.e. what ' (single quote) does
normally.  " (double quote) is used to quote identifiers, not literals.
Different thing.

When you write "time" you are invoking the function because it's parsed
as an identifier.  When you write time (no quotes) you are invoking the
reserved keyword.  The double quotes strip the "reservedness" and it's
treated like an ordinary keyword.  When you write pg_catalog.time this
is parsed as an identifier too because keywords cannot be
schema-qualified.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: cross-database time extract?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: cross-database time extract?