Re: PostgreSQL Developer Best Practices - Mailing list pgsql-general

From Melvin Davidson
Subject Re: PostgreSQL Developer Best Practices
Date
Msg-id CANu8FiyEQaH365HvKsG3Asyrj+LOVLZOYt=XqbNMzh9hNHMywQ@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL Developer Best Practices  (CaT <cat@zip.com.au>)
Responses Re: PostgreSQL Developer Best Practices
Re: PostgreSQL Developer Best Practices
List pgsql-general
You are right, he was probably talking about FK's. I was just so frustrated about people insisting that using "ID" as the primary key in every table is a "good" idea,
I didn't bother to reply previously. I stand firm on my belief that the primary key should be something meaningful and NOT "id" just for the sake of having a unique numeric key.

On Mon, Aug 24, 2015 at 8:39 PM, CaT <cat@zip.com.au> wrote:
On Mon, Aug 24, 2015 at 08:22:17PM -0400, Melvin Davidson wrote:
> On Mon, Aug 24, 2015 at 8:00 PM, Berend Tober <btober@computer.org> wrote:
> >>     1) What happens if someone mis-types the account-id?
> >>           To correct that, you also need to correct the FK field in the
> >>     other dozen tables.
> >
> > ... ON UPDATE CASCADE ?
>
> I believe he's talking about triggers.

Huh? Why would you use a trigger when FOREIGN KEY has ON UPDATE CASCADE?

--
  "A search of his car uncovered pornography, a homemade sex aid, women's
  stockings and a Jack Russell terrier."
    - http://www.dailytelegraph.com.au/news/wacky/indeed/story-e6frev20-1111118083480



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

pgsql-general by date:

Previous
From: CaT
Date:
Subject: Re: PostgreSQL Developer Best Practices
Next
From: Gavin Flower
Date:
Subject: Re: PostgreSQL Developer Best Practices