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 1iTLdf-0003dK-Bm for pgsql-general@arkaria.postgresql.org; Sat, 09 Nov 2019 07:58:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iTLdb-0001Tz-TY for pgsql-general@arkaria.postgresql.org; Sat, 09 Nov 2019 07:58:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iTLdb-0001Ts-EF for pgsql-general@lists.postgresql.org; Sat, 09 Nov 2019 07:58:27 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iTLdY-0007dr-9k for pgsql-general@postgresql.org; Sat, 09 Nov 2019 07:58:25 +0000 Received: by mail-pl1-x642.google.com with SMTP id y24so5320179plr.12 for ; Fri, 08 Nov 2019 23:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version; bh=IpP7mNGrwo+WMlz2QggRQzUueE/0VuHoyWJFBzVAijw=; b=ir3BYJD3JwrDPZOxz1sdRBcQZE1pI+H5nx2Y9tR8aiXvu7V56X/4z84g7QYPBlEkoG mWtvXL2lLH9Wy8psJWdupqCjbHFQKytwnQ/0pNzd62AWuXgv/wWjQBQm8gGtqPcRsJIX jF8tgqefB65t1ZMhX215qOv82rJfOTm1FIccmPvzms7sA9gFRk2p+ZznvEIOm1T4JI3d mrCK1wCXoX+BYFv4CUAhLpIimRaSHSYCiZHSjACYPUnyaM/7bXyUI/GFMQDOk5oT61qo +yveItQFNgE32tXoXB9sFouKjQOma2D81HoxmvL8gjVqd5R38wePAtFWbFHW867viFtZ PGCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version; bh=IpP7mNGrwo+WMlz2QggRQzUueE/0VuHoyWJFBzVAijw=; b=iEMuJZN7Nf74HkdXqE0dWpFB2r9UBGSWK5tLVgXlP4Y1d1ZbAd12RGoh2VdLmGTOjA U4ZsI8CdXZWPj4jo9KYv0+2KRvYhkvJSeIKl351TMWk4HyLUrXE55JNzdNQon1r7Z5r9 yJIxwagMzDm62HeyWkveUdiPvOtTPwhHv2u03KxaaoHahNI5q5GH5VXb2dc5uvuJ9JvW uyge5RYeLBkUaJuGJBPug1DZJntY76RX4wth3985VIdfUN6XBnoEAo+rEaL7h1RZNP8z MWbdPUUgSpZU8DEdSM6X6HpryrcG0ksPbyYH+VNOKs8ltMPcVgev5mkQmQt4f4aWns/H uxLA== X-Gm-Message-State: APjAAAUY1Fs3xNAsFf6Zgtgt/lxCBc2ieMudCckg24xXnjcWQ/yEtvS2 HL7wl/nnSDIkDiXJfUkJJg== X-Google-Smtp-Source: APXvYqzwrlrW5iBKEyLz7p9soXz7lgUpPu5fzPpK2ugQD+bIyvsebDmVk1ZiCdNLYqjZEpmSPuNpDg== X-Received: by 2002:a17:902:346:: with SMTP id 64mr15260599pld.283.1573286302714; Fri, 08 Nov 2019 23:58:22 -0800 (PST) Received: from Pankajs-MacBook-Pro.local ([49.36.130.142]) by smtp.gmail.com with ESMTPSA id i71sm11355584pfe.103.2019.11.08.23.58.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Nov 2019 23:58:21 -0800 (PST) Received: by Pankajs-MacBook-Pro.local (Postfix, from userid 501) id 7ED0C203DDC22B; Sat, 9 Nov 2019 13:28:18 +0530 (IST) From: Pankaj Jangid To: Steve Baldwin Cc: Michael Lewis , stan , Adrian Klaver , pgsql-general Subject: Re: Storing a time interval Organization: Code is Great! References: <20191108194307.GA16920@panix.com> <143433ed-b3f2-2749-4ae8-d282dcb7f3ce@aklaver.com> <20191108203849.GA5401@panix.com> Date: Sat, 09 Nov 2019 13:28:18 +0530 In-Reply-To: (Steve Baldwin's message of "Sat, 9 Nov 2019 08:20:26 +1100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Steve Baldwin 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