Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tstzrange parentheses #32

Open
benbro opened this issue Dec 15, 2019 · 3 comments
Open

tstzrange parentheses #32

benbro opened this issue Dec 15, 2019 · 3 comments

Comments

@benbro
Copy link
Contributor

benbro commented Dec 15, 2019

tstzrange in PostgreSQL:

tstzrange('2019-12-01 00:00:00+00','2019-12-02 00:00:00+00','[)')

In pgo:

{{{{2019,12,1},{0,0,0}},{{2019,12,2},{0,0,0}}},{true,false}}

Is it possible to remove one pair of parentheses to make the representation closer to PostgreSQL?

{DateTime1, DateTime2, {LowerBound, UpperBound}}

instead of

{{DateTime1, DateTime2}, {LowerBound, UpperBound}}
@tsloughter
Copy link
Collaborator

It would be a change to https://github.com/tsloughter/pg_types in pg_range.erl. I don't really have an opinion either way so would accept a PR to add support to also support this other form.

@benbro
Copy link
Contributor Author

benbro commented Dec 15, 2019

Less parentheses is less verbose to me and match the PostgreSQL structure.
If you think the current form is OK, one form is better than two forms.

@benbro
Copy link
Contributor Author

benbro commented Nov 21, 2020

Do you think we should change the tstzrange parentheses before 1.0.0-rc1 to this?
{DateTime1, DateTime2, {LowerBound, UpperBound}}
If not, this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants