text coverage for EXTRACT()

Started by Peter Eisentrautalmost 6 years ago4 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

During the discussion in [0]/messages/by-id/42b73d2d-da12-ba9f-570a-420e0cce19d9@phystech.edu I noticed that the extract()/date_part()
variants for time, timetz, and interval had virtually no test coverage.
So I put some more tests together, which should be useful if we decide
to make any changes in this area per [0]/messages/by-id/42b73d2d-da12-ba9f-570a-420e0cce19d9@phystech.edu.

[0]: /messages/by-id/42b73d2d-da12-ba9f-570a-420e0cce19d9@phystech.edu
/messages/by-id/42b73d2d-da12-ba9f-570a-420e0cce19d9@phystech.edu

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

0001-Add-test-coverage-for-EXTRACT.patchtext/plain; charset=UTF-8; name=0001-Add-test-coverage-for-EXTRACT.patch; x-mac-creator=0; x-mac-type=0Download+250-25
#2Vik Fearing
vik@postgresfriends.org
In reply to: Peter Eisentraut (#1)
Re: text coverage for EXTRACT()

On 6/9/20 1:36 PM, Peter Eisentraut wrote:

During the discussion in [0] I noticed that the extract()/date_part()
variants for time, timetz, and interval had virtually no test coverage.
So I put some more tests together, which should be useful if we decide
to make any changes in this area per [0].

These look straightforward to me.

Looking at that big table, I see everything is 0-based except the
quarter. That seems unfortunate, and if this were a new feature I'd
lobby to have it changed. I don't think we can do anything about it
now, though.
--
Vik Fearing

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Vik Fearing (#2)
Re: text coverage for EXTRACT()

Vik Fearing <vik@postgresfriends.org> writes:

On 6/9/20 1:36 PM, Peter Eisentraut wrote:

During the discussion in [0] I noticed that the extract()/date_part()
variants for time, timetz, and interval had virtually no test coverage.
So I put some more tests together, which should be useful if we decide
to make any changes in this area per [0].

These look straightforward to me.

+1 here as well.

Looking at that big table, I see everything is 0-based except the
quarter. That seems unfortunate, and if this were a new feature I'd
lobby to have it changed. I don't think we can do anything about it
now, though.

Yeah, that ship has sailed :-(

regards, tom lane

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#3)
Re: text coverage for EXTRACT()

On 2020-06-09 16:11, Tom Lane wrote:

Vik Fearing <vik@postgresfriends.org> writes:

On 6/9/20 1:36 PM, Peter Eisentraut wrote:

During the discussion in [0] I noticed that the extract()/date_part()
variants for time, timetz, and interval had virtually no test coverage.
So I put some more tests together, which should be useful if we decide
to make any changes in this area per [0].

These look straightforward to me.

+1 here as well.

committed

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services