custom type similar to varchar(#)

From: Jeff Davis <list-pgsql-general(at)empires(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: custom type similar to varchar(#)
Date: 2002-08-02 18:59:32
Message-ID: 200208021159.32790.list-pgsql-general@empires.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I think that this question was adressed before, but I looked around and
couldn't find the answer.

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. It would occur to me that I could
try to use the atttypmod value as varchar appearently does, but I'm not sure
exactly how to do that.

Any suggestions?

Thanks,
Jeff

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Lee Green 2002-08-02 19:00:24 Re: MySQL or Postgres ?
Previous Message scott.marlowe 2002-08-02 18:57:46 Re: MySQL vs. PostgreSQL