Re: Quick question

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Brent Verner" <brent(at)rcfile(dot)org>
Cc: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Quick question
Date: 2001-11-14 01:51:08
Message-ID: GNELIHDDFBOCMGBFGEFOCEGGCAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I think there are two completely different issues here: one is what
> name to use for the auto-generated sequence, and the other is whether
> (when) to drop the sequence if the table is dropped. Fixing the
> latter issue would reduce but not entirely eliminate the issue of
> name collisions.

Hmmm? No way - see below.

> IIRC, the major objection to the notion of adding random hash characters
> to the auto-generated names was that people wanted to be able to predict
> the names. There was a long discussion about this a couple years back
> when we settled on the present algorithm. Please search the archives
> a bit if you want to re-open that issue.

I will search the archives, but I'll explain my thoughts here a well.

Well, what's the problem with appending a number - that's how index names
get generated.

This is my horrible schema that forced me to abandon using SERIAL in favour
of explicit CREATE SEQUENCE statements:

BEGIN;

-- Categories of foods
CREATE TABLE medidiets_categories_foods (
category_id SERIAL,
description varchar(255) NOT NULL,
PRIMARY KEY(category_id)
);

-- Categories of recipes
CREATE TABLE medidiets_categories_rec (
category_id SERIAL,
description varchar(255) NOT NULL,
PRIMARY KEY(category_id)
);

COMMIT;

Both of these SERIALs are given the same name - it's a real pain.

Chris

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-11-14 02:12:15 Re: Quick question
Previous Message Bruce Momjian 2001-11-14 01:38:41 Use of 'now'