Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 2E2FD1337B88 for ; Wed, 8 Dec 2010 06:47:40 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 28716-10 for ; Wed, 8 Dec 2010 10:47:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id E940C1337B49 for ; Wed, 8 Dec 2010 06:47:32 -0400 (AST) Received: from [192.168.51.27] (unknown [217.111.66.10]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id 354433B8F5; Wed, 8 Dec 2010 11:47:32 +0100 (CET) Message-ID: <4CFF6243.6070700@lelarge.info> Date: Wed, 08 Dec 2010 11:47:31 +0100 From: Guillaume Lelarge User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); fr; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Manasi Save CC: "pgsql-admin@postgresql.org" Subject: Re: Create database/table using postgresql stored function References: <20101208044350.5tkfeuzqm0gs44w4@mail.artificialmachines.com> In-Reply-To: <20101208044350.5tkfeuzqm0gs44w4@mail.artificialmachines.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.13 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_SORBS_WEB=0.77 X-Spam-Level: X-Archive-Number: 201012/55 X-Sequence-Number: 36284 Le 08/12/2010 10:43, Manasi Save a écrit : > [...] > I want to create postgresql database and tables using stored functions. > > Does postgresql support create statements in stored functions. > You cannot use CREATE DATABASE from a stored function or in a multistatements query. But AFAICT, any of the other DDL statements are available in a stored function (or in a transaction for that matter). -- Guillaume http://www.postgresql.fr http://dalibo.com