pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Ezequias R. da Rocha <ezequias@fastcon.com.br>
Cc: pgsql-sql@postgresql.org
Subject: Re: For loop
Date: Tue, 13 Mar 2007 09:40:41 -0400
Message-ID: <20070313134041.GB6715@alvh.no-ip.org> (raw)
In-Reply-To: <45F6A793.1090904@fastcon.com.br>
References: <45F6B4EB.A3DD.0030.0@indicator.be>
	<45F6A793.1090904@fastcon.com.br>

Ezequias R. da Rocha wrote:
> I quetion one more time. I must have a function ? Isn't another way to 
> implement it without using functions ?

The syntax you show is plpgsql.  You cannot use that without a function.
(The alternative would be to script the bulk insertion client-side,
which I'd think is smarter anyway).

If what you need to do is batch processing of rows to produce other
rows, then maybe you can craft an INSERT .. SELECT query to do it
instead of this row-at-a-time approach.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.



view thread (16+ messages)  latest in thread

Message-ID: <20070313134041.GB6715@alvh.no-ip.org>
Permalink:  ../20070313134041.GB6715@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20070313134041.GB6715@alvh.no-ip.org

 · 

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: alvherre@commandprompt.com, ezequias@fastcon.com.br
  Subject: Re: For loop
  In-Reply-To: <20070313134041.GB6715@alvh.no-ip.org>

* 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