Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

escaping dash in username

I'm having difficulty modifying a postgres user that contains a dash in its name - I've run into this problem several times, but can never find the answer (no matter how much googling I do!).

osm=# grant all on osm_polygon_view to www-data;

ERROR: syntax error at or near "-"

LINE 1: grant all on osm_polygon_view to www-data;

                                       ^

I have tried just about every permutation of escape characters and quotes, and still can't get this to work. I have also encountered this when trying to change www-data password.

like image 707
gavz Avatar asked Feb 19 '10 01:02

gavz


1 Answers

Double quotes is what you should use - not single quotes.

grant all on osm_polygon_view to "www-data";

like image 148
gavz Avatar answered Nov 16 '22 22:11

gavz