pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Raul Kaubi <raulkaubi@gmail.com>
Cc: Yasin Sari <yasinsari81@googlemail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Declare variable from other variable
Date: Wed, 5 Feb 2020 13:50:43 +0100
Message-ID: <20200205125043.GA32676@depesz.com> (raw)
In-Reply-To: <CAO_+3-CEM0_GTqYxYVFLKenJjzn+K=BqBLur2jx5hH_1SCZUgA@mail.gmail.com>
References: <CAO_+3-BRGqQXs4SNi8eaEyBNbzCODFVYJvDVJZBEDSQtA+68qg@mail.gmail.com>
	<CADhAfgMa-6cD3bXXJS_6HGp+4JZ_mBdSYNNynsqEr0wYgGpnug@mail.gmail.com>
	<CAO_+3-CEM0_GTqYxYVFLKenJjzn+K=BqBLur2jx5hH_1SCZUgA@mail.gmail.com>

On Wed, Feb 05, 2020 at 02:42:42PM +0200, Raul Kaubi wrote:
> Thanks, it worked!
> 
> By the way, what does this "**j"* mean there..? (this does not mean
> multiply there?)

it's normal multiplication.

Your "j" variable is integer.

So, '1 month'::interval * j is some number of months.
> And what if, I would like to declare v_to_date also, so that v_to_date is
> always + 1 month compared to v_date_from..?

v_to_date := v_from_date + '1 month'::interval; ?

Best regards,

depesz






view thread (6+ messages)  latest in thread

Message-ID: <20200205125043.GA32676@depesz.com>
Permalink:  ../20200205125043.GA32676@depesz.com/
Also on:    postgresql.org/message-id/20200205125043.GA32676@depesz.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: depesz@depesz.com, raulkaubi@gmail.com, yasinsari81@googlemail.com
  Subject: Re: Declare variable from other variable
  In-Reply-To: <20200205125043.GA32676@depesz.com>
  References: <CAO_+3-BRGqQXs4SNi8eaEyBNbzCODFVYJvDVJZBEDSQtA+68qg@mail.gmail.com> <CADhAfgMa-6cD3bXXJS_6HGp+4JZ_mBdSYNNynsqEr0wYgGpnug@mail.gmail.com> <CAO_+3-CEM0_GTqYxYVFLKenJjzn+K=BqBLur2jx5hH_1SCZUgA@mail.gmail.com> <20200205125043.GA32676@depesz.com>

* 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