index 8567fcc2b45e634cd3ab6d6d5aa9f089c916ce81..01d1ad0b9a4de45cc14ed63869594a4293dc5dca 100644 (file)
@@ -378,6 +378,29 @@ select * from (select pg_ls_dir('.') a) a where a = 'base' limit 1;
base
(1 row)
+-- Test missing_ok (second argument)
+select pg_ls_dir('does not exist', false, false); -- error
+ERROR: could not open directory "does not exist": No such file or directory
+select pg_ls_dir('does not exist', true, false); -- ok
+ pg_ls_dir
+-----------
+(0 rows)
+
+-- Test include_dot_dirs (third argument)
+select count(*) = 1 as dot_found
+ from pg_ls_dir('.', false, true) as ls where ls = '.';
+ dot_found
+-----------
+ t
+(1 row)
+
+select count(*) = 1 as dot_found
+ from pg_ls_dir('.', false, false) as ls where ls = '.';
+ dot_found
+-----------
+ f
+(1 row)
+
select * from (select (pg_timezone_names()).name) ptn where name='UTC' limit 1;
name
------
index 3db3f8bade2591723456dd53afd92a3bf3d1b247..072fc36a1ffd0389695fa366098d34f7670a5eac 100644 (file)
@@ -124,6 +124,14 @@ from (select pg_ls_waldir() w) ss where length((w).name) = 24 limit 1;
select count(*) >= 0 as ok from pg_ls_archive_statusdir();
select * from (select pg_ls_dir('.') a) a where a = 'base' limit 1;
+-- Test missing_ok (second argument)
+select pg_ls_dir('does not exist', false, false); -- error
+select pg_ls_dir('does not exist', true, false); -- ok
+-- Test include_dot_dirs (third argument)
+select count(*) = 1 as dot_found
+ from pg_ls_dir('.', false, true) as ls where ls = '.';
+select count(*) = 1 as dot_found
+ from pg_ls_dir('.', false, false) as ls where ls = '.';
select * from (select (pg_timezone_names()).name) ptn where name='UTC' limit 1;