Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 8B5A19FB5E4 for ; Fri, 22 Jun 2007 21:51:40 -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 91861-04 for ; Fri, 22 Jun 2007 21:51:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from yucaipaco.com (yucaipaco.com [82.165.181.113]) by postgresql.org (Postfix) with ESMTP id EC54B9FB539 for ; Fri, 22 Jun 2007 21:51:36 -0300 (ADT) Received: (qmail 7290 invoked by uid 210); 22 Jun 2007 17:54:06 -0700 Received: from 10.23.112.225 by yucmail (envelope-from , uid 201) with qmail-scanner-1.25st (clamdscan: 0.90.2/3399. f-prot: 4.6.7/3.16.15. spamassassin: 3.1.8. perlscan: 1.25st. Clear:RC:1(10.23.112.225):. Processed in 0.795142 secs); 23 Jun 2007 00:54:06 -0000 Received: from unknown (HELO ?10.23.112.225?) (yucrelay@10.23.112.225) by yucaipaco.com with ESMTPA; 22 Jun 2007 17:54:05 -0700 Message-ID: <467C6DD9.3090407@gardnerit.net> Date: Fri, 22 Jun 2007 17:48:25 -0700 From: David Gardner User-Agent: Thunderbird 2.0.0.4 (X11/20070618) MIME-Version: 1.0 To: pgsql-docs@postgresql.org Subject: proposed FAQ entry Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.026 tagged_above=0 required=5 tests=AWL=0.025, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200706/21 X-Sequence-Number: 4310 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.