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? 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
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
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
Many thanks Niels for clarifying this!
Best regards,
Diethard
On Sun, Mar 17, 2013 at 5:19 PM, Niels Nes
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
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Diethard Steiner
-
Niels Nes