Search Postgresql Archives

Re: Getting char * from timestamp in a composite type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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", & isNull );
>    // Check for null
>    char * ret = DatumGetCString( DirectFunctionCall1(textout, var ) );

That's not going to work. textout wants a text datum. Try calling
timestamp_out instead...

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux