Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7f018ac

Browse files
committed
Use one, not zero, as the default lower bound for arrays of AclItems.
This avoids changing the displayed appearance of ACL columns now that array_out decorates its output with bounds information when the lower bound isn't one. Per gripe from Gaetano Mendola. Note that I did not force initdb for this, although any database initdb'd in the last couple of days is going to have some problems.
1 parent 57050f9 commit 7f018ac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/backend/utils/adt/acl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/acl.c,v 1.108 2004/08/01 20:30:49 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/acl.c,v 1.109 2004/08/06 18:05:48 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -328,7 +328,7 @@ allocacl(int n)
328328
new_acl->ndim = 1;
329329
new_acl->flags = 0;
330330
new_acl->elemtype = ACLITEMOID;
331-
ARR_LBOUND(new_acl)[0] = 0;
331+
ARR_LBOUND(new_acl)[0] = 1;
332332
ARR_DIMS(new_acl)[0] = n;
333333
return new_acl;
334334
}

src/include/utils/acl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/acl.h,v 1.72 2004/08/01 20:30:49 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/acl.h,v 1.73 2004/08/06 18:05:49 tgl Exp $
1111
*
1212
* NOTES
1313
* An ACL array is simply an array of AclItems, representing the union
@@ -99,7 +99,7 @@ typedef struct AclItem
9999
* Definitions for convenient access to Acl (array of AclItem) and IdList
100100
* (array of AclId). These are standard PostgreSQL arrays, but are restricted
101101
* to have one dimension. We also ignore the lower bound when reading,
102-
* and set it to zero when writing.
102+
* and set it to one when writing.
103103
*
104104
* CAUTION: as of PostgreSQL 7.1, these arrays are toastable (just like all
105105
* other array types). Therefore, be careful to detoast them with the

0 commit comments

Comments
 (0)