Re: [HACKERS] typmod is always -1

2016-03-20 Thread Jim Nasby
On 3/17/16 7:40 PM, Tom Lane wrote: Chapman Flack writes: It seems that a typmod can only be used restrict the set of possible values of the unmodified type (as clearly seen in the language "length conversion cast", since certainly a typmod allowing { string | length < N } is doing nothing but

Re: [HACKERS] typmod is always -1

2016-03-19 Thread Tom Lane
Chapman Flack writes: > It seems that a typmod can only be used restrict the set of possible > values of the unmodified type (as clearly seen in the language "length > conversion cast", since certainly a typmod allowing { string | length < N } > is doing nothing but enforcing a subset of { string

Re: [HACKERS] typmod is always -1

2016-03-19 Thread Tom Lane
Chapman Flack writes: > I'm in the same boat ... I have an input function I want to test, and so > far I have failed to think of *any* sql construct that causes it to be > invoked with other than -1 for the typmod. COPY was the first case a quick grep came across. regards

Re: [HACKERS] typmod is always -1

2016-03-19 Thread Chapman Flack
On 03/17/16 09:35, Tom Lane wrote: > Chapman Flack writes: >> I'm in the same boat ... I have an input function I want to test, and so >> far I have failed to think of *any* sql construct that causes it to be >> invoked with other than -1 for the typmod. > > COPY was the first case a quick grep c

[HACKERS] typmod is always -1

2016-03-18 Thread Chapman Flack
nothing like resurrecting a really old thread ... > Pavel Stehule writes: >> I have a problem - every call of mvarcharin is with typmod = -1. 2009/3/17 Tom Lane : > Also, there are a bunch of scenarios where we rely on a cast function to > apply the typmod rather than passing it to the input fun

Re: [HACKERS] typmod is always -1

2009-03-16 Thread Pavel Stehule
2009/3/17 Tom Lane : > Pavel Stehule writes: >> I have a problem - every call of mvarcharin is with typmod = -1. > > Sure your typmod_in function works? > > Also, there are a bunch of scenarios where we rely on a cast function to > apply the typmod rather than passing it to the input function init

Re: [HACKERS] typmod is always -1

2009-03-16 Thread Tom Lane
Pavel Stehule writes: > I have a problem - every call of mvarcharin is with typmod = -1. Sure your typmod_in function works? Also, there are a bunch of scenarios where we rely on a cast function to apply the typmod rather than passing it to the input function initially. I'm not sure if the parti

[HACKERS] typmod is always -1

2009-03-16 Thread Pavel Stehule
Hello I am playing with custom typmod. I did simple wrapper over varchar type. PG_FUNCTION_INFO_V1(mvarcharin); Datum mvarcharin(PG_FUNCTION_ARGS) { elog(NOTICE, "%d", PG_GETARG_INT32(2)); return DirectFunctionCall3(varchar, DirectFunct