Re: Converting a TimestampTz into a C# DateTime - Mailing list pgsql-general

From Arjen Nienhuis
Subject Re: Converting a TimestampTz into a C# DateTime
Date
Msg-id CAG6W84LzZQYj4WanqqvEh-3fDq0XJ=aR2fBsaiwBXr=BuA=L1A@mail.gmail.com
Whole thread Raw
In response to Converting a TimestampTz into a C# DateTime  (valeriof <valerio_farruggio@hotmail.com>)
Responses Re: Converting a TimestampTz into a C# DateTime  (valeriof <valerio_farruggio@hotmail.com>)
List pgsql-general

On Nov 14, 2016 12:53, "valeriof" <valerio_farruggio@hotmail.com> wrote:
>
> Hi,
> I'm handling a TimestampTz value inside a plugin to stream WAL changes to a
> .NET client application. What I'm trying to do is to return all possible
> column changes as binary (don't like to have Postgres handle the conversion
> to string as I may need to have access to the bytes at the client level). In
> case of a TimestampTz, is it possible to return the 8-bytes long integer and
> then from the C# application convert the value to Ticks?

Npgsql supports the binary COPY protocol. Their implementation is here:

https://github.com/npgsql/npgsql/blob/dev/src/Npgsql/TypeHandlers/DateTimeHandlers/TimeStampHandler.cs

pgsql-general by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: Converting a TimestampTz into a C# DateTime
Next
From: Poul Kristensen
Date:
Subject: C code with embedded SQL