Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id AFF969FB5D9 for ; Thu, 28 Jun 2007 22:34:41 -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 26792-02 for ; Thu, 28 Jun 2007 22:34:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id F0AA29FB55B for ; Thu, 28 Jun 2007 22:34:37 -0300 (ADT) Received: from perhan.alvh.no-ip.org (201-221-218-82.bk12-dsl.surnet.cl [201.221.218.82]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l5T1YDud032389; Thu, 28 Jun 2007 18:34:15 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 504FD47C43; Thu, 28 Jun 2007 21:34:05 -0400 (CLT) Date: Thu, 28 Jun 2007 21:34:05 -0400 From: Alvaro Herrera To: Bruce Momjian Cc: David Gardner , pgsql-docs@postgresql.org Subject: Re: proposed FAQ entry Message-ID: <20070629013405.GJ32626@alvh.no-ip.org> References: <467C6DD9.3090407@gardnerit.net> <200706290106.l5T16KU18798@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200706290106.l5T16KU18798@momjian.us> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: ClamAV 0.90.3/3544/Wed Jun 27 17:58:59 2007 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Thu, 28 Jun 2007 18:34:24 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/26 X-Sequence-Number: 4315 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. Hmm, I do see it from time to time in pgsql-es-ayuda. Maybe not as frequently as some other questions that are also missing from the FAQ (like a thorough explanation of encoding issues), but I digress. -- Alvaro Herrera http://www.PlanetPostgreSQL.org/ "Ni aun el genio muy grande llegarķa muy lejos si tuviera que sacarlo todo de su propio interior" (Goethe)