Using SELECT as DDL/DML statement is wrong (was RE: reinitialize a sequence?)

From: "Edmar Wiggers" <edmar(at)brasmap(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Using SELECT as DDL/DML statement is wrong (was RE: reinitialize a sequence?)
Date: 2000-12-05 16:49:33
Message-ID: NEBBIAKDCDHFGJMLHCKIEENKCBAA.edmar@brasmap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ross J. Reedstrom 2000-12-05 17:27:37 Re: reinitialize a sequence?
Previous Message Ross J. Reedstrom 2000-12-05 16:10:12 Re: reinitialize a sequence?