Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3E770475AE1 for ; Mon, 19 Aug 2002 11:53:22 -0400 (EDT) Received: from mail.iinet.net.au (mail-02.iinet.net.au [203.59.3.34]) by postgresql.org (Postfix) with SMTP id 0FE6947597C for ; Mon, 19 Aug 2002 11:53:21 -0400 (EDT) Received: (qmail 24450 invoked from network); 19 Aug 2002 15:53:19 -0000 Received: from unknown (HELO SOL) (203.59.159.124) by mail.iinet.net.au with SMTP; 19 Aug 2002 15:53:20 -0000 Message-ID: <00a401c24798$7cc43630$0200a8c0@SOL> From: "Christopher Kings-Lynne" To: "Fritz Lehmann-Grube" Cc: References: <3D60F041.10003@math.tu-berlin.de> <006b01c24790$072149c0$0200a8c0@SOL> <3D610D1A.6020009@math.tu-berlin.de> Subject: Re: recursive function returning "setof" Date: Mon, 19 Aug 2002 23:52:56 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/270 X-Sequence-Number: 9116 http://www3.us.postgresql.org/users-lounge/docs/7.2/postgres/plpgsql-control -structures.html Chris ----- Original Message ----- From: "Fritz Lehmann-Grube" To: "Christopher Kings-Lynne" Cc: Sent: Monday, August 19, 2002 11:22 PM Subject: Re: [SQL] recursive function returning "setof" > > Thanx Chris, > > but I can't find it. > My Programmer's Guide (.../pgsql/doc/html/xfunc-sql.html) says > > "12.2. Query Language (SQL) Functions > SQL functions execute an arbitrary list of SQL statements," > > Nothing about control structures in SQL functions additional to the normal > command-line syntax. Where can I find it ? > > and (.../pgsql/doc/html/plpgsql.html#PLPGSQL-ADVANTAGES) > > "23.1.1.1. Better Performance > SQL is the language PostgreSQL (and most other Relational Databases) use as > query language. It's portable and easy to learn. But every SQL statement > must be executed individually by the database server. > > That means that your client application must send each query to the database > server, wait for it to process it, receive the results, do some computation, > then send other queries to the server." > > Isn't it just the thing in plpgsql to add control structures to SQL ? > > Fritz > > Christopher Kings-Lynne wrote: > >>The problem is: > >>A SQL-Function cannot be recursive because it cannot call itself, and it > > > > can > > > >>perform no loops. > >>A PLPGSQL-Function cannot return sets. > > > > > > It can perform loops. Check the manual- you can do FOR and WHILE loops. > > 7.3 will be able to return sets from PLPGSQL funcs it seems. > > > > Chris > > > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 4: Don't 'kill -9' the postmaster > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >