Re: [GENERAL] using ID as a key - Mailing list pgsql-general

From sheila bel
Subject Re: [GENERAL] using ID as a key
Date
Msg-id 20000205045928.97998.qmail@hotmail.com
Whole thread Raw
List pgsql-general
Hi David,

I like your example below since it is simple enough for
someone who is new to this to implement, but I'm wondering
how the IDs are maintained ? Will it be auto incremented
this way ? Or would I need to write a function to do that ?
Would I be able to view the ID numbers ? I guess since you've
declared it as an integer it is readable by humans.
I want this ID to act like a social insurance number but it
will not be seen or used by anyone except the developer (me).
My database is going to be fairly small ( very unlikely to
ever exceed more than 2000 records ).

-Sheila

>
>For what it's worth . . . I would do it as follows:
>
>CREATE TABLE tbl_agency
>(
>     nagencyid    INT    NOT NULL,
>     szotherdata    VARCHAR(30)
>);
>CREATE UNIQUE INDEX tbl_agency_pk ON tbl_agency (nagencyid);
>
>CREATE TABLE tbl_employee
>(
>     nemployeeid    INT    NOT NULL,
>     nagencyid        INT,
>     szotherdata    VARCHAR(30)
>);
>CREATE UNIQUE INDEX tbl_employee_pk ON tbl_employee (nemployeeid)

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


pgsql-general by date:

Previous
From: Ed Loehr
Date:
Subject: Re: [GENERAL] using ID as a key
Next
From: Ed Loehr
Date:
Subject: [GENERAL] Troubles with PL/pgSQL trigger/function drop/create scripts