abhishek77in
abhishek77in

Reputation: 1896

How do I create postgres case-sensitive role from windows terminal

When I try to create role Abhishek from windows terminal using the following command it creates a role abhishek which is not what I want.

psql -U postgres -c "CREATE ROLE Abhishek LOGIN NOSUPERUSER INHERIT CREATEDB CREATEROLE;

I want to create the role using terminal only as later I have to put this as a command in a script file.

Upvotes: 1

Views: 3055

Answers (1)

zerkms
zerkms

Reputation: 255005

Use quotes, Luke

psql -U postgres -c "CREATE ROLE ""Abhishek"" LOGIN NOSUPERUSER INHERIT CREATEDB CREATEROLE;"

Identifiers in quotes are not normalized and used as-is.

References:

PS: could you guys please teach me how you get the link to the latest documentation? :-) I cannot remember the link and every time I fail miserably finding it on the postgresql docs site.

Upvotes: 4

Related Questions