Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B248F133740B for ; Wed, 8 Dec 2010 06:04:39 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 47534-05 for ; Wed, 8 Dec 2010 10:04:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail7c40.carrierzone.com (mail7c40.carrierzone.com [209.235.156.147]) by mail.postgresql.org (Postfix) with ESMTP id 094A7133655C for ; Wed, 8 Dec 2010 06:04:27 -0400 (AST) Received: from mail7c40.carrierzone.com (localhost [127.0.0.1]) by mail7c40.carrierzone.com (8.13.6/8.13.1) with ESMTP id oB8A4RSI019372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Dec 2010 10:04:27 GMT Received: (from webmail@localhost) by mail7c40.carrierzone.com (8.13.6/8.12.2/Submit) id oB8A4RRu019371; Wed, 8 Dec 2010 05:04:27 -0500 Received: from NSG-Static-074.18.72.182.airtel.in (NSG-Static-074.18.72.182.airtel.in [182.72.18.74]) by mail.artificialmachines.com (Webmail 5.0 V.V.I.) with HTTP for ; Wed, 08 Dec 2010 05:04:27 -0500 Message-ID: <20101208050427.ryccuyjfp9asowkk@mail.artificialmachines.com> From: "=?utf-8?b?TWFuYXNpIFNhdmU=?=" To: "pgsql-admin@postgresql.org" , "Manasi Save" Subject: Re: Create database/table using postgresql stored function Date: Wed, 08 Dec 2010 05:04:27 -0500 X-Priority: 3 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_1z83zugsc080" Content-Transfer-Encoding: 7bit User-Agent: Webmail 6.0 X-CSC: 0 X-CHA: v=1.1 cv=U2gsWr+iROjpd8oktB8oxWIWGe+/0Pc9QVhIjXFTBBg= c=1 sm=1 a=0lNuXWF6n_gA:10 a=6mBWwJEmJT4fWEzs4ffimg==:17 a=YVn6w7ia9BaYyudJwjkA:9 a=kkqM4O57zwdEvCQQxWkA:7 a=BnQ7PPOUNKt3haGCf8jeOPIegMQA:4 a=QEXdDO2ut3YA:10 a=0QyoFEyXCnafXycvd8gA:9 a=LkPyLMRo-g3hae8QuR8A:7 a=xfkUop_EEerQrCFeHgSyQGU0xrkA:4 a=WkljmVdYkabdwxfqvArNOQ==:117 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.92 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FROM_EXCESS_BASE64=0.979, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201012/54 X-Sequence-Number: 36283 This message is in MIME format. --=_1z83zugsc080 Content-Type: text/plain; charset=UTF-8; format="flowed" Content-Description: Plaintext Version of Message Content-Disposition: inline Content-Transfer-Encoding: 7bit Also I want to query multiple databases from stored functions from one central database. for ex := CREATE OR REPLACE FUNCTION test () RETURNS AS $BODY$ SELECT * FROM db2.volume ORDER BY db2.volume.volumeID $BODY$ LANGUAGE sql STABLE COST 100 ROWS 1000;' I have implemented this thing in mysql but I am not really sure is it possible in postgresql. -- Regards, Manasi Save On Wed, 08 Dec 2010 04:43:50 -0500, Manasi Save wrote: Hi All, I want to create postgresql database and tables using stored functions. Does postgresql support create statements in stored functions. Regards, Manasi --=_1z83zugsc080 Content-Description: HTML Version of Message Content-Type: text/html; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-ID: 2ii4ucg7kabk@mail.artificialmachines.com Also I want to query multiple databases from stored functions from one central database.
 
for ex := 
 

CREATE OR REPLACE FUNCTION test ()  RETURNS  AS
$BODY$
 
SELECT * FROM db2.volume
ORDER BY db2.volume.volumeID
 
$BODY$  
LANGUAGE sql STABLE  
COST 100  
ROWS 1000;'
 
I have implemented this thing in mysql but I am not really sure is it possible in postgresql.

--
Regards,
Manasi Save



On Wed, 08 Dec 2010 04:43:50 -0500, Manasi Save wrote:
Hi All,
 
I want to create postgresql database and tables using stored functions.
 
 
Does postgresql support create statements in stored functions.
 
Regards,
Manasi

--=_1z83zugsc080--