I have table names with hypens, underscores, whitespace, etc. in them and I get the following error after starting pgweb, selecting a table with such characters in its name from the left column with "Database Tables" and clicking on the Content tab.
The following errors is displayed: ERROR: pq: syntax error at or near "-"
The table name and schema names should be quoted with double quotes " in PostgreSQL to denote identifiers.
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.
So "select" could be used to refer to a column or table named "select", whereas an unquoted select would be taken as a key word and would therefore provoke a parse error when used where a table or column name is expected.
The example can be written with quoted identifiers like this:
UPDATE "my_table" SET "a" = 5;
**Quoted identifiers can contain any character, except the character with code zero**. (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.
I have table names with hypens, underscores, whitespace, etc. in them and I get the following error after starting pgweb, selecting a table with such characters in its name from the left column with "Database Tables" and clicking on the Content tab.
The following errors is displayed: ERROR: pq: syntax error at or near "-"
The table name and schema names should be quoted with double quotes " in PostgreSQL to denote identifiers.
See: http://www.postgresql.org/docs/9.3/static/sql-syntax-lexical.html