Re: Database-level collation version tracking - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Database-level collation version tracking
Date
Msg-id 202202091625.6tcu7tmtvase@alvherre.pgsql
Whole thread Raw
In response to Re: Database-level collation version tracking  (Julien Rouhaud <rjuju123@gmail.com>)
List pgsql-hackers
On 2022-Feb-08, Julien Rouhaud wrote:

> On Tue, Feb 08, 2022 at 12:14:02PM +0100, Peter Eisentraut wrote:

> > I don't think you can run ALTER DATABASE from the regression test scripts,
> > since the database name is not fixed.  You'd have to paste the command
> > together using psql tricks or something.  I guess it could be done, but
> > maybe there is a better solution.  We could put it into the createdb test
> > suite, or write a new TAP test suite somewhere.  There is no good precedent
> > for this.
> 
> I was thinking using a simple DO command, as there are already some other usage
> for that for non deterministic things (like TOAST tables).  If it's too
> problematic I'm fine with not having tests for that for now.

You can do this:

select current_database() as datname \gset
alter database :"datname" owner to foo;

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Next
From: walther@technowledgy.de
Date:
Subject: Re: [PATCH] Add reloption for views to enable RLS