nomicflux / servant-opaleye-blog

Tutorial on setting up a blog backend with Servant and Opaleye
Other
16 stars 2 forks source link

How to populate the data for project? #7

Closed wpoosanguansit closed 7 years ago

wpoosanguansit commented 7 years ago

Hi,

I am able to run the project but I am getting the data error:

stack exec blog-tutorial-exe blog-tutorial-exe: libpq: failed (FATAL: role "blogtutorial" does not exist )

How should I populate the data along with the schema provided? Thanks for your help.

wpoosanguansit commented 7 years ago

I figured this out. We just need to create the role and database named blogtutorial in order for the app to exe.

nomicflux commented 7 years ago

Thanks for pointing that out - I'll make sure to mention it in the tutorial.

nomicflux commented 7 years ago

Lesson 2 now has instructions for creating the user and db.

wpoosanguansit commented 7 years ago

Thank you.

wpoosanguansit commented 7 years ago

I started fresh and installed Postgresql following the instruction in the doc. When I do

stack exec blog-tutorial-exe

and I posted with the body

{ username: "username", password: "password" }

access the site at localhost:8080/users I do still get for both post and get:

SqlError {sqlState = "42501", sqlExecStatus = FatalError, sqlErrorMsg = "permission denied for relation users", sqlErrorDetail = "", sqlErrorHint = ""}

Is there anything else that would be needed to be setup? Thanks for your help.