Search Postgresql Archives

Re: Getting char * from timestamp in a composite type

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

 



Michael Akinde <michael.akinde@xxxxxx> 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 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.

The other problem is that you're passing row not t to
GetAttributeByName.  If you don't have your compiler configured to bleat
about type mismatches like that, your days of C programming will be
bleak and painful.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[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