X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 07F449DCA27 for ; Sun, 12 Feb 2006 18:27:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39856-02 for ; Sun, 12 Feb 2006 18:27:32 -0400 (AST) X-Greylist: delayed 00:05:01.781956 by SQLgrey- Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.200.81]) by postgresql.org (Postfix) with ESMTP id ACDFC9DC9E6 for ; Sun, 12 Feb 2006 18:27:28 -0400 (AST) Received: from cfgod (c-69-137-84-227.hsd1.tn.comcast.net[69.137.84.227]) by comcast.net (sccrmhc11) with SMTP id <2006021222222801100fnf8ue>; Sun, 12 Feb 2006 22:22:28 +0000 From: "Foster, Stephen" To: Subject: Trigger/Sequence headache Date: Sun, 12 Feb 2006 16:27:48 -0600 Message-ID: <000801c63023$8e0af830$2101a8c0@cfgod> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0009_01C62FF1.43708830" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.091 required=5 tests=[AWL=-0.242, HTML_MESSAGE=0.001, RCVD_IN_BL_SPAMCOP_NET=1.332] X-Spam-Score: 1.091 X-Spam-Level: * X-Archive-Number: 200602/128 X-Sequence-Number: 24138 This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C62FF1.43708830 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This is going to be one of those stupid problems of mine. I have an insert trigger setup to verify that duplicate or repeating information isn't storage in the table. If trigger function finds the information as a duplicate it returns a NULL and the information isn't added; that works. The problem I'm having is that it is incrementing the sequence counter even when the data isn't added. Is this something that I have to live with or should I be returning something other than a NULL? I have a function to re-sequence the table and reset the sequence counter in another application. Normal for that application because of the constant adding and deleting. So if there isn't another answer then I can write a version of that for this application and run it weekly/monthly depending on need and use. It just drives me nuts with large holes in the table. Thanks Lee Foster/ ------=_NextPart_000_0009_01C62FF1.43708830 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

This is going to be one of those stupid problems of mine.  I have an insert = trigger setup to verify that duplicate or repeating information isn’t = storage in the table.  If trigger = function finds the information as a duplicate it returns a NULL and the information = isn’t added; that works.  The = problem I’m having is that it is incrementing the sequence counter even when the = data isn’t added.  Is this something = that I have to live with or should I be returning something other than a = NULL?

 

I have a function to re-sequence the table and reset = the sequence counter in another application.  Normal for that application because of the constant adding and deleting.  So if there isn’t another = answer then I can write a version of that for this application and run it = weekly/monthly depending on need and use.  = It just drives me nuts with large holes in the = table.

 

Thanks

 

Lee Foster/

------=_NextPart_000_0009_01C62FF1.43708830--