pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert J. Sanford, Jr. <rsanford@nolimitsystems.com>
To: pgsql-sql@postgresql.org
Subject: how do i...
Date: Sat, 11 Aug 2001 22:49:19 -0500
Message-ID: <HOEFIONAHHKFEFENBMNOOENACAAA.rsanford@nolimitsystems.com> (raw)

first - i'm new at this postgres thing...

i'm coming from a MSAccess and MSSQLServer environment where
i can set up and "AUTOINCREMENT" primary key so that when i
insert a row into a table i don't have to worry about trying
to figure out what the primary key should be.

i know that i can set up a sequence in postgres but i then
have to make sure that all of my inserts use the sequence to
create the primary key and i would like to avoid that.

is there any way that i can set up a sequence so that the
primary key is automatically generated whenever a row is
inserted?

if not, then my plan is to create a stored procedure that
performs the insert with the sequence call. however, i would
like to make sure that ONLY the stored procedure has the
ability to perform the insert and that my developers cannot
insert directly into the table. is this possible? i'm worried
that when i set up a stored procedure it only has the rights
given to it by the caller so if i turn off insert rights for
my applications then the store procedure won't be able to do
the inserts either.

many thanks!

rjsjr




view thread (9+ messages)  latest in thread

Message-ID: <HOEFIONAHHKFEFENBMNOOENACAAA.rsanford@nolimitsystems.com>
Permalink:  ../HOEFIONAHHKFEFENBMNOOENACAAA.rsanford@nolimitsystems.com/
Also on:    postgresql.org/message-id/HOEFIONAHHKFEFENBMNOOENACAAA.rsanford@nolimitsystems.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rsanford@nolimitsystems.com
  Subject: Re: how do i...
  In-Reply-To: <HOEFIONAHHKFEFENBMNOOENACAAA.rsanford@nolimitsystems.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