Re: Getting char * from timestamp in a composite type - Mailing list pgsql-general

From Michael Akinde
Subject Re: Getting char * from timestamp in a composite type
Date
Msg-id 47694563.5020009@met.no
Whole thread Raw
In response to Re: Getting char * from timestamp in a composite type  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Getting char * from timestamp in a composite type
List pgsql-general
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 = 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..
Sigh... it's always the idiot bugs that are the hardest to see. Thanks a lot.

Regards,

Michael A.
Attachment

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: referential integrity and defaults, DB design or trick
Next
From: Marco Aurélio V. da Silva
Date:
Subject: Problem with collector statistic