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.