Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f3I0ATu75793 for ; Tue, 17 Apr 2001 20:10:29 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from biology.nmsu.edu (biology.NMSU.Edu [128.123.5.72]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3HG7Pu64414 for ; Tue, 17 Apr 2001 12:07:25 -0400 (EDT) (envelope-from brook@biology.nmsu.edu) Received: (from brook@localhost) by biology.nmsu.edu (8.8.8/8.8.8) id KAA08777; Tue, 17 Apr 2001 10:07:24 -0600 (MDT) Date: Tue, 17 Apr 2001 10:07:24 -0600 (MDT) Message-Id: <200104171607.KAA08777@biology.nmsu.edu> X-Authentication-Warning: biology.nmsu.edu: brook set sender to brook@biology.nmsu.edu using -f From: Brook Milligan To: electric_csf@hotmail.com CC: pgsql-sql@postgresql.org In-reply-to: <9bfrg7$s14$1@news.tht.net> (electric_csf@hotmail.com) Subject: Re: Re: Using Random Sequence as Key References: <15067.21277.884548.721903@wynand.flutterby.com> <9bfrg7$s14$1@news.tht.net> X-Archive-Number: 200104/291 X-Sequence-Number: 2647 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