Database Function Description of "count_photos_by_folder"

Name

count_photos_by_folder

Description

Count the photos in a particular folder.

Purpose

To retrieve the number of photos in a particular folder.

Schema

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

Related tables

History

Used first

Version 2.5

Used last

Still in use

Change history

= 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';
podoc/count_photos_by_folder_sql_function.txt · Last modified: 2007/10/19 16:27 by Luud
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0