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';