Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 6D29C9FB6D0 for ; Thu, 28 Jun 2007 22:06:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 10942-05 for ; Thu, 28 Jun 2007 22:06:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 1CD029FB638 for ; Thu, 28 Jun 2007 22:06:22 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id l5T16KU18798; Thu, 28 Jun 2007 21:06:20 -0400 (EDT) From: Bruce Momjian Message-Id: <200706290106.l5T16KU18798@momjian.us> Subject: Re: proposed FAQ entry In-Reply-To: <467C6DD9.3090407@gardnerit.net> To: David Gardner Date: Thu, 28 Jun 2007 21:06:20 -0400 (EDT) CC: pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL123] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/25 X-Sequence-Number: 4314 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 http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +