Re: stored procedure multiple call call question

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: stored procedure multiple call call question
Date: 2012-10-13 10:10:13
Message-ID: k5bem5$8ur$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2012-10-02, Chris McDonald <chrisjonmcdonald(at)gmail(dot)com> wrote:
> Hi,
>
>
> If I had a single table targ to insert into I would do an
>
> INSERT INTO targ SELECT thiscol, thatcol, theothercol FROM FOO.
>
> The problem is that I have tables targ1, targ2, targn to insert things into and a nice stored procedure myproc which does the insertion into all 3 tables - problem is that I dont see how I can effectively do
>
> INSERT INTO myproc SELECT thiscol, thatcol, theothercol FROM FOO.

see the chapter on partitioning for info on how to write a rule or
trigger to do it with syntax like that.

However with what you already have you you can do this:

SELECT myproc(thiscol, thatcol, theothercol) FROM FOO;

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arvind Singh 2012-10-13 11:52:52 Improve MMO Game Performance
Previous Message Jasen Betts 2012-10-13 09:22:22 Re: non-integer constant in ORDER BY: why exactly, and documentation?