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