Re: Getting char * from timestamp in a composite type

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Getting char * from timestamp in a composite type
Дата
Msg-id 20071219155210.GA24426@svana.org
обсуждение исходный текст
Ответ на Getting char * from timestamp in a composite type  (Michael Akinde <michael.akinde@met.no>)
Ответы Re: Getting char * from timestamp in a composite type
Список pgsql-general
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@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Erik Jones
Дата:
Сообщение: Re: thank you
Следующее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: referential integrity and defaults, DB design or trick