pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brook Milligan <brook@biology.nmsu.edu>
To: electric_csf@hotmail.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Re: Using Random Sequence as Key
Date: Tue, 17 Apr 2001 10:07:24 -0600 (MDT)
Message-ID: <200104171607.KAA08777@biology.nmsu.edu> (raw)
In-Reply-To: <9bfrg7$s14$1@news.tht.net>
References: <15067.21277.884548.721903@wynand.flutterby.com>
	<9bfrg7$s14$1@news.tht.net>

   It is a good way to solve it but since I don't want/can't use cookies in my
   application I could use only the random key but it would have to be unique
   or the where key=$key could refer to multiple lines or I would have to ask
   for the user to input both the random and the serial number wich wouldn't be
   very good either. That's the reason I've being trying to make a random key
   wich would be unique so I could ask for the user to type his order code and
   then select info from orders where ordercode=$ordercode and not have the
   risk of getting multiple answers (more then one line with that ordercode) or
   someone typing his ordercode-1 and accessing someone elses form.

Do you have users logging in so that you know who is requesting the
data?  If so, just make a view that includes WHERE name = current_user
to filter out all irrelevant (i.e., other people's) rows (inserts
should set name to the appropriate user, of course).  In that case a
SERIAL will work fine, since there is no chance of seeing anyone
else's information and the SERIAL is unique.  More secure, also.

Cheers,
Brook



view thread (12+ messages)  latest in thread

Message-ID: <200104171607.KAA08777@biology.nmsu.edu>
Permalink:  ../200104171607.KAA08777@biology.nmsu.edu/
Also on:    postgresql.org/message-id/200104171607.KAA08777@biology.nmsu.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: brook@biology.nmsu.edu, electric_csf@hotmail.com
  Subject: Re: Re: Using Random Sequence as Key
  In-Reply-To: <200104171607.KAA08777@biology.nmsu.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