count_photos_by_folder
Count the photos in a particular folder.
To retrieve the number of photos in a particular folder.
CREATE FUNCTION count_photos_by_folder(integer, integer, varchar[]) returns bigint AS ' select count(identifier) from photo where folder = $1 and can_access_photo(identifier, $2, $3); ' LANGUAGE 'sql';
Version 2.5
Still in use
= Version 2.5 =
CREATE FUNCTION count_photos_by_folder(integer) returns bigint AS 'select count(identifier) from photo where folder = $1' LANGUAGE 'sql';
CREATE FUNCTION count_photos_by_folder(integer, integer) returns bigint AS 'select count(identifier) from photo where folder = $1 and access_rights <= $2' LANGUAGE 'sql';
= Version 2.34 =
DROP FUNCTION count_photos_by_folder(integer); DROP FUNCTION count_photos_by_folder(integer, integer); CREATE OR REPLACE FUNCTION count_photos_by_folder(integer, integer, varchar[]) returns bigint AS ' select count(identifier) from photo where folder = $1 and can_access_photo(identifier, $2, $3); ' LANGUAGE 'sql';