Lukasz Dynowski
Lukasz Dynowski

Reputation: 13610

Syntax error at or near ":" postgresql

I would like to drop a role that contains this name:

http://bphppgadmin.kattare.com/phppgadmin/vagrant 

I perform query from terminal and Postgresql throws syntax error.

Error:

DROP ROLE http://bphppgadmin.kattare.com/phppgadmin/vagrant;
ERROR:  syntax error at or near ":"
LINE 1: DROP ROLE http://bphppgadmin.kattare.com/phppgadmin/vagrant;

Anyone knows how to escape colon? I tried several solution however no luck so far.

Upvotes: 1

Views: 1593

Answers (1)

user330315
user330315

Reputation:

Identifiers with non-standard characters need to be enclosed in double quotes:

DROP ROLE "http://bphppgadmin.kattare.com/phppgadmin/vagrant";

More details in the manual:
http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

Upvotes: 3

Related Questions