Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 172972E44AA for ; Tue, 5 Feb 2008 15:42:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 99578-02 for ; Tue, 5 Feb 2008 15:42:52 -0400 (AST) Received: from starfish.geekisp.com (mail.geekisp.com [216.168.135.169]) by postgresql.org (Postfix) with ESMTP id CACE62E4479 for ; Tue, 5 Feb 2008 15:42:33 -0400 (AST) Received: (qmail 16472 invoked by uid 1003); 5 Feb 2008 19:43:58 -0000 Received: from adsl-99-165-91-151.dsl.pltn13.sbcglobal.net (HELO dino-1.misuse.org) (public@misuse.org@99.165.91.151) by mail.geekisp.com with (DHE-RSA-AES256-SHA encrypted) SMTP; 5 Feb 2008 19:43:58 -0000 X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Tue, 05 Feb 2008 11:42:20 -0800 To: pgsql-sql@postgresql.org From: Steve Midgley Subject: Negative numbers for PK/ID's? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Message-Id: <20080205194233.CACE62E4479@postgresql.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/20 X-Sequence-Number: 30111 Hi, A while ago on a different SQL platform, I had the idea to use negative numbers as id's for certain system records that I didn't prefer to have interspersed with other records in a table. (For example, we had "template" records which we used to spawn new records, and rather than store them in a different table we just had records id=-1,-2 etc and did an insert/select to create new "live" rows based on the templates). Preventing them from displaying in the results was as simple as ensuring that all select statements had a "id > 0" statement in them.. I'm wondering if there are any Bad Things that happen if I use negative integers for primary key values in Postgres (v8.2)? My primary keys are all bigserial type. Any comments or advice? Thanks! Steve