Re: proposed FAQ entry - Mailing list pgsql-docs

From Bruce Momjian
Subject Re: proposed FAQ entry
Date
Msg-id 200706290106.l5T16KU18798@momjian.us
Whole thread Raw
In response to proposed FAQ entry  (David Gardner <david@gardnerit.net>)
Responses Re: proposed FAQ entry
Re: proposed FAQ entry
List pgsql-docs
David Gardner wrote:
> Earlier today I was tempted to start storing usesysid's as foreign keys
> in one of my tables by doing:
> SELECT usesysid FROM pg_user WHERE pg_user.usename= user;
>
> My proposed FAQ entry is based on this mailing list post which convinced
> me not to:
> http://archives.postgresql.org/pgsql-novice/2005-04/msg00328.php
>
>
> So the Question would be:
>
> Q) How do I keep track of edits to a table? OR Can I use store usesysid
> in my table to identify users?
>
> A) No because usesysid values are not guaranteed to remain the same
> after a restore, or upgrade. Instead store the user name as text, if
> needed create your own user table and associate the user names with
> integer keys.

Uh, sorry, this is not a _frequent_ question/issue.

--
  Bruce Momjian  <bruce@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

pgsql-docs by date:

Previous
From: Neil Conway
Date:
Subject: Re: rename of a view
Next
From: Alvaro Herrera
Date:
Subject: Re: proposed FAQ entry