agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedHot standby v5d, fails to build on windows
19+ messages / 3 participants
[nested] [flat]
* Hot standby v5d, fails to build on windows
@ 2008-11-11 07:09 Jaime Casanova <jcasanov@systemguards.com.ec>
0 siblings, 0 replies; 19+ messages in thread
From: Jaime Casanova @ 2008-11-11 07:09 UTC (permalink / raw)
To: pgsql-hackers
Hi,
Seems like you can't use "uint" on windows, it fails trying to compile this:
typedef struct xl_xact_commit
{
TimestampTz xact_time; /* time of commit */
+ int slotId; /* slotId in procarray */
+ uint xinfo; /* info flags */
The error message is:
"""
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels -fno-strict-aliasing -fwrapv -g
-I../../../../src/include -I./src/include/port/win32 -DEXEC_BACKEND
"-I../../../../src/include/port/win32" -DBUILDING_DLL -c -o heapam.o
heapam.c -MMD -MP -MF .deps/heapam.Po
In file included from heapam.c:50:
../../../../src/include/access/xact.h:109: error: syntax error before "uint"
../../../../src/include/access/xact.h:109: warning: no semicolon at
end of struct or union
../../../../src/include/access/xact.h:117: error: syntax error before '}' token
../../../../src/include/access/xact.h:117: warning: type defaults to
`int' in declaration of `xl_xact_commit'
../../../../src/include/access/xact.h:117: warning: data definition
has no type or storage class
"""
I was able to compile changing uint for uint32 but i'm not sure if
that is the aproppiate type...
--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
AsesorÃa y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v22 01/10] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 7ef2ec9972..1b67ef4be8 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25917,7 +25917,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--d6Gm4EdcadzBjdND
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v22-0002-pg_stat_file-and-pg_ls_dir_-to-use-lstat.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v31 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 74d3087a72..d36479d86d 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27410,7 +27410,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--qZVVwWJgpX9Jzs7f
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v31-0002-Add-tests-on-pg_ls_dir-before-changing-it.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v30 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 6388385edc..7a830f0684 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27004,7 +27004,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--ZwgA9U+XZDXt4+m+
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v30-0002-Add-tests-on-pg_ls_dir-before-changing-it.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v30 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 6388385edc..7a830f0684 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27004,7 +27004,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--ZwgA9U+XZDXt4+m+
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v30-0002-Add-tests-on-pg_ls_dir-before-changing-it.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v28 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 0606b6a9aa..aa0dcde886 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27018,7 +27018,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--vk/v8fjDPiDepTtA
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v28-0002-Add-tests-on-pg_ls_dir-before-changing-it.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v25 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index df29af6371..7cafdb9107 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25897,7 +25897,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--SBikYMzjhZGK9d4p
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v25-0002-pg_stat_file-and-pg_ls_dir_-to-use-lstat.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v24 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 507bc1a668..9c0ad7a334 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25904,7 +25904,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--mPTHnM80CEnHQ2WJ
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v24-0002-pg_stat_file-and-pg_ls_dir_-to-use-lstat.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v33 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 0ee6974f1c6..d32b414e04f 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27563,7 +27563,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.1
--9CzcV6dAFIr7O1Ie
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v33-0002-Add-tests-before-changing-pg_ls_.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v36 1/7] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 7b652460a18..933118203f4 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -28661,6 +28661,10 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
platforms only), file creation time stamp (Windows only), and a flag
indicating if it is a directory.
</para>
+ <para>
+ If filename is a link, this function returns information about the file
+ or directory the link refers to.
+ </para>
<para>
This function is restricted to superusers by default, but other users
can be granted EXECUTE to run the function.
--
2.17.1
--4ybNbZnZ8tziJ7D6
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v36-0002-Add-tests-before-changing-pg_ls_.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v34 01/15] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 8a802fb2253..0be4743e3ed 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27618,7 +27618,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.1
--smOfPzt+Qjm5bNGJ
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v34-0002-Add-tests-before-changing-pg_ls_.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v35 1/7] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 4001cb2bda5..d01aeec9f88 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27631,6 +27631,10 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
platforms only), file creation time stamp (Windows only), and a flag
indicating if it is a directory.
</para>
+ <para>
+ If filename is a link, this function returns information about the file
+ or directory the link refers to.
+ </para>
<para>
This function is restricted to superusers by default, but other users
can be granted EXECUTE to run the function.
--
2.17.1
--olLTNZSltDMg5Vbm
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v35-0002-Add-tests-before-changing-pg_ls_.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v32 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index e58efce5865..b5c1befe627 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27495,7 +27495,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--Bne5rrxQd65beI7a
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v32-0002-Add-tests-on-pg_ls_dir-before-changing-it.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v31 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 74d3087a72..d36479d86d 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27410,7 +27410,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--qZVVwWJgpX9Jzs7f
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v31-0002-Add-tests-on-pg_ls_dir-before-changing-it.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v20 01/10] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 959f6a1c2f..7ef8c7a847 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25911,7 +25911,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--Z1Z8UV8BNhgCynIS
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v20-0002-pg_stat_file-and-pg_ls_dir_-to-use-lstat.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v19 01/10] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index b7c450ea29..9f47745c5a 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25881,7 +25881,7 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
Returns a record containing the file's size, last access time stamp,
last modification time stamp, last file status change time stamp (Unix
platforms only), file creation time stamp (Windows only), and a flag
- indicating if it is a directory.
+ indicating if it is a directory (or a symbolic link to a directory).
</para>
<para>
This function is restricted to superusers by default, but other users
--
2.17.0
--S0GG+JvAI2G0KxBG
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v19-0002-pg_stat_file-and-pg_ls_dir_-to-use-lstat.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v15 01/10] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 7a0bb0c70a..25b1278459 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -21558,7 +21558,8 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
size, last accessed time stamp, last modified time stamp,
last file status change time stamp (Unix platforms only),
file creation time stamp (Windows only), and a <type>boolean</type>
- indicating if it is a directory. Typical usages include:
+ indicating if it is a directory (or a symbolic link to a directory).
+ Typical usages include:
<programlisting>
SELECT * FROM pg_stat_file('filename');
SELECT (pg_stat_file('filename')).modification;
--
2.17.0
--8w3uRX/HFJGApMzv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v15-0002-pg_stat_file-and-pg_ls_dir_-to-use-lstat.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v37 01/11] Document historic behavior of links to directories..
@ 2020-03-16 19:12 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2020-03-16 19:12 UTC (permalink / raw)
Backpatch to 9.5: pg_stat_file
---
doc/src/sgml/func.sgml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 6e0425cb3dc..d958c3e74ac 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27700,6 +27700,10 @@ SELECT convert_from(pg_read_binary_file('file_in_utf8.txt'), 'UTF8');
platforms only), file creation time stamp (Windows only), and a flag
indicating if it is a directory.
</para>
+ <para>
+ If filename is a link, this function returns information about the file
+ or directory the link refers to.
+ </para>
<para>
This function is restricted to superusers by default, but other users
can be granted EXECUTE to run the function.
--
2.25.1
--Pk/CTwBz1VvfPIDp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v37-0002-Add-tests-before-changing-pg_ls_.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v4 2/2] Protect role resolution in roleSpecsToIds() against concurrent DROP
@ 2026-07-06 08:28 Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
0 siblings, 0 replies; 19+ messages in thread
From: Bertrand Drouvot @ 2026-07-06 08:28 UTC (permalink / raw)
roleSpecsToIds() resolves role names to OIDs without acquiring any lock.
A concurrent DROP ROLE that commits between this resolution and the caller's use
of the OID leaves the caller operating on a stale OID, which can create orphaned
pg_auth_members entries.
Fix this by acquiring AccessShareLock on each resolved role within
roleSpecsToIds(), ensuring the role cannot be dropped while any caller is using
its OID.
The AccessShareLock is held until end of transaction, so an open transaction
that performed GRANT, CREATE ROLE ... ROLE, or REASSIGN OWNED BY will block a
concurrent DROP ROLE on the same role until it commits.
Note that this introduces a potential deadlock between GRANT and DROP ROLE
when both target overlapping roles. The deadlock is detected and one session is
aborted with an error, which is preferable to the pre-patch behavior of silently
creating orphaned catalog entries.
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reported-by: Virender Singla <virender.cse@gmail.com>
Reviewed-by: Surya Poondla <suryapoondla4@gmail.com>
Discussion: https://postgr.es/m/aki6fMNLUx6%2BBR8K%40bdtpg
Discussion: https://postgr.es/m/CAM6Zo8woa62ZFHtMKox6a4jb8qQ%3Dw87R2L0K8347iE-juQL2EA%40mail.gmail.com
---
src/backend/commands/user.c | 20 +++-
.../expected/role-membership-drop-member.out | 97 +++++++++++++++++++
src/test/isolation/isolation_schedule | 1 +
.../specs/role-membership-drop-member.spec | 63 ++++++++++++
4 files changed, 180 insertions(+), 1 deletion(-)
11.5% src/backend/commands/
49.2% src/test/isolation/expected/
38.6% src/test/isolation/specs/
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index 5b869e91c17..ab3cfb0b13f 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -1778,6 +1778,8 @@ ReassignOwnedObjects(ReassignOwnedStmt *stmt)
* roleSpecsToIds
*
* Given a list of RoleSpecs, generate a list of role OIDs in the same order.
+ * Each role is locked with AccessShareLock to prevent concurrent DROP ROLE
+ * from removing it between resolution and the caller's catalog update.
*
* ROLESPEC_PUBLIC is not allowed.
*/
@@ -1792,7 +1794,23 @@ roleSpecsToIds(List *memberNames)
RoleSpec *rolespec = lfirst_node(RoleSpec, l);
Oid roleid;
- roleid = get_rolespec_oid(rolespec, false);
+ if (rolespec->roletype == ROLESPEC_CSTRING)
+ roleid = RoleNameGetOid(rolespec->rolename,
+ AccessShareLock, false,
+ NULL, NULL);
+ else
+ {
+ roleid = get_rolespec_oid(rolespec, false);
+ LockSharedObject(AuthIdRelationId, roleid, 0,
+ AccessShareLock);
+
+ /* Recheck that the role still exists after locking. */
+ if (!SearchSysCacheExists1(AUTHOID, ObjectIdGetDatum(roleid)))
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_OBJECT),
+ errmsg("role with OID %u does not exist", roleid)));
+ }
+
result = lappend_oid(result, roleid);
}
return result;
diff --git a/src/test/isolation/expected/role-membership-drop-member.out b/src/test/isolation/expected/role-membership-drop-member.out
new file mode 100644
index 00000000000..7daf48395ca
--- /dev/null
+++ b/src/test/isolation/expected/role-membership-drop-member.out
@@ -0,0 +1,97 @@
+Parsed test spec with 2 sessions
+
+starting permutation: s1_begin s1_grant s2_drop_member s1_commit s2_check_orphans
+step s1_begin: BEGIN;
+step s1_grant: GRANT regress_role_group TO regress_role_member;
+step s2_drop_member: DROP ROLE regress_role_member; <waiting ...>
+step s1_commit: COMMIT;
+step s2_drop_member: <... completed>
+step s2_check_orphans:
+ SELECT count(*)
+ FROM pg_auth_members m
+ LEFT JOIN pg_authid ra ON m.roleid = ra.oid
+ LEFT JOIN pg_authid me ON m.member = me.oid
+ LEFT JOIN pg_authid gr ON m.grantor = gr.oid
+ WHERE ra.oid IS NULL OR me.oid IS NULL OR gr.oid IS NULL;
+
+count
+-----
+ 0
+(1 row)
+
+
+starting permutation: s1_begin s1_alter_add s2_drop_member s1_commit s2_check_orphans
+step s1_begin: BEGIN;
+step s1_alter_add: ALTER GROUP regress_role_group ADD USER regress_role_member;
+step s2_drop_member: DROP ROLE regress_role_member; <waiting ...>
+step s1_commit: COMMIT;
+step s2_drop_member: <... completed>
+step s2_check_orphans:
+ SELECT count(*)
+ FROM pg_auth_members m
+ LEFT JOIN pg_authid ra ON m.roleid = ra.oid
+ LEFT JOIN pg_authid me ON m.member = me.oid
+ LEFT JOIN pg_authid gr ON m.grantor = gr.oid
+ WHERE ra.oid IS NULL OR me.oid IS NULL OR gr.oid IS NULL;
+
+count
+-----
+ 0
+(1 row)
+
+
+starting permutation: s1_begin s1_create_role s2_drop_member s1_commit s2_check_orphans
+step s1_begin: BEGIN;
+step s1_create_role: CREATE ROLE regress_role_new ROLE regress_role_member;
+step s2_drop_member: DROP ROLE regress_role_member; <waiting ...>
+step s1_commit: COMMIT;
+step s2_drop_member: <... completed>
+step s2_check_orphans:
+ SELECT count(*)
+ FROM pg_auth_members m
+ LEFT JOIN pg_authid ra ON m.roleid = ra.oid
+ LEFT JOIN pg_authid me ON m.member = me.oid
+ LEFT JOIN pg_authid gr ON m.grantor = gr.oid
+ WHERE ra.oid IS NULL OR me.oid IS NULL OR gr.oid IS NULL;
+
+count
+-----
+ 0
+(1 row)
+
+
+starting permutation: s1_begin s1_drop_owned s2_drop_member s1_commit
+step s1_begin: BEGIN;
+step s1_drop_owned: DROP OWNED BY regress_role_member;
+step s2_drop_member: DROP ROLE regress_role_member; <waiting ...>
+step s1_commit: COMMIT;
+step s2_drop_member: <... completed>
+
+starting permutation: s1_begin s1_reassign_owned s2_drop_member s1_commit
+step s1_begin: BEGIN;
+step s1_reassign_owned: REASSIGN OWNED BY regress_role_member TO regress_role_group;
+step s2_drop_member: DROP ROLE regress_role_member; <waiting ...>
+step s1_commit: COMMIT;
+step s2_drop_member: <... completed>
+
+starting permutation: s1_begin s1_set_role s1_grant_cu s2_drop_member_cu s1_commit s1_reset s2_check_orphans
+step s1_begin: BEGIN;
+step s1_set_role: SET ROLE regress_role_member_cu;
+step s1_grant_cu: GRANT regress_role_group_cu TO CURRENT_USER;
+step s2_drop_member_cu: DROP ROLE regress_role_member_cu; <waiting ...>
+step s1_commit: COMMIT;
+step s2_drop_member_cu: <... completed>
+step s1_reset: RESET ROLE;
+step s2_check_orphans:
+ SELECT count(*)
+ FROM pg_auth_members m
+ LEFT JOIN pg_authid ra ON m.roleid = ra.oid
+ LEFT JOIN pg_authid me ON m.member = me.oid
+ LEFT JOIN pg_authid gr ON m.grantor = gr.oid
+ WHERE ra.oid IS NULL OR me.oid IS NULL OR gr.oid IS NULL;
+
+count
+-----
+ 0
+(1 row)
+
diff --git a/src/test/isolation/isolation_schedule b/src/test/isolation/isolation_schedule
index b8ebe92553c..8fb8b52b77f 100644
--- a/src/test/isolation/isolation_schedule
+++ b/src/test/isolation/isolation_schedule
@@ -128,3 +128,4 @@ test: matview-write-skew
test: lock-nowait
test: for-portion-of
test: ddl-dependency-locking
+test: role-membership-drop-member
diff --git a/src/test/isolation/specs/role-membership-drop-member.spec b/src/test/isolation/specs/role-membership-drop-member.spec
new file mode 100644
index 00000000000..054326ac535
--- /dev/null
+++ b/src/test/isolation/specs/role-membership-drop-member.spec
@@ -0,0 +1,63 @@
+# Test that role membership commands properly lock the grantee/member
+# role to prevent concurrent DROP ROLE from creating orphaned pg_auth_members
+# entries, or from operating on a stale OID.
+
+setup
+{
+ CREATE ROLE regress_role_group;
+ CREATE ROLE regress_role_member;
+ CREATE ROLE regress_role_group_cu;
+ CREATE ROLE regress_role_member_cu;
+ GRANT regress_role_group_cu TO regress_role_member_cu WITH ADMIN OPTION;
+}
+
+teardown
+{
+ DROP ROLE IF EXISTS regress_role_group;
+ DROP ROLE IF EXISTS regress_role_member;
+ DROP ROLE IF EXISTS regress_role_new;
+ DROP ROLE IF EXISTS regress_role_member_cu;
+ DROP ROLE IF EXISTS regress_role_group_cu;
+}
+
+session s1
+step s1_begin { BEGIN; }
+step s1_grant { GRANT regress_role_group TO regress_role_member; }
+step s1_alter_add { ALTER GROUP regress_role_group ADD USER regress_role_member; }
+step s1_create_role { CREATE ROLE regress_role_new ROLE regress_role_member; }
+step s1_drop_owned { DROP OWNED BY regress_role_member; }
+step s1_reassign_owned { REASSIGN OWNED BY regress_role_member TO regress_role_group; }
+step s1_set_role { SET ROLE regress_role_member_cu; }
+step s1_grant_cu { GRANT regress_role_group_cu TO CURRENT_USER; }
+step s1_commit { COMMIT; }
+step s1_reset { RESET ROLE; }
+
+session s2
+step s2_drop_member { DROP ROLE regress_role_member; }
+step s2_drop_member_cu { DROP ROLE regress_role_member_cu; }
+step s2_check_orphans {
+ SELECT count(*)
+ FROM pg_auth_members m
+ LEFT JOIN pg_authid ra ON m.roleid = ra.oid
+ LEFT JOIN pg_authid me ON m.member = me.oid
+ LEFT JOIN pg_authid gr ON m.grantor = gr.oid
+ WHERE ra.oid IS NULL OR me.oid IS NULL OR gr.oid IS NULL;
+}
+
+# GRANT role TO member and concurrent DROP of the member
+permutation s1_begin s1_grant s2_drop_member s1_commit s2_check_orphans
+
+# ALTER GROUP ADD USER and concurrent DROP of the member
+permutation s1_begin s1_alter_add s2_drop_member s1_commit s2_check_orphans
+
+# CREATE ROLE ... ROLE member and concurrent DROP of the member
+permutation s1_begin s1_create_role s2_drop_member s1_commit s2_check_orphans
+
+# DROP OWNED BY role and concurrent DROP of the role
+permutation s1_begin s1_drop_owned s2_drop_member s1_commit
+
+# REASSIGN OWNED BY role and concurrent DROP of the role
+permutation s1_begin s1_reassign_owned s2_drop_member s1_commit
+
+# GRANT role TO CURRENT_USER and concurrent DROP of the current user
+permutation s1_begin s1_set_role s1_grant_cu s2_drop_member_cu s1_commit s1_reset s2_check_orphans
--
2.34.1
--fotX2lJRknAHpfH+--
^ permalink raw reply [nested|flat] 19+ messages in thread
end of thread, other threads:[~2026-07-06 08:28 UTC | newest]
Thread overview: 19+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-11-11 07:09 Hot standby v5d, fails to build on windows Jaime Casanova <jcasanov@systemguards.com.ec>
2020-03-16 19:12 [PATCH v37 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v36 1/7] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v34 01/15] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v31 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v20 01/10] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v19 01/10] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v15 01/10] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v32 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v24 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v25 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v33 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v35 1/7] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v30 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v22 01/10] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v31 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v30 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2020-03-16 19:12 [PATCH v28 01/11] Document historic behavior of links to directories.. Justin Pryzby <pryzbyj@telsasoft.com>
2026-07-06 08:28 [PATCH v4 2/2] Protect role resolution in roleSpecsToIds() against concurrent DROP Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox