Re: [GENERAL] Persistence problem

2010-05-15 Thread I. B.
Thanks a lot for the patience and help. It worked. Ivan To: i@live.com CC: klep...@svana.org; dal...@solfertje.student.utwente.nl; pgsql-general@postgresql.org Subject: Re: [GENERAL] Persistence problem Date: Fri, 14 May 2010 18:34:14 -0400 From: t...@sss.pgh.pa.us I. B. i

Re: [GENERAL] Persistence problem

2010-05-14 Thread I. B.
, input = mpoint_in, output = mpoint_out ); Please help, it would mean a lot. Thanks, Ivan To: i@live.com CC: klep...@svana.org; dal...@solfertje.student.utwente.nl; pgsql-general@postgresql.org Subject: Re: [GENERAL] Persistence problem Date: Thu, 13 May 2010 15:08:58 -0400 From: t

Re: [GENERAL] Persistence problem

2010-05-14 Thread I. B.
count on the best Croatian dark beer shipped directly to his place. ;) Ivan From: i@live.com To: t...@sss.pgh.pa.us CC: klep...@svana.org; dal...@solfertje.student.utwente.nl; pgsql-general@postgresql.org Subject: RE: [GENERAL] Persistence problem Date: Fri, 14 May 2010 14:35:34 +0200

Re: [GENERAL] Persistence problem

2010-05-14 Thread Tom Lane
I. B. i@live.com writes: How to fix this? As long as you keep on showing us wrappers, and not the code that actually does the work, we're going to remain in the dark. What you have shown us just copies data from point A to point B, and it looks like it would be fine if the source data

Re: [GENERAL] Persistence problem

2010-05-14 Thread I. B.
-units... I just don't know how I should do it. :-/ I hope you understand the problem better now. Thanks, Ivan To: i@live.com CC: klep...@svana.org; dal...@solfertje.student.utwente.nl; pgsql-general@postgresql.org Subject: Re: [GENERAL] Persistence problem Date: Fri, 14 May 2010 17:32:49

Re: [GENERAL] Persistence problem

2010-05-14 Thread Tom Lane
I. B. i@live.com writes: OK, here is the part of the code. Well, as suspected, you're doing this typedef struct { void *units; } mapping_t; and this units = (uPoint *) realloc(units, result-noOfUnits * sizeof(uPoint)); // EXPLAINED AT THE END OF THE POST which means

Re: [GENERAL] Persistence problem

2010-05-13 Thread Martijn van Oosterhout
On Thu, May 13, 2010 at 12:04:56PM +0200, I. B. wrote: I'll try to explain with as less code as possible. One of the types I wanted to create is called mpoint. This is a part of code: snip typedef struct { int4 length; int noOfUnits; void *units; // this is later casted to

Re: [GENERAL] Persistence problem

2010-05-13 Thread I. B.
...@solfertje.student.utwente.nl; pgsql-general@postgresql.org Subject: Re: [GENERAL] Persistence problem On Thu, May 13, 2010 at 12:04:56PM +0200, I. B. wrote: I'll try to explain with as less code as possible. One of the types I wanted to create is called mpoint. This is a part of code

Re: [GENERAL] Persistence problem

2010-05-13 Thread I. B.
copied the memory into a new variable? Ivan From: i@live.com To: klep...@svana.org CC: dal...@solfertje.student.utwente.nl; pgsql-general@postgresql.org Subject: RE: [GENERAL] Persistence problem Date: Thu, 13 May 2010 12:04:56 +0200 I'll try to explain with as less code as possible. One

Re: [GENERAL] Persistence problem

2010-05-13 Thread I. B.
...@svana.org To: i@live.com CC: dal...@solfertje.student.utwente.nl; pgsql-general@postgresql.org Subject: Re: [GENERAL] Persistence problem On Wed, May 12, 2010 at 07:12:10PM +0200, I. B. wrote: That was my first guess. I used palloc everywhere.. But to be sure, after I made the type

Re: [GENERAL] Persistence problem

2010-05-13 Thread Tom Lane
I. B. i@live.com writes: When I do this: realResult = (mPoint *)palloc(result-length); memcpy(realResult, result, result-length); I get a right result in the same session, but corrupted in the next one. I'm guessing a bit here, but I think what is happening is this: typedef

[GENERAL] Persistence problem

2010-05-12 Thread I. B.
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.

Re: [GENERAL] Persistence problem

2010-05-12 Thread Alban Hertroys
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

Re: [GENERAL] Persistence problem

2010-05-12 Thread I. B.
. Is that enough? Subject: Re: [GENERAL] Persistence problem From: dal...@solfertje.student.utwente.nl Date: Wed, 12 May 2010 19:05:36 +0200 CC: pgsql-general@postgresql.org To: i@live.com On 12 May 2010, at 18:08, I. B. wrote: Hello. I have a problem. I've created several types

Re: [GENERAL] Persistence problem

2010-05-12 Thread Martijn van Oosterhout
On Wed, May 12, 2010 at 07:12:10PM +0200, I. B. wrote: 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