Re: Function args: TEXT -vs- VARCHAR? - Mailing list pgsql-sql

From Tom Lane
Subject Re: Function args: TEXT -vs- VARCHAR?
Date
Msg-id 6365.1384360602@sss.pgh.pa.us
Whole thread Raw
In response to Re: Function args: TEXT -vs- VARCHAR?  (skinner@britvault.co.uk (Craig R. Skinner))
Responses Re: Function args: TEXT -vs- VARCHAR?  (David Johnston <polobo@yahoo.com>)
List pgsql-sql
skinner@britvault.co.uk (Craig R. Skinner) writes:
> On 2013-11-13 Wed 06:34 AM |, Adrian Klaver wrote:
>> The full SQL type syntax is allowed for input arguments and return
>> value. However, some details of the type specification (e.g., the
>> precision field for type numeric) are the responsibility of the
>> underlying function implementation and are silently swallowed (i.e.,
>> not recognized or enforced) by the CREATE FUNCTION command.

> That's rather vague..... "... some details ..."

What's ignored by CREATE FUNCTION (and, indeed, pretty much the entire
type inference mechanism) is typmod.  So any parenthesized modifier for
a type name is not considered.  Usually those are length/precision
constraints, but user-defined types might do something else with them.

> An explicit table of datatype & what's "silently swallowed" would be
> valuable to clarify this topic that's said to be often repeatedly asked.

Can't be asked that often, as that text has been untouched for more
than a dozen years ...
        regards, tom lane



pgsql-sql by date:

Previous
From: skinner@britvault.co.uk (Craig R. Skinner)
Date:
Subject: Re: Function args: TEXT -vs- VARCHAR?
Next
From: David Johnston
Date:
Subject: Re: Function args: TEXT -vs- VARCHAR?