From: | "I(dot) B(dot)" <i(dot)bre(at)live(dot)com> |
---|---|
To: | <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Persistence problem |
Date: | 2010-05-12 17:12:10 |
Message-ID: | SNT128-W268D0D35BCB9530B9F2A291FB0@phx.gbl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
That was my first guess. I used palloc everywhere.. But to be sure, after I made the type, I tried to do the something like:
mytype * result;
mytype * realResult;
result = createType(...);
realResult = (mytype *)palloc(mytype->length);
mempcy (realResult, result, result->length);
It didn't help. Is that enough?
> Subject: Re: [GENERAL] Persistence problem
> From: dalroi(at)solfertje(dot)student(dot)utwente(dot)nl
> Date: Wed, 12 May 2010 19:05:36 +0200
> CC: pgsql-general(at)postgresql(dot)org
> To: i(dot)bre(at)live(dot)com
>
> On 12 May 2010, at 18:08, I. B. wrote:
>
> > Hello.
> >
> > I have a problem. I've created several types and functions in C language and implemented them successfully. Or at least I thought so... When I insert, select, update data, everything works fine, but in that session only. As soon as I close psql and start it agan, the data is corrupted. Is there some common mistake I might have made? Code is pretty big, so I don't think it would do any good if I put it here...
>
> That sounds like what the documentation warns you about if you modify a structure directly from postgres without using palloc.
>
> Alban Hertroys
>
> --
> If you can't see the forest for the trees,
> cut the trees and you'll see there is no forest.
>
>
> !DSPAM:1077,4beadfe710418634015713!
>
>
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2010-05-12 17:45:26 | Re: Persistence problem |
Previous Message | Alban Hertroys | 2010-05-12 17:05:36 | Re: Persistence problem |