pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ross J. Reedstrom <reedstrm@rice.edu>
To: Matthew Horoschun <mhoroschun@canprint.com.au>
To: pgsql-sql@postgresql.org
Subject: Re: Controlling access to Sequences
Date: Sat, 1 Feb 2003 17:42:03 -0600
Message-ID: <20030201234203.GB1300@wallace.ece.rice.edu> (raw)
In-Reply-To: <20030201063950.GA21857@wolff.to>
References: <2759DB60-351A-11D7-92E5-000393B3A702@canprint.com.au>
	<20030201063950.GA21857@wolff.to>

On Sat, Feb 01, 2003 at 12:39:50AM -0600, Bruno Wolff III wrote:
> On Fri, Jan 31, 2003 at 23:47:27 +1100,
>   Matthew Horoschun <mhoroschun@canprint.com.au> wrote:
> > 
> > Is there any effective method for controlling access to a SEQUENCE? or 
> > should I do something like in the view:
> 
> You can limit access to nextval by only allowing access through a user
> defined function that runs as the definer. If you only want them to use
> the function when doing an insert into a specific table, then I am not
> sure if you can do this easily. At worst you could write a function
> that does the insert.

Define your 'suid_nextval()' as Bruno suggests, then instead of using the
'serial' convience type, define your own that uses your function as the
default, rather than nextval().

Ross



view thread (8+ messages)

Message-ID: <20030201234203.GB1300@wallace.ece.rice.edu>
Permalink:  ../20030201234203.GB1300@wallace.ece.rice.edu/
Also on:    postgresql.org/message-id/20030201234203.GB1300@wallace.ece.rice.edu

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: reedstrm@rice.edu, mhoroschun@canprint.com.au
  Subject: Re: Controlling access to Sequences
  In-Reply-To: <20030201234203.GB1300@wallace.ece.rice.edu>

* 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