public inbox for [email protected]
help / color / mirror / Atom feedFrom: Sebastien FLAESCH <[email protected]>
To: [email protected]
Subject: Re: Type scale returned by PQfmod() 65531 for time/timestamp output parameter?
Date: Fri, 16 Feb 2018 09:56:05 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On 02/15/2018 05:25 PM, Tom Lane wrote:
> Sebastien FLAESCH <[email protected]> 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
>
>
Thanks for this quick answer Tom,
I just wanted to make sure that this is expected.
We can deal with this, by interpreting 65531/0xFFFB as a precision of 5 to match our needs.
Would be nice however to have some clear documentation about PQfmod() interpretation...
What means exactly 65531/0xFFFB?
Unknown time/timestamp fraction of sec precision?
Maybe the way stored function output parameters are returned could be reviewed?
select * from proc240(101)
Is it possible to cast() output parameters?
I could not find information about using output parameters in:
https://www.postgresql.org/docs/10/static/sql-syntax-calling-funcs.html
Cheers,
Seb
view thread (11+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Type scale returned by PQfmod() 65531 for time/timestamp output parameter?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox