On Sun, Mar 17, 2013 at 04:47:45PM +0000, Diethard Steiner wrote:
Hi,
I ran into a problem when setting up a user with single quotes:
sql>CREATE USER 'tpch' WITH PASSWORD 'tpch' NAME 'TPC-H Admin' SCHEMA 'sys'; syntax error, unexpected STRING in: "create user 'tpch'"
Then I followed exactly the quatation style of the voc example and it worked:
sql>CREATE USER "tpch" WITH PASSWORD 'tpch' NAME 'TPC-H Admin' SCHEMA "sys"; operation successful (3.663ms)
So now with user and schema enclosed in double quotes, password and name in single quotes, it worked. This inconsistent usage of single and double quotes seems a bit strange to me. Should I file a bug report for this? Or is there a specific reason for this?
Yes there is a specific reason, both aren't seen as strings, schema and user names are identifiers. All identifiers can be escaped using double quotes.
Only strings use single quotes.
Niels
As a final test I enclosed all values in double quotes: sql>CREATE USER "test2" WITH PASSWORD "test2" NAME "Test User 2" SCHEMA "sys"; syntax error, unexpected IDENT, expecting STRING in: "create user "test2" with password "test2""
Thanks, Diethard
users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list