This is an old revision of the document!
count_photos_by_folder
Count the photos in a particular folder.
There are two versions, one that counts all photos and one that counts only those photos up to a given access rights setting.
To retrieve the number of photos in a particular folder.
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.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';