Postgres: need to create user and database?

288 views
Skip to first unread message

Arthur Clemens

unread,
Aug 21, 2012, 7:19:44 AM8/21/12
to yeso...@googlegroups.com
If I create a new scaffolded site with postgresql, the server quits:
devel.hs: SqlError {sqlState = "", sqlNativeError = -1, sqlErrorMsg = "FATAL:  role \"yosog\" does not exist\n"}
Exit code: ExitFailure 1

So I created a this role. After that I got:
devel.hs: SqlError {sqlState = "", sqlNativeError = -1, sqlErrorMsg = "FATAL:  database \"yosog\" does not exist\n"}
Exit code: ExitFailure 1

So I created the database, and after that it runs fine. Is this the normal procedure or is this a bug (Mac OS 10.7.4, ghc 32 bits)?

Arthur

Michael Snoyman

unread,
Aug 21, 2012, 10:15:51 AM8/21/12
to yeso...@googlegroups.com
This is the normal procedure. Creating a user/database is a required
step in setting up a new site.

Andika Riyandi

unread,
May 15, 2015, 9:39:19 AM5/15/15
to yeso...@googlegroups.com
Hi i got same kind error, what i want to ask is did you mean create role is "ALTER ROLE" in psql terminal??

I already create using ALTER ROLE and Database with name as requested by the error, the it keeps showing error message...

like this :

devel.hs: libpq: failed (FATAL:  role "user" does not exist

)

Exit code: ExitFailure 1


I hope you can help me...

Michael Snoyman

unread,
May 17, 2015, 2:11:07 AM5/17/15
to yeso...@googlegroups.com
Here's an example of a script to create a user and database in PostgreSQL (and MySQL for that matter):

https://github.com/yesodweb/yesod-scaffold/blob/master/setup.sh

--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages