New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the query for checking existence of Table #501

Merged
merged 1 commit into from Nov 15, 2015

Conversation

Projects
None yet
3 participants
@psibi
Member

psibi commented Nov 9, 2015

The old query doesn't work in the scenario where the table is present
but under the ownership of a different user. This query fixes it.
Also it improves the error message related to issue #390.

Instead of an error message like this:

SqlError {sqlState = "42P07", sqlExecStatus = FatalError, sqlErrorMsg =
"relation \"person\" already exists", sqlErrorDetail = "",
sqlErrorHint = ""}

You get this:

SqlError {sqlState = "42501", sqlExecStatus = FatalError, sqlErrorMsg =
"must be owner of relation person", sqlErrorDetail = "", sqlErrorHint =
""}```
Change the query for checking existence of Table
The old query doesn't work in the scenario where the table is present
but under the ownership of a different user. This query fixes it.
Also it improves the error message related to issue #390.

Instead of an error message like this:

SqlError {sqlState = "42P07", sqlExecStatus = FatalError, sqlErrorMsg =
"relation \"person\" already exists", sqlErrorDetail = "",
sqlErrorHint = ""}

You get this:

SqlError {sqlState = "42501", sqlExecStatus = FatalError, sqlErrorMsg =
"must be owner of relation person", sqlErrorDetail = "", sqlErrorHint =
""}

@snoyberg snoyberg added the in progress label Nov 9, 2015

@psibi

This comment has been minimized.

Show comment
Hide comment
@psibi

psibi Nov 10, 2015

Member

CC: @gregwebs and others

I will merge this if there is no one against it.

Member

psibi commented Nov 10, 2015

CC: @gregwebs and others

I will merge this if there is no one against it.

@gregwebs

This comment has been minimized.

Show comment
Hide comment
@gregwebs

gregwebs Nov 10, 2015

Member

I am not familiar with Postgres ownership, but I like the new error message!

Member

gregwebs commented Nov 10, 2015

I am not familiar with Postgres ownership, but I like the new error message!

@psibi

This comment has been minimized.

Show comment
Hide comment
@psibi

psibi Nov 15, 2015

Member

@gregwebs Who else can review this for PostgreSQL then ?

Member

psibi commented Nov 15, 2015

@gregwebs Who else can review this for PostgreSQL then ?

gregwebs added a commit that referenced this pull request Nov 15, 2015

Merge pull request #501 from psibi/table-exist-query
Change the query for checking existence of Table

@gregwebs gregwebs merged commit ae87193 into yesodweb:master Nov 15, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@snoyberg snoyberg removed the in progress label Nov 15, 2015

@gregwebs

This comment has been minimized.

Show comment
Hide comment
@gregwebs

gregwebs Nov 15, 2015

Member

I released it to hackage. Thanks!

Member

gregwebs commented Nov 15, 2015

I released it to hackage. Thanks!

@psibi

This comment has been minimized.

Show comment
Hide comment
@psibi

psibi Nov 15, 2015

Member

Thanks!

Member

psibi commented Nov 15, 2015

Thanks!

gregwebs added a commit that referenced this pull request Nov 29, 2015

@psibi psibi referenced this pull request Mar 20, 2016

Closed

Privilege check (Fix #390) #550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment