Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 55AE69FBBEE; Mon, 4 Jun 2007 08:01:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41018-08; Mon, 4 Jun 2007 08:01:43 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bundure.hst.terra.com.br (bundure.hst.terra.com.br [200.176.10.195]) by postgresql.org (Postfix) with ESMTP id 45EF29FBBED; Mon, 4 Jun 2007 08:01:43 -0300 (ADT) Received: from quebec.hst.terra.com.br (quebec.hst.terra.com.br [200.176.10.31]) by bundure.hst.terra.com.br (Postfix) with ESMTP id E6E099A027B; Mon, 4 Jun 2007 08:01:40 -0300 (BRT) X-Terra-Karma: -2% X-Terra-Hash: 1bae6f11e4eb1dfa6681481ea5bf0caf Received-SPF: pass (quebec.hst.terra.com.br: domain of terra.com.br designates 200.176.10.31 as permitted sender) client-ip=200.176.10.31; envelope-from=ranieri.oliveira@terra.com.br; helo=[172.16.2.72]; Received: from [172.16.2.72] (200-162-219-207.corp.ajato.com.br [200.162.219.207]) (authenticated user ranieri.oliveira) by quebec.hst.terra.com.br (Postfix) with ESMTP id 1264868056; Mon, 4 Jun 2007 08:01:39 -0300 (BRT) Message-ID: <4663F114.4030903@terra.com.br> Date: Mon, 04 Jun 2007 08:01:40 -0300 From: Ranieri Mazili User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Jumping Weekends 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=1.909 tagged_above=0 required=5 tests=BAYES_50=0.001, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708 X-Spam-Level: * X-Archive-Number: 200706/299 X-Sequence-Number: 115122 Hello, (sorry for my poor english) It's my first post here, and my doubt is very simple (I guess). I have a function to populate a table, into "WHILE" I have the follow piece of code: --Jump Weekend IF (SELECT TO_CHAR(CAST(PRODUCTION_DATE as date),'Day')) = 'Saturday' THEN PRODUCTION_DATE := PRODUCTION_DATE + 2; END IF; It's to jump weekend adding 2 days on the variable "PRODUCTION_DATE", the type of the variable is "DATE". But, I don't know why, it's doesn't work properly, it's doesn't jump weekends, it's continues normally, someone knows what's happen or what am I doing wrong? I appreciate any help. Thanks Ranieri Mazili