Re: PostgreSQL v9.4, ERROR: must be owner of database test_db

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: KARIN SUSANNE HILBERT <ioh1(at)psu(dot)edu>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: PostgreSQL v9.4, ERROR: must be owner of database test_db
Date: 2016-07-20 19:57:28
Message-ID: CAKFQuwZ8Pwo0k2xZ8S_XUHMB8UGJwT+Vv2VOzUptZ_qTk0Jf9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Jul 20, 2016 at 3:37 PM, KARIN SUSANNE HILBERT <ioh1(at)psu(dot)edu> wrote:

> 2016-07-10 02:54:12 EDT [4415]: [5-1] db=test_db,user=test_user *LOG:
> statement: alter database test_db set standard_conforming_strings='off';*
>
> 2016-07-10 02:54:12 EDT [4415]: [6-1] db=test_db,user=test_user *ERROR:
> must be owner of database test_db*
>

T
​he reason this isn't a problem is that the ALTER DATABASE is executed in
its own transaction so when it fails it doesn't impact any other (future)
activity in the session.

​The short answer is to tell the developer to stop sending "ALTER DATABASE
SET" statements as part of their connection startup routine.

If you want to spend the time to understand why the documentation is a very
good reference.

https://www.postgresql.org/docs/9.6/static/config-setting.html

This isn't anything special about the choice of
"standard_conforming_strings" here, though search_path is probably a more
frequent used choice.

​I also noticed this:

​alter database :dbname set search_path=:dbuser;

On its face that just feels wrong, though there is nothing technically
incorrect about it. Personally I would name the application, and the
schemas for the application, different than the name of the user that is
going to be accessing those schemas. To have the name of a schema and the
name of a user match, when said schema is not a personal schema for the
user, is unusual.

David J.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message KARIN SUSANNE HILBERT 2016-07-21 17:24:52 Re: PostgreSQL v9.4, ERROR: must be owner of database test_db
Previous Message KARIN SUSANNE HILBERT 2016-07-20 19:37:49 PostgreSQL v9.4, ERROR: must be owner of database test_db