2 novice questions

From: "Sykora, Dale" <Dale(dot)Sykora(at)COMPAQ(dot)com>
To: "'pgsql-novice(at)postgreSQL(dot)org'" <pgsql-novice(at)postgreSQL(dot)org>
Subject: 2 novice questions
Date: 2001-06-07 22:39:17
Message-ID: 898CFC137378DD44826AC0AAAA5F7BD918E18E@cceexc22.americas.cpqcorp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Do primary keys need to be defined in all tables that are releated by the
key or only in the primary one?

For instance if I create tables to hold file info as shown below...

CREATE TABLE filename (id SEQUENCE PRIMARY KEY, name TEXT UNIQUE);

CREATE TABLE filestat (id INTEGER, size INTEGER, ts TIMESTAMP, md5
CHAR(32));

Does the filestat.id column need a PRIMARY KEY constraint?

Also, if I have a read only user, do I need to grant SELECT access on the
sequence?
GRANT SELECT ON filename_id_seq TO myuser;

Thanks for all the help this list provides:)

Thanks,

dale(dot)sykora(at)compaq(dot)com

Browse pgsql-novice by date

  From Date Subject
Next Message Chris Smith 2001-06-07 22:51:30 Re: Again: How do I select primary/foreign keys?
Previous Message Jason Earl 2001-06-07 22:10:41 Re: Create unique field..