Em 12 de setembro de 2011 17:55, Tiago Adami <[email protected]> escreveu:
> Esta pergunta é um tanto absurda... mas vamos lá: existe como criar um
> identificador no PostgreSQL 8.3 para que ao informar "CURRENT DATE"
> (sem aspas, com espaço) retorne a data atual da mesma forma que
> "CURRENT_DATE" (sem aspas, com underscore)?
>
> Existem rotinas do nosso ERP que rodam em Sybase e DB2, onde esta
> palavra é reconhecida, e para manter a compatibilidade entre estes 3
> bancos eu precisaria desta funcionalidade...
>
Apenas como quoted identifier (entre aspas).
Do manual:
"SQL identifiers and key words must begin with a letter (a-z, but also
letters with diacritical marks and non-Latin letters) or an underscore
(_). Subsequent characters in an identifier or key word can be
letters, underscores, digits (0-9), or dollar signs ($). Note that
dollar signs are not allowed in identifiers according to the letter of
the SQL standard, so their use might render applications less
portable."
"There is a second kind of identifier: the delimited identifier or
quoted identifier. It is formed by enclosing an arbitrary sequence of
characters in double-quotes ("). A delimited identifier is always an
identifier, never a key word."
http://www.postgresql.org/docs/9.1/interactive/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
Osvaldo
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral