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/


Reply via email to