From: | Dragos Manzateanu <dragon(at)mail(dot)dntis(dot)ro> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: date_in function |
Date: | 2002-04-16 19:32:15 |
Message-ID: | 200204161926.g3GJQl201818@mail.dntis.ro |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tuesday 16 April 2002 05:48 pm, you wrote:
> I want to change the date from a field in a tuple in a trigger_function
>
> create table example (
> my_date datetime
> ...
> );
>
> int na;
> char select[20];
>
> na = SPI_fnumber(trigdata->tg_relation->rd_att, "my_date");
> memset(select, 0, sizeof(select));
> sprintf(select, "1/1/2002");
> newval = DirectFunctionCall1(date_in, CStringGetDatum(select));
> rettuple = SPI_modifytuple(trigdata->tg_relation, rettuple, 1, &na,
> &newval, NULL);
> if(rettuple == NULL) elog(ERROR, "my_function: %d returned by
> SPI_modifytuple", SPI_result);
>
> when i test that my server goes down. What I missed ?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
Not my function is about, but date_in.
Have anybody worked with these ?
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2002-04-16 21:27:21 | Re: [PATCHES] WITH DELIMITERS in COPY |
Previous Message | Hannu Krosing | 2002-04-16 19:18:31 | Re: multibyte support by default |