Re: type aliases

From: James Harper <james(dot)harper(at)bendigoit(dot)com(dot)au>
To: Behrang Saeedzadeh <behrangsa(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: type aliases
Date: 2014-02-15 09:50:08
Message-ID: 6035A0D088A63A46850C3988ED045A4B6F3A5552@BITCOM1.int.sbss.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> You probably should define your domain like this:
>
> CREATE DOMAIN myvarchar varchar(42);
>

That's what I thought, so it won't do what I want. I need to be able to set the length at the time of declaration.

So suppose I wanted to implement myvarchar in C. In my _in function, how do I know how big my column declaration is? Eg if someone tries to insert 50 characters into my 42 character field, how do I get the declared length and then tell postgres that the data to be inserted is too big?

Thanks

James

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Clemens Eisserer 2014-02-15 11:03:11 Will modifications to unlogged tables also be flused to disk?
Previous Message Behrang Saeedzadeh 2014-02-15 09:20:16 Re: type aliases