Jumping Weekends

From: Ranieri Mazili <ranieri(dot)oliveira(at)terra(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Jumping Weekends
Date: 2007-06-04 11:01:40
Message-ID: 4663F114.4030903@terra.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ivan.hou 2007-06-04 11:15:12 Auto Vacuum question?
Previous Message Marco Colombo 2007-06-04 10:55:04 Re: PITR Base Backup on an idle 8.1 server

Browse pgsql-sql by date

  From Date Subject
Next Message Pavel Stehule 2007-06-04 12:15:08 Re: [SQL] Jumping Weekends
Previous Message christian.roche.ext 2007-06-04 10:40:18 Re: Versionning (was: Whole-row comparison)