From: | vinay_15082000(at)hotmail(dot)com (Vinay Jain) |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Create Type Problem |
Date: | 2004-04-02 04:47:50 |
Message-ID: | a17439ed.0404012047.49706493@posting.google.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi
I am newbie so this problem may be too simple to be asked.please help me if
any new thing to be added in following:
I want to use user defined data type in User_Type(n) way....
I created data type IndChar The c functions are:
/* Definaton of Data Type) */
typedef struct IndChar
{
int32 len;
char c_in_str[1];
}IndChar;
then i defined input & output functions.
Input: Datum indcharin(PG_FUNCTION_ARGS);
Output: Datum indcharout(PG_FUNCTION_ARGS);
then i created a function of the same name(i.e. IndChar) as
Datum indchar(PG_FUNCTION_ARGS);//for applying indchar(n) form i.e.fixed length
and i created it using:
create function indchar(IndChar, integer) returns IndChar
language C as 'Path for indchar.so file'
immutable strict;
after these i created data type using:
create type indchar
(input = indcharin,
output = indcharout,
internallength = variable,
storage = extended);
the type is created...
when i use it in Creating Table:
create table temp
(name IndChar(20));
it gives error at character '( '.....
please tell me why it is giving such error...
if some steps needed to alter or add tell me...
thanx in advance
Vinay jain
From | Date | Subject | |
---|---|---|---|
Next Message | BARTKO, Zoltan | 2004-04-02 05:17:14 | Loading text files into a text attribute |
Previous Message | Tom Lane | 2004-04-02 04:09:59 | Re: Select Union |