On Wed, 19 Mar 2008 08:28:28 -0700
Steve Midgley <[EMAIL PROTECTED]> wrote:
> I'm not following this line. Maybe we're talking about two different
> things here.. I don't know if Lance is using "CRUD" methodology per se,
> but that's a well accepted web approach and uses (generally) serial
> pri
At 06:47 AM 3/19/2008, D'Arcy J.M. Cain wrote:
But your suggestion was to base this key on the serial primary key so
where is your index collision protection? You are going to get
collisions on both the serial key and, to a lesser extent, your
generated one. Besides, has anyone ever demonstrated
On Tue, 18 Mar 2008 13:57:39 -0700
Steve Midgley <[EMAIL PROTECTED]> wrote:
> At 12:36 PM 3/18/2008, D'Arcy J.M. Cain wrote:
> >On Tue, 18 Mar 2008 12:23:35 -0700
> >Steve Midgley <[EMAIL PROTECTED]> wrote:
> > > 1) Create a second field (as someone recommend on this list) that
> > is an
> > > MD5
On Tue, Mar 18, 2008 at 01:40:42PM -0500, Campbell, Lance wrote:
> This is not a security approach. It is more about not giving obvious
> access to people that want to mess around.
1. keep primary key using standard serial. it will make your life a bit
simpler.
2. add column for text random ident
At 12:36 PM 3/18/2008, D'Arcy J.M. Cain wrote:
On Tue, 18 Mar 2008 12:23:35 -0700
Steve Midgley <[EMAIL PROTECTED]> wrote:
> 1) Create a second field (as someone recommend on this list) that
is an
> MD5 of your primary key. Use that as your "accessor" index from the
web
I strongly disagree fo
On Tue, 18 Mar 2008 12:23:35 -0700
Steve Midgley <[EMAIL PROTECTED]> wrote:
> 1) Create a second field (as someone recommend on this list) that is an
> MD5 of your primary key. Use that as your "accessor" index from the web
I strongly disagree for three reasons. First, if you are going to
gener
On Tue, 18 Mar 2008 13:40:42 -0500
"Campbell, Lance" <[EMAIL PROTECTED]> wrote:
> Why use a random number as a primary key? Security via obscurity.
Something with very short shelf life but...
> I build web applications for a living. In most of my applications it is
> preferable to use a random
At 11:58 AM 3/18/2008, [EMAIL PROTECTED] wrote:
Date: Tue, 18 Mar 2008 13:40:42 -0500
From: "Campbell, Lance" <[EMAIL PROTECTED]>
To: "Vivek Khera" <[EMAIL PROTECTED]>,
Subject: Re: Create on insert a unique random number
Message-ID:
<[EMAIL PROTECTED]>
Thanks for all of your input.
On Mar 18, 2008, at 2:40 PM, Campbell, Lance wrote:
Why use a random number as a primary key? Security via obscurity.
I build web applications for a living. In most of my applications
it is
preferable to use a random primary key. Why?
Don't expose the actual ID to the end user; only ex
On Mar 18, 2008, at 1:40 PM, Campbell, Lance wrote:
Thanks for all of your input. It appears that the best way to do this
is to create a default random number in the primary id field in the
table definition and then return that value after insert. If an
exception occurs because of duplicates
lto:[EMAIL PROTECTED] On Behalf Of Vivek Khera
Sent: Tuesday, March 18, 2008 12:57 PM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Create on insert a unique random number
On Mar 18, 2008, at 1:03 PM, Campbell, Lance wrote:
> The field n is not random but is sequential. Is there something I
> s
On Mar 18, 2008, at 1:03 PM, Campbell, Lance wrote:
The field n is not random but is sequential. Is there something I
should do to make the serial number random?
Depending on your "randomness" need, you can alter the increment of
the sequence so it changes by a different amount than "1" on
am Tue, dem 18.03.2008, um 12:03:31 -0500 mailte Campbell, Lance folgendes:
> I created the following table:
>
> create table xyz (
> n serial,
> abc character varying,
> constraint n_pkey primary key (n));
>
> Each time I do an insert:
>
> insert into xyz(abc) values('adf6');
>
> The field
On Tue, 18 Mar 2008 17:51:39 +0100
"A. Kretschmer" <[EMAIL PROTECTED]> wrote:
> am Tue, dem 18.03.2008, um 9:43:01 -0700 mailte chester c young folgendes:
> > > When inserting a record is there a way to have postgres create a
> > > random number for a field such that it is unique?
> >
> > you co
Campbell, Lance wrote:
I created the following table:
create table xyz (
n serial,
abc character varying,
constraint n_pkey primary key (n));
Each time I do an insert:
insert into xyz(abc) values('adf6');
The field n is not random but is sequential. Is there something I
should do to make
2008 11:52 AM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Create on insert a unique random number
am Tue, dem 18.03.2008, um 9:43:01 -0700 mailte chester c young
folgendes:
>
> > When inserting a record is there a way to have postgres create a
> > random number for a fie
am Tue, dem 18.03.2008, um 9:43:01 -0700 mailte chester c young folgendes:
>
> > When inserting a record is there a way to have postgres create a
> > random number for a field such that it is unique?
>
>
> you could use oid
No! No oid, it's deprecated. The solution: use serial.
Andreas
--
> When inserting a record is there a way to have postgres create a
> random number for a field such that it is unique?
you could use oid
Looking for last minute shopping deals?
Find them fast with Ya
When inserting a record is there a way to have postgres create a random
number for a field such that it is unique?
Thanks,
Lance Campbell
Project Manager/Software Architect
Web Services at Public Affairs
University of Illinois
217.333.0382
http://webservices.uiuc.edu
19 matches
Mail list logo