Reputation: 1896
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
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