From: | "Gurunandan R(dot) Bhat" <grbhat(at)exocore(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Dumping variables..A sort of serialize |
Date: | 2001-10-03 17:06:33 |
Message-ID: | Pine.LNX.4.33.0110032208310.3819-100000@suman.greenfields.universe |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
I am currently struggling to write a "serialize"-like function
that would dump a row of a table into a string-like object in a way that
would allow me to reconstruct the original row (or its individual
elements) from this object.
The tentative plan I have is something like this:
1) Write a C-function declared something like so:
Datum serialise(PG_FUNCTION_ARGS)
2) Inside the function, get the pointer to the row using:
TupleTableSlot *row = PG_GETARGPOINTER(0);
3) Use GetAttributeByName to get the "Datum" value corresponding
to each of the attributes.
This is where I am stuck. What I want to do now is to use this datum value
returned by GetAttributeByName to get at the "glob of memory" occupied by
the attribute and "memmove" it into an area declared as text. I could then
store this text as a row in a table. Is this at all possible or am I
talking through my hat ;)
I am sorry I dont understand the backend variable storage and
types too well and would be grateful for some help.
Regards and Thanks,
Gurunandan
From | Date | Subject | |
---|---|---|---|
Next Message | Keary Suska | 2001-10-03 18:35:48 | Re: From Mysql to Postgre, how to do that? |
Previous Message | Mark Gordon | 2001-10-03 16:34:31 | Scalability of postgresql. |