From: | "Rodrigo Sakai" <rodrigo(dot)sakai(at)poli(dot)usp(dot)br> |
---|---|
To: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | ERROR: index row size |
Date: | 2007-06-04 03:01:55 |
Message-ID: | 000f01c7a654$b8c0df60$6500a8c0@NOTEBOOKSAKAI |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello,
Ok, I give up! Tried a lot of things in my code! But still get error on
index row size. So, I'm part of my code, if someone could help me! A valid
value for this type is: '(03-jan-2007 , 15-may-2010)'
typedef struct t_periodo
{
DateADT tvi;
DateADT tvf;
} Periodo;
Datum
periodo_in(PG_FUNCTION_ARGS)
{
char *str = PG_GETARG_CSTRING(0);
char tvi_char[MAXDATEFIELDS];
char tvf_char[MAXDATEFIELDS];
tvi_char = (char *) palloc(strlen(MAXDATEFIELDS));
tvf_char = (char *) palloc(strlen(MAXDATEFIELDS));
Periodo *result;
if (sscanf(str, " ( %s , %s )", tvi_char, tvf_char) != 2)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for periodo: \"%s\"", str)));
result->tvi = StringToDateADT(tvi_char);
result->tvi = StringToDateADT(tvf_char);
result = (Periodo *) palloc(sizeof(Periodo));
if (result->tvi > result->tvf)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("Initial date (TVi) must be smaller than final date
(TVf)")));
PG_RETURN_POINTER(result);
}
Please help me!
Thanks in advance!
From | Date | Subject | |
---|---|---|---|
Next Message | Jeremy Drake | 2007-06-04 03:22:30 | Re: ERROR: index row size |
Previous Message | Tom Lane | 2007-06-04 02:44:13 | Re: What is happening on buildfarm member baiji? |