Re: PostgreSQL Developer Best Practices

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: John Turner <jjturner(at)energi(dot)com>, pgsql-general General <pgsql-general(at)postgresql(dot)org>, Ray Cote <rgacote(at)appropriatesolutions(dot)com>
Subject: Re: PostgreSQL Developer Best Practices
Date: 2015-08-24 16:09:38
Message-ID: 55DB41C2.9080205@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/24/2015 08:56 AM, Melvin Davidson wrote:
> >The "serial" key is the default primary key amongst every single web
> development environment in existence.
>
> Methinks thou doest take too much for granted.
>
> Yes, serial has it's purpose, but I sincerely doubt it is "the default
> primary key amongst every single web development environment in existence"
> I am not sure where you get your stats from. Probably you are referring
> to "Ruby on Rails". IMHO, RoR is something which has made it easier to
> code Web apps, at the cost of developers not needing to use brain power.
> In any case, the idea is to develop good database design. not web apps.

Well I think the broader definition is that surrogate key use is a
byproduct of ORM use. Web development frameworks tend to use an ORM as
the default way of interacting with the database so you get surrogate keys.

>
> On Mon, Aug 24, 2015 at 11:46 AM, Joshua D. Drake <jd(at)commandprompt(dot)com
> <mailto:jd(at)commandprompt(dot)com>> wrote:
>
> On 08/24/2015 07:58 AM, John Turner wrote:
>
> On Mon, 24 Aug 2015 09:15:27 -0400, Ray Cote
>
>
>
> Point 9 is well-intentioned, but perhaps needs to be
> clarified/rephrased: Developers should not be creating
> production-grade
> tables devoid of well-defined business keys, period. That would be
> regardless of whether they're used as de facto primary keys or
> simply as
> unique keys.
>
>
> Although I appreciate your argument, I think we need a little
> foundation in reality. The "serial" key is the default primary key
> amongst every single web development environment in existence.
>
> We can make an argument within the doc to why that can be bad, but
> to state that it is "wrong" is just not going to get you anywhere.
>
> JD
>
>
> --
> Command Prompt, Inc. - http://www.commandprompt.com/ 503-667-4564
> <tel:503-667-4564>
> PostgreSQL Centered full stack support, consulting and development.
> Announcing "I'm offended" is basically telling the world you can't
> control your own emotions, so everyone else should do it for you.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org
> <mailto:pgsql-general(at)postgresql(dot)org>)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
>
>
> --
> *Melvin Davidson*
> I reserve the right to fantasize. Whether or not you
> wish to share my fantasy is entirely up to you.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2015-08-24 16:26:25 Re: PostgreSQL Developer Best Practices
Previous Message Melvin Davidson 2015-08-24 15:56:05 Re: PostgreSQL Developer Best Practices