Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 3DF259FC226 for ; Fri, 29 Jun 2007 04:55:14 -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 37721-03 for ; Fri, 29 Jun 2007 04:55:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from svr2.hagander.net (svr2.hagander.net [88.198.128.226]) by postgresql.org (Postfix) with ESMTP id 291809FC1AA for ; Fri, 29 Jun 2007 04:55:10 -0300 (ADT) Received: by svr2.hagander.net (Postfix, from userid 1000) id 0A38EDCCB4C; Fri, 29 Jun 2007 09:55:09 +0200 (CEST) Date: Fri, 29 Jun 2007 09:55:09 +0200 From: Magnus Hagander To: Bruce Momjian Cc: David Gardner , pgsql-docs@postgresql.org Subject: Re: proposed FAQ entry Message-ID: <20070629075509.GC20255@svr2.hagander.net> References: <467C6DD9.3090407@gardnerit.net> <200706290106.l5T16KU18798@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200706290106.l5T16KU18798@momjian.us> User-Agent: Mutt/1.5.11 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/27 X-Sequence-Number: 4316 On Thu, Jun 28, 2007 at 09:06:20PM -0400, Bruce Momjian wrote: > 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. If it's not frequent, perhaps it should at least go in the documentatino somewhere? (I confess I haven't checked if it's actually there already) //Magnus