Re: custom type similar to varchar(#)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <list-pgsql-general(at)empires(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: custom type similar to varchar(#)
Date: 2002-08-02 19:54:42
Message-ID: 14717.1028318082@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Davis <list-pgsql-general(at)empires(dot)org> writes:
> I would like to try to emulate the behavior of the old style varchar(#), in
> which it automatically truncated values that were oversized. To do this, it
> occured to me to try making a custom type, but for that I would need to
> accept the numerical argument as part of the type. I could not find any way
> in the documentation to create such a type.

varchar and other types with special syntax require special processing
in the parser. If you're not afraid of yacc grammars then you could
hack up gram.y to add another special type name. On the whole, though,
you might prefer to go and revert the change in the varchar limit-check
routine ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message rob 2002-08-02 19:59:43 design question - newbie
Previous Message scott.marlowe 2002-08-02 19:54:09 Re: How i can empty the buffers of a db