On Thu, Feb 20, 2014 at 9:43 AM, Michael Paquier
<[email protected]> wrote:
> On Thu, Feb 20, 2014 at 2:47 AM, Robert Haas <[email protected]> wrote:
>> On Wed, Feb 5, 2014 at 9:26 PM, Michael Paquier
>> <[email protected]> wrote:
>>> On Thu, Feb 6, 2014 at 3:48 AM, Peter Eisentraut <[email protected]> wrote:
>>>> On 2/5/14, 1:31 PM, Robert Haas wrote:
>>>>> On Tue, Feb 4, 2014 at 3:26 PM, Peter Eisentraut <[email protected]> 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 pg_node_tree, so using underscores for separation would
>>>>> be more consistent.
>>>>
>>>> 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 assorted changes.
>> Thanks for your work on this.
> Thanks!
> Oops, it looks like I am coming after the battle (time difference does
> not help). I'll be more careful to test such patches on 32b platforms
> as well in the future.
After re-reading the code, I found two incorrect comments in the new
regression tests. Patch fixing them is attached.
Thanks,
--
Michael
diff --git a/src/backend/utils/adt/pg_lsn.c b/src/backend/utils/adt/pg_lsn.c
index e2b528a..fae12e1 100644
--- a/src/backend/utils/adt/pg_lsn.c
+++ b/src/backend/utils/adt/pg_lsn.c
@@ -19,7 +19,7 @@
#include "utils/pg_lsn.h"
#define MAXPG_LSNLEN 17
-#define MAXPG_LSNCOMPONENT 8
+#define MAXPG_LSNCOMPONENT 8
/*----------------------------------------------------------
* Formatting and conversion routines.
diff --git a/src/test/regress/expected/pg_lsn.out b/src/test/regress/expected/pg_lsn.out
index 01d2983..504768c 100644
--- a/src/test/regress/expected/pg_lsn.out
+++ b/src/test/regress/expected/pg_lsn.out
@@ -52,13 +52,13 @@ SELECT '0/16AE7F8' > pg_lsn '0/16AE7F7';
t
(1 row)
-SELECT '0/16AE7F7'::pg_lsn - '0/16AE7F8'::pg_lsn; -- No negative results
+SELECT '0/16AE7F7'::pg_lsn - '0/16AE7F8'::pg_lsn;
?column?
----------
-1
(1 row)
-SELECT '0/16AE7F8'::pg_lsn - '0/16AE7F7'::pg_lsn; -- correct
+SELECT '0/16AE7F8'::pg_lsn - '0/16AE7F7'::pg_lsn;
?column?
----------
1
diff --git a/src/test/regress/sql/pg_lsn.sql b/src/test/regress/sql/pg_lsn.sql
index dddafb3..1634d37 100644
--- a/src/test/regress/sql/pg_lsn.sql
+++ b/src/test/regress/sql/pg_lsn.sql
@@ -21,5 +21,5 @@ SELECT '0/16AE7F8' = '0/16AE7F8'::pg_lsn;
SELECT '0/16AE7F8'::pg_lsn != '0/16AE7F7';
SELECT '0/16AE7F7' < '0/16AE7F8'::pg_lsn;
SELECT '0/16AE7F8' > pg_lsn '0/16AE7F7';
-SELECT '0/16AE7F7'::pg_lsn - '0/16AE7F8'::pg_lsn; -- No negative results
-SELECT '0/16AE7F8'::pg_lsn - '0/16AE7F7'::pg_lsn; -- correct
+SELECT '0/16AE7F7'::pg_lsn - '0/16AE7F8'::pg_lsn;
+SELECT '0/16AE7F8'::pg_lsn - '0/16AE7F7'::pg_lsn;
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers