Received: from www-uk-05.digiserve.com ([195.97.231.11]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2NE4Lw55226 for ; Fri, 23 Mar 2001 09:04:22 -0500 (EST) (envelope-from dev@archonet.com) Received: from mainbox.archonet.com (mwynhau.demon.co.uk [193.237.186.96]) by www-uk-05.digiserve.com (8.9.1/8.9.1) with ESMTP id OAA09808; Fri, 23 Mar 2001 14:05:10 GMT Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with SMTP id 6051C2A687; Fri, 23 Mar 2001 13:46:26 +0000 (GMT) From: Richard H Date: Fri, 23 Mar 2001 13:46:25 GMT Message-ID: <20010323.13462500@client.archonet.com> Subject: Re: SOME PL/PGSQL PROBLEMS To: datactrl Cc: Reply-To: dev@archonet.com In-Reply-To: <004f01c0b379$19c48c60$2400a8c0@hnjack> References: <004f01c0b379$19c48c60$2400a8c0@hnjack> X-Mailer: Mozilla/3.0 (compatible; StarOffice/5.2;Linux) X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.postgresql.org id f2NE4Mw55230 X-Archive-Number: 200103/461 X-Sequence-Number: 2129 On 3/23/01, 9:10:16 AM, datactrl wrote regarding [SQL] SOME PL/PGSQL PROBLEMS: Sorry, can't reproduce this at all Jack > I found there are some problems with PL/pgSQL. > 1) 'Drop Table' doesn't work at all No problems in 7.1, can't remember about previous versions > 2) '--' comment causes parsing error No problems ever AFAIK > 3) Execute doesn't work at all. It always causes parsing error! I know this is only in 7.1, not in earlier versions > Some questions > 1) Can I use variable in FROM clause for a table name? No - afraid not. Queries are pre-compiled as I understand it, although this is possible in pltcl (and plperl I think). > 2) Can I use variable in WHERE such as xxx = variable? Yes, exactly as you show > JACK Take a look at http://www.brasileiro.net/postgres/ for some example plpgsql functions or check http://techdocs.postgresql.org or Bruce's book at http://www.postgresql.org/docs/awbook.html If you have a specific example, please post it with the version of PG you are running. HTH - Richard Huxton