Re: Function parameter type precision modifiers ignored.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Function parameter type precision modifiers ignored.
Date: 2015-02-06 22:39:23
Message-ID: 5361.1423262363@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> Tom Lane-2 wrote
>> Attributes applied to function parameter types --- or result types for
>> that matter --- are entirely ignored by Postgres; only the base type
>> matters. This is documented.

> Maybe it would be more obvious in the section detailing "argtype"...but its
> not like its buried deep in the documentation. The bigger problem is
> understanding exactly what that notes means in reality. Often that means
> getting bit by the behavior first and then reading about what just bit you.
> Happens to all of us.

> I'm for the idea of issuing a syntax error upon seeing "type()" in general
> but not strongly since perfectly valid code (often back-stopped by table
> constraints) currently works and would otherwise have no reason to change
> other than to conform to this decision.

Another possibility is to issue a WARNING or NOTICE rather than hard
error.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-02-06 23:12:49 Re: BUG #12739: to_timestamp function conver string to time incorrectly
Previous Message David G Johnston 2015-02-06 22:05:48 Re: Function parameter type precision modifiers ignored.