Re: [GENERAL] Getting char * from timestamp in a composite type

2007-12-20 Thread Michael Akinde
Thanks, though that was an error caused by my attempt to copy-paste some readable example of code from the source file. Matching the correct _out functions in the DirectFunctionCall fixed the segmentation fault problems I was seeing. Regards, Michael A. Tom Lane wrote: Michael Akinde <[EMA

Re: [GENERAL] Getting char * from timestamp in a composite type

2007-12-19 Thread Tom Lane
Michael Akinde <[EMAIL PROTECTED]> writes: >>> bool isNull; >>> HeapTupleHeader t = DatumGetHeapTupleHeader(row); >>> Datum var = GetAttributeByName( row, "time", & isNull ); >>> // Check for null >>> char * ret = DatumGetCString( DirectFunctionCall1(textout, var ) ); >> >> That's not going to wor

Re: [GENERAL] Getting char * from timestamp in a composite type

2007-12-19 Thread Michael Akinde
Martijn van Oosterhout wrote: On Wed, Dec 19, 2007 at 04:40:38PM +0100, Michael Akinde wrote: As I understand it, I should be able to do something like (assuming "time" is the attribute name): bool isNull; HeapTupleHeader t = DatumGetHeapTupleHeader(row); Datum var = GetAttributeBy

Re: [GENERAL] Getting char * from timestamp in a composite type

2007-12-19 Thread Martijn van Oosterhout
On Wed, Dec 19, 2007 at 04:40:38PM +0100, Michael Akinde wrote: > As I understand it, I should be able to do something like (assuming > "time" is the attribute name): > >bool isNull; >HeapTupleHeader t = DatumGetHeapTupleHeader(row); >Datum var = GetAttributeByName( row, "time", & isN