Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2ccu-0000zR-Ag for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Oct 2017 12:30:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e2cct-0001fp-Ta for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Oct 2017 12:30:11 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e2YQV-0004Mw-PV; Thu, 12 Oct 2017 08:01:07 +0000 Received: from forward2p.cmail.yandex.net ([2a02:6b8:0:1465::12]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e2YQL-00069V-DO; Thu, 12 Oct 2017 08:01:07 +0000 Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward2p.cmail.yandex.net (Yandex) with ESMTP id 2AAD521B1E; Thu, 12 Oct 2017 11:00:55 +0300 (MSK) Received: from web14j.yandex.ru (web14j.yandex.ru [2a02:6b8:0:1619::314]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Vmf1MH19RG-0sDuesd2; Thu, 12 Oct 2017 11:00:54 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1507795254; bh=4ZlVHa53epwR56xta3iqoYx+srZr1UkFszxbBX0uulE=; h=From:To:In-Reply-To:Subject:Message-Id:Date; b=bEnpSAzEyCMRSx00ti2w/o4mB1ChO4MTesyXNhoyoA62f2IWFRYk9sJqtwXFUsFNz C5QjN3z+AQ9bfLR0+uNhK7ooIMz7VolAiRNuPsB7g5IjpAaBbQaKVb3OEMteTfK6of p2Bu04KAZ9ksF5dWoT15vrSS0u6Ne5puekH3q7jA= Authentication-Results: mxback9g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by web14j.yandex.ru with HTTP; Thu, 12 Oct 2017 11:00:54 +0300 From: KES Envelope-From: kes-kes@yandex.com To: pgsql-hackers@postgresql.org, pgsql-general@postgresql.org In-Reply-To: Subject: Fwd: [BUGS] BUG #14850: Implement optinal additinal parameter for 'justify' date/time function MIME-Version: 1.0 Message-Id: <748681507795254@web14j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 12 Oct 2017 11:00:54 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/html; charset=utf-8 List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org


-------- Пересылаемое сообщение--------
11.10.2017, 17:12, "Pavel Stehule" <pavel.stehule@gmail.com>:

Hi

2017-10-11 12:35 GMT+02:00 <kes-kes@yandex.ru>:
The following bug has been logged on the website:

Bug reference:      14850
Logged by:          Eugen Konkov
Email address:      kes-kes@yandex.ru
PostgreSQL version: 10.0
Operating system:   Linux mint 18: Linux work 4.4.0-57-generic #78-Ubu
Description:

Hi. I try to do next math:

select extract( month from justify_days( timestamp '2016-01-31' +interval '1
month' -timestamp '2016-01-31') );
 date_part
-----------
         0
(1 row)

I expect `1` but get `0`. But here everything is right:

>Adjust interval so 30-day time periods are represented as months

https://www.postgresql.org/docs/9.6/static/functions-datetime.html

But with ability to setup justify date the math will be more sharp.

Please implement next feature:

select extract( month from justify_days( timestamp '2016-01-31' +interval '1
month' -timestamp '2016-01-31'), timestamp '2016-01-31' );
 date_part
-----------
         1
(1 row)

This is useful when I try to calculate how much month are left between
service start and end dates.

This is not the bug, so pgsql-hackers, pgsql-general are better places for this discussion

I am thinking so your request has sense, and should be registered in ToDo list https://wiki.postgresql.org/wiki/Todo

You can try to connect people from PostgreSQL Pro company for implementation.

Regards

Pavel


Thank you.


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


-------- Конец пересылаемого сообщения --------