pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ranieri Mazili <ranieri.oliveira@terra.com.br>
To: pgsql-general@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Jumping Weekends
Date: Mon, 04 Jun 2007 08:01:40 -0300
Message-ID: <4663F114.4030903@terra.com.br> (raw)

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






view thread (2+ messages)  latest in thread

Message-ID: <4663F114.4030903@terra.com.br>
Permalink:  ../4663F114.4030903@terra.com.br/
Also on:    postgresql.org/message-id/4663F114.4030903@terra.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ranieri.oliveira@terra.com.br, pgsql-general@postgresql.org
  Subject: Re: Jumping Weekends
  In-Reply-To: <4663F114.4030903@terra.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox