Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izK8n-0007kQ-0Y for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2020 12:50:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izK8l-0000Bj-Lj for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2020 12:50:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izK8l-0000Bb-Ao for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2020 12:50:47 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1izK8j-00077c-71 for pgsql-general@postgresql.org; Wed, 05 Feb 2020 12:50:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=wqMIj0gD6EKrds1bxQwir7FhOq4uiTVmVr1S/JlZ+Es=; b=nYb4PJ9eMIvsd2TXOB1XoGyaVJ y1wfbNApvU1S2miy6qV++PC2f9qY1YfOV1fAGaqOqbXPxCy/XugeNfL/3v/XcJcMZy5/bZkeTRglk d0y8aFTwUugbwy/QdaUu8/Uxga+DeT8ZYsTnqA/9Xjtq28CAbDPJcTOd7moJlQSkZiF8=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1izK8h-0007Fk-LN; Wed, 05 Feb 2020 13:50:43 +0100 Date: Wed, 5 Feb 2020 13:50:43 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Raul Kaubi Cc: Yasin Sari , pgsql-general Subject: Re: Declare variable from other variable Message-ID: <20200205125043.GA32676@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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