pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Seethalakshmi VB <seethalakshmi.vb@majoris.com>
To: pgsql-sql@postgresql.org
Subject: Creating tables from within functions
Date: Fri, 24 Jan 2003 14:06:31 +0530
Message-ID: <MCBBKKFNMOLJEPPNKICGCEABCAAA.seethalakshmi.vb@majoris.com> (raw)

Is it possible to issue a CREATE TABLE statement from inside of a PostgreSQL
function?  If not, then how about from within a PL/pgSQL function?  I have
tried a lot of different permutations but can't seem to get it to compile
and/or run cleanly.  For example, consider:

	CREATE FUNCTION _testcreate () RETURNS text AS '
	BEGIN
		CREATE TABLE switch_table2 (switch_id varchar(32),
selection_name varchar(100));
	end;
	' language 'plpgsql';

What is wrong with this?  What type should be returned?  Or perhaps it is
simply not possible to create a table from within a function?

Please give me the reply soon as possible
Thanks!



view thread (4+ messages)  latest in thread

Message-ID: <MCBBKKFNMOLJEPPNKICGCEABCAAA.seethalakshmi.vb@majoris.com>
Permalink:  ../MCBBKKFNMOLJEPPNKICGCEABCAAA.seethalakshmi.vb@majoris.com/
Also on:    postgresql.org/message-id/MCBBKKFNMOLJEPPNKICGCEABCAAA.seethalakshmi.vb@majoris.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: seethalakshmi.vb@majoris.com
  Subject: Re: Creating tables from within functions
  In-Reply-To: <MCBBKKFNMOLJEPPNKICGCEABCAAA.seethalakshmi.vb@majoris.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox