Re: [GENERAL] Converting a TimestampTz into a C# DateTime

2016-11-15 Thread valeriof
Awesome. Thanks everybody for your help -- View this message in context: http://postgresql.nabble.com/Converting-a-TimestampTz-into-a-C-DateTime-tp5930221p5930465.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general

Re: [GENERAL] Converting a TimestampTz into a C# DateTime

2016-11-15 Thread Albe Laurenz
valeriof wrote: > BTW, a comment says this about the floating point representation: "A > deprecated compile-time option of PostgreSQL switches to a floating-point > representation of some date/time > fields. Npgsql (currently) does not support this mode." Is it safe to say > that the floating point

Re: [GENERAL] Converting a TimestampTz into a C# DateTime

2016-11-15 Thread valeriof
I was able to make it work by reusing the code in TimeStampHandler.cs (in my application I cannot directly reference Npgsql): long datetime = GetInt64(buffer, ref pos); // 8 bytes: datetime if (datetime == long.MaxValue) return

Re: [GENERAL] Converting a TimestampTz into a C# DateTime

2016-11-14 Thread Arjen Nienhuis
On Nov 14, 2016 12:53, "valeriof" 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 m

Re: [GENERAL] Converting a TimestampTz into a C# DateTime

2016-11-14 Thread Tom Lane
Jerome Wagner writes: > seeing you answer I have a question for which I found no answer a few weeks > ago : is there a way to know at runtime which internal representation > timestamps have ? You can inspect the integer_datetimes setting, via SHOW or current_setting(). In a libpq client it's als

Re: [GENERAL] Converting a TimestampTz into a C# DateTime

2016-11-14 Thread Albe Laurenz
Jerome Wagner wrote: > seeing you answer I have a question for which I found no answer a few weeks > ago : is there a way to > know at runtime which internal representation timestamps have ? > I am trying to deal with the COPY binary protocol with only SQL access to the > remote server and would

Re: [GENERAL] Converting a TimestampTz into a C# DateTime

2016-11-14 Thread Jerome Wagner
Hello, seeing you answer I have a question for which I found no answer a few weeks ago : is there a way to know at runtime which internal representation timestamps have ? I am trying to deal with the COPY binary protocol with only SQL access to the remote server and would like to find a way to know

Re: [GENERAL] Converting a TimestampTz into a C# DateTime

2016-11-14 Thread Albe Laurenz
valeriof wrote: > 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 byte

[GENERAL] Converting a TimestampTz into a C# DateTime

2016-11-14 Thread valeriof
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 leve