Re: Function parameter type precision modifiers ignored. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Function parameter type precision modifiers ignored.
Date
Msg-id 5361.1423262363@sss.pgh.pa.us
Whole thread Raw
In response to Re: Function parameter type precision modifiers ignored.  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-bugs
David G Johnston <david.g.johnston@gmail.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

pgsql-bugs by date:

Previous
From: David G Johnston
Date:
Subject: Re: Function parameter type precision modifiers ignored.
Next
From: Tom Lane
Date:
Subject: Re: BUG #12739: to_timestamp function conver string to time incorrectly