Re: create a table inside a function

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Alain Roger <raf(dot)news(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: create a table inside a function
Date: 2009-06-25 13:07:48
Message-ID: 20090625130748.GA24456@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 25, 2009 at 02:53:59PM +0200, Alain Roger wrote:
> i would like to execute the following SQL command into a function based on
> some IF, END IF tests before.
> how can i do that ?

1. you can use execute in pl/pgsql.
2. if your ifs are basically testing if the table exists - you might
want to check this:
http://www.depesz.com/index.php/2008/06/18/conditional-ddl/

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
jid/gtalk: depesz(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alain Roger 2009-06-25 13:09:40 Re: create a table inside a function
Previous Message Frank Heikens 2009-06-25 13:01:52 Re: create a table inside a function