Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Using result from current_database() into another command?



select current_database();
current_database
------------------
test2

Is there a way to use that result from current_database() into something like: alter database CURRENT_DATABASE() set search_path=myschema,public;

I have some generic scripts that I am preparing for several databases. Most commands/loads don't care about the database, since they just use the one I am connected to. Alter database however needs the database specified.

Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group