pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Edmar Wiggers <edmar@brasmap.com>
To: pgsql-sql@postgresql.org
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: <NEBBIAKDCDHFGJMLHCKIEENKCBAA.edmar@brasmap.com> (raw)
In-Reply-To: <20001205101012.A13143@rice.edu>

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




view thread (3+ messages)  latest in thread

Message-ID: <NEBBIAKDCDHFGJMLHCKIEENKCBAA.edmar@brasmap.com>
Permalink:  ../NEBBIAKDCDHFGJMLHCKIEENKCBAA.edmar@brasmap.com/
Also on:    postgresql.org/message-id/NEBBIAKDCDHFGJMLHCKIEENKCBAA.edmar@brasmap.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: edmar@brasmap.com
  Subject: Re: Using SELECT as DDL/DML statement is wrong (was RE: reinitialize a sequence?)
  In-Reply-To: <NEBBIAKDCDHFGJMLHCKIEENKCBAA.edmar@brasmap.com>
  References: <20001205101012.A13143@rice.edu> <NEBBIAKDCDHFGJMLHCKIEENKCBAA.edmar@brasmap.com>

* 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