Joerg Budischewski wrote:

 >>> currval 4

SELECT * FROM "public"."Foo" WHERE ID = 4.

 >>> ERROR:  column "id" does not exist

hmm, don't understand why this query fails, it looks fine to me. Do you have an idea ?

The quotes are missing around the column identifier ID, so Postgres down-cases it to "id", which does not exist. "ID" does exist in my table however. It looks like a simple omission in this one instance since everywhere else identifiers are always quoted, unless they are known to be unquoted, e.g. postgres's internal system identifiers.

Here is a bit more on this from the PostgreSQL documentation:

"Quoted identifiers can contain any character other than a double quote itself. (To include a double quote, write two double quotes.) This allows constructing table or column names that would otherwise not be possible, such as ones containing spaces or ampersands. The length limitation still applies. "

"Quoting an identifier also makes it case-sensitive, whereas unquoted names are always folded to lower case. For example, the identifiers FOO, foo, and "foo" are considered the same by PostgreSQL, but "Foo" and "FOO" are different from these three and each other. (The folding of unquoted names to lower case in PostgreSQL is incompatible with the SQL standard, which says that unquoted names should be folded to upper case. Thus, foo should be equivalent to "FOO" not "foo" according to the standard. If you want to write portable applications you are advised to always quote a particular name or never quote it.) "

Ross

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to