count_albums_by_user
Counts the number of albums for a given user.
There are two versions, one that counts all albums and one that counts only those albums up to a given access rights setting.
To retrieve the number of albums of a user.
CREATE FUNCTION count_albums_by_user(INTEGER) RETURNS BIGINT AS 'select count(identifier) from album where users = $1' LANGUAGE 'sql';
CREATE FUNCTION count_albums_by_user(INTEGER, INTEGER) RETURNS BIGINT AS 'select count(identifier) from album where users = $1 and access_rights <= $2' LANGUAGE 'sql';
Version 2.5
Still in use
= Version 2.5 =
CREATE FUNCTION count_albums_by_user(INTEGER) RETURNS BIGINT AS 'select count(identifier) from album where users = $1' LANGUAGE 'sql';
CREATE FUNCTION count_albums_by_user(INTEGER, INTEGER) RETURNS BIGINT AS 'select count(identifier) from album where users = $1 and access_rights <= $2' LANGUAGE 'sql';