Re: Storing a time interval

From: Pankaj Jangid <pankaj(dot)jangid(at)gmail(dot)com>
To: Steve Baldwin <steve(dot)baldwin(at)gmail(dot)com>
Cc: Michael Lewis <mlewis(at)entrata(dot)com>, stan <stanb(at)panix(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Storing a time interval
Date: 2019-11-09 07:58:18
Message-ID: m28sopqy5h.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steve Baldwin <steve(dot)baldwin(at)gmail(dot)com> writes:
> I agree with Michael. Another consideration is how the composite type is
> going to be handled in the DB layer of your processing code (e.g. node,
> python, ...). In the scenario you described it seems unlikely you will be
> either having multiple columns of that type on your PO table, or using that
> composite type on a different table, so apart from the 'interest' factor,
> I'm not seeing any practical benefit. Composite types are also slightly
> painful in the change they bring to the way you reference them. For example
> typically you need to surround the outer column in brackets - e.g.
> (dates).discount_last_date. If you are using an ORM library, does it know
> how to deal with that?
>

I faced a similar issue when using Enums with with rust lang. The Diesel
ORM didn't support it directly. Had to struggle with custom code in the
Model layer.

--
Pankaj Jangid

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2019-11-09 08:18:21 Re: logical replication - negative bitmapset member not allowed
Previous Message Israel Brewster 2019-11-08 23:27:51 Merge sort/postgis performance tweaking?