Received: from gw.acate.com.br ([200.215.17.89]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB5GmQG69837 for ; Tue, 5 Dec 2000 11:48:26 -0500 (EST) (envelope-from edmar@brasmap.com) Received: from joana ([192.168.1.13]) by gw.acate.com.br (8.9.3/8.9.3) with SMTP id OAA09784 for ; Tue, 5 Dec 2000 14:48:38 -0200 From: "Edmar Wiggers" To: Subject: Using SELECT as DDL/DML statement is wrong (was RE: reinitialize a sequence?) Date: Tue, 5 Dec 2000 14:49:33 -0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal In-Reply-To: <20001205101012.A13143@rice.edu> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Archive-Number: 200012/33 X-Sequence-Number: 364 If and when stored procedures are supported, there should be some way to prevent functions called in a SELECT statement to modify the database (create, insert, etc.). It is confusing (and wrong IMHO) to use statements like SELECT setval('tablename_serfield_seq',max(serfield)) FROM tablename; (which is used to reset a sequence) That should be done with EXECUTE procedure(tablename_name,sequence_name); (not sure if execute is the right keyword) Yours sincerely, Edmar Wiggers BRASMAP Information Systems +55 48 9960 2752