views:

133

answers:

1

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.

+3  A: 

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

grant all on osm_polygon_view to "www-data";

gavz
Use double quotes to make 'delimited identifiers' - for things like table names or column names, and for user names.
Jonathan Leffler