Re: How to Create a Database Dynamically Using PostgreSQL

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: "Vishnu S(dot)" <vishnu(dot)s(at)nestgroup(dot)net>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: How to Create a Database Dynamically Using PostgreSQL
Date: 2009-08-10 11:06:09
Message-ID: 4A7FFF21.5070906@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On 10/08/2009 05:44, Vishnu S. wrote:

> I am New in PostgreSQL. I want to know how we create a Database
> dynamically using a postgresql function.
>
> When I tried to create a Database like that,I got an error like the
> following,
>
> “CREATE DATABASE cannot be executed from a function or multi-command
> string”.

This question really belongs on the pgsql-general list, as it's not
related to PgAdmin.

However, do you need to do it from a function? You could just run the
SQL "create database..." command, assuming that your user has the
necessary privileges.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Guillaume Lelarge 2009-08-10 11:06:45 Re: Malfunction in dropping database with pgAdmin
Previous Message Raymond O'Donnell 2009-08-10 11:04:23 Re: Two issues