Re: type aliases - Mailing list pgsql-general

From James Harper
Subject Re: type aliases
Date
Msg-id 6035A0D088A63A46850C3988ED045A4B6F3A5552@BITCOM1.int.sbss.com.au
Whole thread Raw
In response to Re: type aliases  (Behrang Saeedzadeh <behrangsa@gmail.com>)
Responses Re: type aliases
List 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
ifsomeone tries to insert 50 characters into my 42 character field, how do I get the declared length and then tell
postgresthat the data to be inserted is too big? 

Thanks

James



pgsql-general by date:

Previous
From: Behrang Saeedzadeh
Date:
Subject: Re: type aliases
Next
From: Clemens Eisserer
Date:
Subject: Will modifications to unlogged tables also be flused to disk?