pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: David Steele <david@pgmasters.net>
Cc: pgsql-hackers@postgresql.org, "Bossart, Nathan" <bossartn@amazon.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)
Date: Mon, 16 Mar 2020 16:20:21 +0100 (CET)
Message-ID: <alpine.DEB.2.21.2003161607590.19856@pseudo> (raw)
In-Reply-To: <20200315212729.GC26184@telsasoft.com>
References: <20200303200117.GI684@telsasoft.com>
	<20200303202313.GA28076@alvherre.pgsql>
	<20200305161838.GJ684@telsasoft.com>
	<20200306233507.GN684@telsasoft.com>
	<alpine.DEB.2.21.2003071125340.21542@pseudo>
	<20200307214010.GB1357@telsasoft.com>
	<20200310183037.GA29065@telsasoft.com>
	<20200313131232.GO29065@telsasoft.com>
	<alpine.DEB.2.21.2003151146370.12715@pseudo>
	<20200315212729.GC26184@telsasoft.com>


About v11, ISTM that the recursive function should check for symbolic 
links and possibly avoid them:

  sh> cd data/base
  sh> ln -s .. foo

  psql> SELECT * FROM pg_ls_dir_recurse('.');
  ERROR:  could not stat file "./base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo": Too many levels of symbolic links
  CONTEXT:  SQL function "pg_ls_dir_recurse" statement 1

This probably means using lstat instead of (in supplement to?) stat, and 
probably tell if something is a link, and if so not recurse in them.

-- 
Fabien.





view thread (70+ messages)  latest in thread

Message-ID: <alpine.DEB.2.21.2003161607590.19856@pseudo>
Permalink:  ../alpine.DEB.2.21.2003161607590.19856@pseudo/
Also on:    postgresql.org/message-id/alpine.DEB.2.21.2003161607590.19856@pseudo

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: coelho@cri.ensmp.fr, pryzby@telsasoft.com, alvherre@2ndquadrant.com, david@pgmasters.net, bossartn@amazon.com, thomas.munro@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)
  In-Reply-To: <alpine.DEB.2.21.2003161607590.19856@pseudo>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox