Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-24 Thread Robert Haas
On Wed, Feb 19, 2014 at 8:06 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 20, 2014 at 9:43 AM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 20, 2014 at 2:47 AM, Robert Haas robertmh...@gmail.com wrote: On Wed, Feb 5, 2014 at 9:26 PM, Michael Paquier

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-24 Thread Robert Haas
On Wed, Feb 19, 2014 at 8:27 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 20, 2014 at 8:55 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-02-19 12:47:40 -0500, Robert Haas wrote: On Wed, Feb 5, 2014 at 9:26 PM, Michael Paquier michael.paqu...@gmail.com wrote:

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-24 Thread Michael Paquier
On Tue, Feb 25, 2014 at 12:41 AM, Robert Haas robertmh...@gmail.com wrote: On Wed, Feb 19, 2014 at 8:27 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 20, 2014 at 8:55 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-02-19 12:47:40 -0500, Robert Haas wrote: On

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Robert Haas
On Fri, Feb 14, 2014 at 9:32 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 6, 2014 at 11:26 AM, Michael Paquier michael.paqu...@gmail.com wrote: Here are updated patches to use pg_lsn instead of pglsn... Should I register this patch somewhere to avoid having it lost in the

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Andres Freund
On 2014-02-19 09:24:03 -0500, Robert Haas wrote: On Fri, Feb 14, 2014 at 9:32 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 6, 2014 at 11:26 AM, Michael Paquier michael.paqu...@gmail.com wrote: Here are updated patches to use pg_lsn instead of pglsn... Should I

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Robert Haas
On Wed, Feb 19, 2014 at 9:30 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-02-19 09:24:03 -0500, Robert Haas wrote: On Fri, Feb 14, 2014 at 9:32 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 6, 2014 at 11:26 AM, Michael Paquier michael.paqu...@gmail.com wrote:

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Wed, Feb 19, 2014 at 9:30 AM, Andres Freund and...@2ndquadrant.com wrote: GET_8_BYTES only exists for 64bit systems. Right, I got that far. So it looks like float8, int8, timestamp, timestamptz, and money all have behavior contingent on

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Robert Haas
On Wed, Feb 19, 2014 at 10:03 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Wed, Feb 19, 2014 at 9:30 AM, Andres Freund and...@2ndquadrant.com wrote: GET_8_BYTES only exists for 64bit systems. Right, I got that far. So it looks like float8, int8,

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Greg Stark
On Wed, Feb 19, 2014 at 3:11 PM, Robert Haas robertmh...@gmail.com wrote: Hopefully the commit I just pushed will fix it. It now works on my machine with and without --disable-float8-byval. It builds and passes here on 32bits -- greg -- Sent via pgsql-hackers mailing list

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Robert Haas
On Wed, Feb 19, 2014 at 11:03 AM, Greg Stark st...@mit.edu wrote: On Wed, Feb 19, 2014 at 3:11 PM, Robert Haas robertmh...@gmail.com wrote: Hopefully the commit I just pushed will fix it. It now works on my machine with and without --disable-float8-byval. It builds and passes here on 32bits

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Robert Haas
On Wed, Feb 5, 2014 at 9:26 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 6, 2014 at 3:48 AM, Peter Eisentraut pete...@gmx.net wrote: On 2/5/14, 1:31 PM, Robert Haas wrote: On Tue, Feb 4, 2014 at 3:26 PM, Peter Eisentraut pete...@gmx.net wrote: Perhaps this type should be

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Andres Freund
On 2014-02-19 12:47:40 -0500, Robert Haas wrote: On Wed, Feb 5, 2014 at 9:26 PM, Michael Paquier michael.paqu...@gmail.com wrote: Yes, that's a good precedent in multiple ways. Here are updated patches to use pg_lsn instead of pglsn... OK, so I think this stuff is all committed now, with

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Michael Paquier
On Thu, Feb 20, 2014 at 2:47 AM, Robert Haas robertmh...@gmail.com wrote: On Wed, Feb 5, 2014 at 9:26 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 6, 2014 at 3:48 AM, Peter Eisentraut pete...@gmx.net wrote: On 2/5/14, 1:31 PM, Robert Haas wrote: On Tue, Feb 4, 2014 at 3:26

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Michael Paquier
On Thu, Feb 20, 2014 at 9:43 AM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 20, 2014 at 2:47 AM, Robert Haas robertmh...@gmail.com wrote: On Wed, Feb 5, 2014 at 9:26 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Feb 6, 2014 at 3:48 AM, Peter Eisentraut

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-19 Thread Michael Paquier
On Thu, Feb 20, 2014 at 8:55 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-02-19 12:47:40 -0500, Robert Haas wrote: On Wed, Feb 5, 2014 at 9:26 PM, Michael Paquier michael.paqu...@gmail.com wrote: Yes, that's a good precedent in multiple ways. Here are updated patches to use

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-14 Thread Michael Paquier
On Thu, Feb 6, 2014 at 11:26 AM, Michael Paquier michael.paqu...@gmail.com wrote: Here are updated patches to use pg_lsn instead of pglsn... Should I register this patch somewhere to avoid having it lost in the void? Regards, -- Michael -- Sent via pgsql-hackers mailing list

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-05 Thread Robert Haas
On Tue, Feb 4, 2014 at 3:26 PM, Peter Eisentraut pete...@gmx.net wrote: Perhaps this type should be called pglsn, since it's an implementation-specific detail and not a universal concept like int, point, or uuid. If we're going to do that, I suggest pg_lsn rather than pglsn. We already have

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-05 Thread Peter Eisentraut
On 2/5/14, 1:31 PM, Robert Haas wrote: On Tue, Feb 4, 2014 at 3:26 PM, Peter Eisentraut pete...@gmx.net wrote: Perhaps this type should be called pglsn, since it's an implementation-specific detail and not a universal concept like int, point, or uuid. If we're going to do that, I suggest

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-04 Thread Andres Freund
Hi, On 2014-02-04 10:23:14 +0900, Michael Paquier wrote: On Tue, Feb 4, 2014 at 10:10 AM, Tom Lane t...@sss.pgh.pa.us wrote: Michael Paquier michael.paqu...@gmail.com writes: Please find attached a patch implementing lsn as a datatype, based on the one Robert wrote a couple of years ago.

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-04 Thread Michael Paquier
On Tue, Feb 4, 2014 at 6:15 PM, Andres Freund and...@2ndquadrant.com wrote: + /*-- + * Relational operators for LSNs + *-*/ Isn't it just operators? They aren't really

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-04 Thread Andres Freund
On 2014-02-04 19:17:51 +0900, Michael Paquier wrote: On Tue, Feb 4, 2014 at 6:15 PM, Andres Freund and...@2ndquadrant.com wrote: + /*-- + * Relational operators for LSNs +

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-04 Thread Michael Paquier
On Tue, Feb 4, 2014 at 7:22 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-02-04 19:17:51 +0900, Michael Paquier wrote: @@ -180,7 +175,7 @@ pg_get_replication_slots(PG_FUNCTION_ARGS) else nulls[i++] = true; if (restart_lsn !=

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-04 Thread Andres Freund
On 2014-02-04 21:04:13 +0900, Michael Paquier wrote: On Tue, Feb 4, 2014 at 7:22 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-02-04 19:17:51 +0900, Michael Paquier wrote: @@ -180,7 +175,7 @@ pg_get_replication_slots(PG_FUNCTION_ARGS) else

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-04 Thread Peter Eisentraut
Perhaps this type should be called pglsn, since it's an implementation-specific detail and not a universal concept like int, point, or uuid. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-04 Thread Michael Paquier
On Wed, Feb 5, 2014 at 5:26 AM, Peter Eisentraut pete...@gmx.net wrote: Perhaps this type should be called pglsn, since it's an implementation-specific detail and not a universal concept like int, point, or uuid. It makes sense. I'll update the patches according to that. -- Michael -- Sent

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-04 Thread Michael Paquier
On Wed, Feb 5, 2014 at 9:38 AM, Michael Paquier michael.paqu...@gmail.com wrote: On Wed, Feb 5, 2014 at 8:59 AM, Michael Paquier michael.paqu...@gmail.com wrote: I'll update the patches according to that. Here are the updated patches with the following changes (according to previous

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-03 Thread Michael Paquier
On Sun, Feb 2, 2014 at 12:07 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-02-02 00:04:41 +0900, Michael Paquier wrote: On Fri, Dec 13, 2013 at 2:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@2ndquadrant.com writes: On 2013-12-12 11:55:51 -0500, Tom Lane wrote:

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-03 Thread Tom Lane
Michael Paquier michael.paqu...@gmail.com writes: Please find attached a patch implementing lsn as a datatype, based on the one Robert wrote a couple of years ago. Patch contains regression tests as well as a bit of documentation. Perhaps this is too late for 9.4, so if there are no

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-03 Thread Michael Paquier
On Tue, Feb 4, 2014 at 10:10 AM, Tom Lane t...@sss.pgh.pa.us wrote: Michael Paquier michael.paqu...@gmail.com writes: Please find attached a patch implementing lsn as a datatype, based on the one Robert wrote a couple of years ago. Patch contains regression tests as well as a bit of

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-01 Thread Michael Paquier
On Fri, Dec 13, 2013 at 2:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@2ndquadrant.com writes: On 2013-12-12 11:55:51 -0500, Tom Lane wrote: I'm not, however, terribly thrilled with the suggestions to add implicit casts associated with this type. Implicit casts are generally

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2014-02-01 Thread Andres Freund
On 2014-02-02 00:04:41 +0900, Michael Paquier wrote: On Fri, Dec 13, 2013 at 2:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@2ndquadrant.com writes: On 2013-12-12 11:55:51 -0500, Tom Lane wrote: I'm not, however, terribly thrilled with the suggestions to add implicit

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-12 Thread Greg Stark
Bonus points if you implement a (explicit) cast to and from timestamptz :) -- greg On 11 Dec 2013 12:41, Andres Freund and...@2ndquadrant.com wrote: Hi, There's already a couple of SQL function dealing with XLogRecPtrs and the logical replication work will add a couple of more. Currently

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-12 Thread Andres Freund
On 2013-12-11 08:13:18 -0500, Robert Haas wrote: On Wed, Dec 11, 2013 at 7:41 AM, Andres Freund and...@2ndquadrant.com wrote: There's already a couple of SQL function dealing with XLogRecPtrs and the logical replication work will add a couple of more. Currently each of those funtions

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-12 Thread Simon Riggs
On 12 December 2013 12:27, Andres Freund and...@2ndquadrant.com wrote: On 2013-12-11 08:13:18 -0500, Robert Haas wrote: On Wed, Dec 11, 2013 at 7:41 AM, Andres Freund and...@2ndquadrant.com wrote: There's already a couple of SQL function dealing with XLogRecPtrs and the logical replication

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-12 Thread Robert Haas
On Thu, Dec 12, 2013 at 8:20 AM, Simon Riggs si...@2ndquadrant.com wrote: On 12 December 2013 12:27, Andres Freund and...@2ndquadrant.com wrote: On 2013-12-11 08:13:18 -0500, Robert Haas wrote: On Wed, Dec 11, 2013 at 7:41 AM, Andres Freund and...@2ndquadrant.com wrote: There's already a

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-12 Thread Alvaro Herrera
Robert Haas escribió: I am happy to have my old patch resurrected - could become a trend. But someone should probably go back and check who objected and for what reasons. Here it is FWIW:

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-12 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Robert Haas escribió: I am happy to have my old patch resurrected - could become a trend. But someone should probably go back and check who objected and for what reasons. Here it is FWIW:

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-12 Thread Andres Freund
Hi, On 2013-12-12 11:55:51 -0500, Tom Lane wrote: I'm not, however, terribly thrilled with the suggestions to add implicit casts associated with this type. Implicit casts are generally dangerous. It's a tradeof. Currently we have the following functions returning LSNs as text: *

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-12 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2013-12-12 11:55:51 -0500, Tom Lane wrote: I'm not, however, terribly thrilled with the suggestions to add implicit casts associated with this type. Implicit casts are generally dangerous. It's a tradeof. Currently we have the following

[HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-11 Thread Andres Freund
Hi, There's already a couple of SQL function dealing with XLogRecPtrs and the logical replication work will add a couple of more. Currently each of those funtions taking/returning an LSN does sprintf/scanf to print/parse the strings. Which both is awkward and potentially noticeable

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-11 Thread Robert Haas
On Wed, Dec 11, 2013 at 7:41 AM, Andres Freund and...@2ndquadrant.com wrote: There's already a couple of SQL function dealing with XLogRecPtrs and the logical replication work will add a couple of more. Currently each of those funtions taking/returning an LSN does sprintf/scanf to print/parse

Re: [HACKERS] should we add a XLogRecPtr/LSN SQL type?

2013-12-11 Thread Euler Taveira
On 11-12-2013 09:41, Andres Freund wrote: There's already a couple of SQL function dealing with XLogRecPtrs and the logical replication work will add a couple of more. Currently each of those funtions taking/returning an LSN does sprintf/scanf to print/parse the strings. Which both is awkward