X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id EB63E9FA5E9 for ; Mon, 24 Jul 2006 10:05:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 31228-09 for ; Mon, 24 Jul 2006 13:05:50 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 0F7439FA5BF for ; Mon, 24 Jul 2006 10:05:49 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k6OD5XHA014788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Jul 2006 07:05:35 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k6OD5XNm024543; Mon, 24 Jul 2006 07:05:33 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k6OD5Wap024542; Mon, 24 Jul 2006 07:05:32 -0600 (MDT) (envelope-from mfuhr) Date: Mon, 24 Jul 2006 07:05:32 -0600 From: Michael Fuhr To: Mario Splivalo Cc: pgsql-sql@postgresql.org Subject: Re: Primary key constraint violation without error? Message-ID: <20060724130532.GA24454@winnie.fuhr.org> References: <1153743159.28381.15.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1153743159.28381.15.camel@localhost.localdomain> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/296 X-Sequence-Number: 25870 On Mon, Jul 24, 2006 at 02:12:39PM +0200, Mario Splivalo wrote: > Now I run the function again: > > l_netsms=# select punimessages(); > NOTICE: Ubacili smo za usera 4162. > NOTICE: Ubacili smo za usera 4161. > NOTICE: Ubacili smo za usera 4160. > NOTICE: Ubacili smo za usera 4159. > NOTICE: Ubacili smo za usera 4158. > punimessages > -------------- > t > (1 row) > > Shouldn't I get errors that I'm violating primary key constraint when > INSERTing again same data? No, because punimessages() has a truncate statement that empties the table each time the function is called. Should that truncate statement be there? -- Michael Fuhr