Database Function Description of "count_photos_by_album"

Name

count_photos_by_album

Description

Count the photos per album for all albums.

Purpose

To retrieve the number of photos per album for all albums.

Schema

CREATE FUNCTION count_photos_by_album(integer, integer, varchar[]) returns bigint AS '
select count(photo) from album_content where album = $1 and can_access_photo(photo, $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_album(integer) returns bigint
AS 'select count(photo.identifier)
     from album_content, photo
    where album_content.photo=photo.identifier
      and album = $1' LANGUAGE 'sql';
CREATE FUNCTION count_photos_by_album(integer, integer) returns bigint
AS 'select count(photo.identifier)
      from album_content, photo, album
     where album_content.photo=photo.identifier
       and album_content.album=album.identifier
       and album_content.album = $1
       and photo.access_rights <= $2' LANGUAGE 'sql';

= Version 2.34 =

DROP FUNCTION count_photos_by_album(integer);
DROP FUNCTION count_photos_by_album(integer, integer);
 
CREATE OR REPLACE FUNCTION count_photos_by_album(integer, integer, varchar[]) returns bigint AS '
select count(photo) from album_content where album = $1 and can_access_photo(photo, $2, $3);
' LANGUAGE 'sql';
podoc/count_photos_by_album_sql_function.txt · Last modified: 2007/10/19 16:29 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