Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1emMPW-0007UB-RX for pgsql-interfaces@arkaria.postgresql.org; Thu, 15 Feb 2018 16:29:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emMPV-0000QW-Ml for pgsql-interfaces@arkaria.postgresql.org; Thu, 15 Feb 2018 16:29:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1emMPV-0000PA-ED for pgsql-interfaces@lists.postgresql.org; Thu, 15 Feb 2018 16:29:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1emMMH-00039y-ID for pgsql-interfaces@lists.postgresql.org; Thu, 15 Feb 2018 16:26:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1FGPeAZ007538; Thu, 15 Feb 2018 11:25:40 -0500 From: Tom Lane To: Sebastien FLAESCH cc: pgsql-interfaces@lists.postgresql.org Subject: Re: Type scale returned by PQfmod() 65531 for time/timestamp output parameter? In-reply-to: <093e1214-7057-f80c-5c3c-74076b7bb555@4js.com> References: <093e1214-7057-f80c-5c3c-74076b7bb555@4js.com> Comments: In-reply-to Sebastien FLAESCH message dated "Thu, 15 Feb 2018 16:03:22 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7536.1518711940.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 15 Feb 2018 11:25:40 -0500 Message-ID: <7537.1518711940@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Sebastien FLAESCH writes: > When using a stored function returning output parameters defined with as= time[(n)] > or timestamp[(n)], PQfmod() always returns the same SCALE (65531/0xFFFB)= , no matter > what time/timestamp precision is used. Your misunderstanding is in assuming that typmod decoration on function parameters means anything. It doesn't; the function is effectively just declared as taking or returning plain time or timestamp. Perhaps someday that will change, but it'd be a big task with a lot of hard decisions to make. For instance, do we allow creation of both f(time(2)) and f(time(4)), and if so what's the rule for choosing which one to call? regards, tom lane