User Tools

Site Tools


podoc:schema-2.33c

This is an old revision of the document!


Database schema dump of PO 2.33c

--
-- PostgreSQL database dump
--

SET client_encoding = 'UTF8';
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA public IS 'Standard public schema';


--
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: 
--

CREATE PROCEDURAL LANGUAGE plpgsql;


SET search_path = public, pg_catalog;

--
-- Name: concat_ignore_null(character varying, character varying); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION concat_ignore_null(character varying, character varying) RETURNS character varying
    AS $_$ declare string_1         alias for $1; string_2         alias for $2; begin if string_1 is null then return string_2; end if;  if string_2 is null then return string_1; end if;  return string_1||string_2; end; $_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.concat_ignore_null(character varying, character varying) OWNER TO po_user;

--
-- Name: count_albums_by_user(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_albums_by_user(integer) RETURNS bigint
    AS $_$select count(identifier) from album where users = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_albums_by_user(integer) OWNER TO po_user;

--
-- Name: count_albums_by_user(integer, integer); Type: FUNCTION; Schema: public; Owner: po_user
--

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;


ALTER FUNCTION public.count_albums_by_user(integer, integer) OWNER TO po_user;

--
-- Name: count_equipment_by_user(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_equipment_by_user(integer) RETURNS bigint
    AS $_$select ((select count(identifier) from lens where users = $1) + (select count(identifier) from camera where users = $1) + (select count(identifier) from flash where users = $1) + (select count(identifier) from scanner where users = $1) + (select count(identifier) from film where users = $1) + (select count(identifier) from support where users = $1) + (select count(identifier) from flash where users = $1))$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_equipment_by_user(integer) OWNER TO po_user;

--
-- Name: count_equipment_by_user(integer, integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_equipment_by_user(integer, integer) RETURNS bigint
    AS $_$select ((select count(identifier) from lens where users = $1 and access_rights <= $2) + (select count(identifier) from camera where users = $1 and access_rights <= $2) + (select count(identifier) from flash where users = $1 and access_rights <= $2) + (select count(identifier) from scanner where users = $1 and access_rights <= $2) + (select count(identifier) from film where users = $1 and access_rights <= $2) + (select count(identifier) from support where users = $1 and access_rights <= $2) + (select count(identifier) from flash where users = $1 and access_rights <= $2))$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_equipment_by_user(integer, integer) OWNER TO po_user;

--
-- Name: count_folders_by_user(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_folders_by_user(integer) RETURNS bigint
    AS $_$select count(identifier) from folder where users = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_folders_by_user(integer) OWNER TO po_user;

--
-- Name: count_folders_by_user(integer, integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_folders_by_user(integer, integer) RETURNS bigint
    AS $_$select count(identifier) from folder where users = $1 and access_rights <= $2$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_folders_by_user(integer, integer) OWNER TO po_user;

--
-- Name: count_photo_versions(); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_photo_versions() RETURNS bigint
    AS $$select count(identifier) from photo_version$$
    LANGUAGE sql;


ALTER FUNCTION public.count_photo_versions() OWNER TO po_user;

--
-- Name: count_photo_versions_by_user(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_photo_versions_by_user(integer) RETURNS bigint
    AS $_$select count(photo_version.identifier) from photo_version, photo where photo_version.photo=photo.identifier and photo.users = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_photo_versions_by_user(integer) OWNER TO po_user;

--
-- Name: count_photos(); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_photos() RETURNS bigint
    AS $$select count(identifier) from photo$$
    LANGUAGE sql;


ALTER FUNCTION public.count_photos() OWNER TO po_user;

--
-- Name: count_photos(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_photos(integer) RETURNS bigint
    AS $_$select count(identifier) from photo where access_rights <= $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_photos(integer) OWNER TO po_user;

--
-- Name: count_photos_by_album(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

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;


ALTER FUNCTION public.count_photos_by_album(integer) OWNER TO po_user;

--
-- Name: count_photos_by_album(integer, integer); Type: FUNCTION; Schema: public; Owner: po_user
--

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;


ALTER FUNCTION public.count_photos_by_album(integer, integer) OWNER TO po_user;

--
-- Name: count_photos_by_folder(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_photos_by_folder(integer) RETURNS bigint
    AS $_$select count(identifier) from photo where folder = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_photos_by_folder(integer) OWNER TO po_user;

--
-- Name: count_photos_by_folder(integer, integer); Type: FUNCTION; Schema: public; Owner: po_user
--

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;


ALTER FUNCTION public.count_photos_by_folder(integer, integer) OWNER TO po_user;

--
-- Name: count_photos_by_user(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_photos_by_user(integer) RETURNS bigint
    AS $_$select count(identifier) from photo where users = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_photos_by_user(integer) OWNER TO po_user;

--
-- Name: count_photos_by_user(integer, integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_photos_by_user(integer, integer) RETURNS bigint
    AS $_$select count(photo.identifier) from photo, folder where photo.folder=folder.identifier and photo.users = $1 and photo.access_rights <= $2 and (folder.access_rights <= $2 or (select album.access_rights from album, album_content where album_content.album=album.identifier and album_content.photo=photo.identifier and album.access_rights <= $2 limit 1) <= $2) $_$
    LANGUAGE sql;


ALTER FUNCTION public.count_photos_by_user(integer, integer) OWNER TO po_user;

--
-- Name: count_subalbums_by_album(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_subalbums_by_album(integer) RETURNS bigint
    AS $_$select count(identifier) from album where parent_album = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_subalbums_by_album(integer) OWNER TO po_user;

--
-- Name: count_subalbums_by_album(integer, integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_subalbums_by_album(integer, integer) RETURNS bigint
    AS $_$select count(identifier) from album where parent_album = $1 and access_rights <= $2$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_subalbums_by_album(integer, integer) OWNER TO po_user;

--
-- Name: count_subfolders_by_folder(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_subfolders_by_folder(integer) RETURNS bigint
    AS $_$select count(identifier) from folder where parent_folder = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_subfolders_by_folder(integer) OWNER TO po_user;

--
-- Name: count_subfolders_by_folder(integer, integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_subfolders_by_folder(integer, integer) RETURNS bigint
    AS $_$select count(identifier) from folder where parent_folder = $1 and access_rights <= $2$_$
    LANGUAGE sql;


ALTER FUNCTION public.count_subfolders_by_folder(integer, integer) OWNER TO po_user;

--
-- Name: count_users(); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION count_users() RETURNS bigint
    AS $$select count(identifier) from users$$
    LANGUAGE sql;


ALTER FUNCTION public.count_users() OWNER TO po_user;

--
-- Name: is_photo_for_sale(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION is_photo_for_sale(integer) RETURNS bigint
    AS $_$select count(photo_item.identifier) from photo, photo_item where photo.identifier=photo_item.photo and photo.identifier = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.is_photo_for_sale(integer) OWNER TO po_user;

--
-- Name: is_user_my_client(integer, integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION is_user_my_client(integer, integer) RETURNS bigint
    AS $_$select count(identifier) from client where client.users = $1 and client.client = $2 and status=2$_$
    LANGUAGE sql;


ALTER FUNCTION public.is_user_my_client(integer, integer) OWNER TO po_user;

--
-- Name: number_of_camera_references(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_camera_references(integer) RETURNS bigint
    AS $_$select count(photo_tech.identifier) from photo_tech, camera where photo_tech.camera=camera.identifier and camera.identifier = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_camera_references(integer) OWNER TO po_user;

--
-- Name: number_of_dupes(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_dupes(integer) RETURNS bigint
    AS $_$select count(identifier) from photo_dupe where photo = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_dupes(integer) OWNER TO po_user;

--
-- Name: number_of_film_references(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_film_references(integer) RETURNS bigint
    AS $_$select count(photo_tech.identifier) from photo_tech, film where photo_tech.film=film.identifier and film.identifier = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_film_references(integer) OWNER TO po_user;

--
-- Name: number_of_filter_references(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_filter_references(integer) RETURNS bigint
    AS $_$select count(photo_tech.identifier) from photo_tech, filter where photo_tech.filter=filter.identifier and filter.identifier = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_filter_references(integer) OWNER TO po_user;

--
-- Name: number_of_flash_references(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_flash_references(integer) RETURNS bigint
    AS $_$select count(photo_tech.identifier) from photo_tech, flash where photo_tech.flash=flash.identifier and flash.identifier = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_flash_references(integer) OWNER TO po_user;

--
-- Name: number_of_lens_references(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_lens_references(integer) RETURNS bigint
    AS $_$select count(photo_tech.identifier) from photo_tech, lens where photo_tech.lens=lens.identifier and lens.identifier = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_lens_references(integer) OWNER TO po_user;

--
-- Name: number_of_location_references(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_location_references(integer) RETURNS bigint
    AS $_$select count(photo.identifier) from photo, location where photo.location=location.identifier and location.identifier = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_location_references(integer) OWNER TO po_user;

--
-- Name: number_of_manufacturer_ref(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_manufacturer_ref(integer) RETURNS bigint
    AS $_$select ((select count(identifier) from lens_type where manufacturer = $1) + (select count(identifier) from camera_type where manufacturer = $1) + (select count(identifier) from flash_type where manufacturer = $1) + (select count(identifier) from scanner_type where manufacturer = $1) + (select count(identifier) from support_type where manufacturer = $1) + (select count(identifier) from film_type where manufacturer = $1) + (select count(identifier) from flash_type where manufacturer = $1))$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_manufacturer_ref(integer) OWNER TO po_user;

--
-- Name: number_of_scanner_references(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_scanner_references(integer) RETURNS bigint
    AS $_$select count(photo_tech.identifier) from photo_tech, scanner where photo_tech.scanner=scanner.identifier and scanner.identifier = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_scanner_references(integer) OWNER TO po_user;

--
-- Name: number_of_support_references(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION number_of_support_references(integer) RETURNS bigint
    AS $_$select count(photo_tech.identifier) from photo_tech, support where photo_tech.support=support.identifier and support.identifier = $1$_$
    LANGUAGE sql;


ALTER FUNCTION public.number_of_support_references(integer) OWNER TO po_user;

--
-- Name: photo_shop_transaction_references(integer); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION photo_shop_transaction_references(integer) RETURNS bigint
    AS $_$select count(shop_order.transaction) from photo_item, shop_order where photo_item.photo = $1 and photo_item.identifier=shop_order.item$_$
    LANGUAGE sql;


ALTER FUNCTION public.photo_shop_transaction_references(integer) OWNER TO po_user;

--
-- Name: tokenized_ilike(character varying, character varying); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION tokenized_ilike(character varying, character varying) RETURNS boolean
    AS $_$ declare string alias for $1; keyword alias for $2; begin return tokenized_like(lower(string), lower(keyword)); end; $_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.tokenized_ilike(character varying, character varying) OWNER TO po_user;

--
-- Name: tokenized_ilike(integer, character varying); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION tokenized_ilike(integer, character varying) RETURNS boolean
    AS $_$ declare identifier alias for $1; keyword alias for $2; begin return tokenized_ilike(text(identifier), keyword); end; $_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.tokenized_ilike(integer, character varying) OWNER TO po_user;

--
-- Name: tokenized_like(character varying, character varying); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION tokenized_like(character varying, character varying) RETURNS boolean
    AS $_$ declare string alias for $1; keyword alias for $2;  token varchar; character char; string_length integer; token_length integer; token_begin integer; index_cursor integer; head_cursor integer; begin head_cursor := 1; string_length := char_length(string);  while head_cursor < string_length loop token_length := 0; index_cursor := head_cursor; token_begin := head_cursor; character := substring(string from index_cursor for 1); while index_cursor <= string_length loop if ((character = ' ') or (character = ';') or (index_cursor = string_length)) then if (index_cursor = string_length) then token_length := token_length + 1; end if; token := substring(string from token_begin for token_length); if (token = keyword) then return true; end if; end if; token_length := token_length + 1; index_cursor := index_cursor + 1; character := substring(string from index_cursor for 1); end loop;  index_cursor := head_cursor; while index_cursor <= string_length loop character := substring(string from index_cursor for 1); if ((character = ' ') or (character = ';') or (index_cursor = string_length)) then head_cursor := index_cursor + 1; exit; end if; index_cursor := index_cursor + 1; end loop; end loop;  return false; end; $_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.tokenized_like(character varying, character varying) OWNER TO po_user;

--
-- Name: tokenized_like(integer, character varying); Type: FUNCTION; Schema: public; Owner: po_user
--

CREATE FUNCTION tokenized_like(integer, character varying) RETURNS boolean
    AS $_$ declare identifier alias for $1; keyword alias for $2; begin return tokenized_like(text(identifier), keyword); end; $_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.tokenized_like(integer, character varying) OWNER TO po_user;

--
-- Name: =##=; Type: OPERATOR; Schema: public; Owner: po_user
--

CREATE OPERATOR =##= (
    PROCEDURE = tokenized_ilike,
    LEFTARG = character varying,
    RIGHTARG = character varying,
    COMMUTATOR = =##=
);


ALTER OPERATOR public.=##= (character varying, character varying) OWNER TO po_user;

--
-- Name: =##=; Type: OPERATOR; Schema: public; Owner: po_user
--

CREATE OPERATOR =##= (
    PROCEDURE = tokenized_ilike,
    LEFTARG = integer,
    RIGHTARG = character varying,
    COMMUTATOR = =##=
);


ALTER OPERATOR public.=##= (integer, character varying) OWNER TO po_user;

--
-- Name: ====; Type: OPERATOR; Schema: public; Owner: po_user
--

CREATE OPERATOR ==== (
    PROCEDURE = tokenized_like,
    LEFTARG = character varying,
    RIGHTARG = character varying,
    COMMUTATOR = ====
);


ALTER OPERATOR public.==== (character varying, character varying) OWNER TO po_user;

--
-- Name: ====; Type: OPERATOR; Schema: public; Owner: po_user
--

CREATE OPERATOR ==== (
    PROCEDURE = tokenized_like,
    LEFTARG = integer,
    RIGHTARG = character varying,
    COMMUTATOR = ====
);


ALTER OPERATOR public.==== (integer, character varying) OWNER TO po_user;

--
-- Name: |||; Type: OPERATOR; Schema: public; Owner: po_user
--

CREATE OPERATOR ||| (
    PROCEDURE = concat_ignore_null,
    LEFTARG = character varying,
    RIGHTARG = character varying
);


ALTER OPERATOR public.||| (character varying, character varying) OWNER TO po_user;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: access_type; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE access_type (
    identifier integer NOT NULL,
    value character varying(10)
);


ALTER TABLE public.access_type OWNER TO po_user;

--
-- Name: access_type_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE access_type_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.access_type_id_sequence OWNER TO po_user;

--
-- Name: album; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE album (
    identifier integer NOT NULL,
    users integer NOT NULL,
    caption text,
    date_of_creation timestamp without time zone,
    access_rights integer NOT NULL,
    "type" character(1),
    orderby integer,
    description text,
    parent_album integer,
    CONSTRAINT album_type_check CHECK ((("type" = 'c'::bpchar) OR ("type" = 'u'::bpchar)))
);


ALTER TABLE public.album OWNER TO po_user;

--
-- Name: album_content; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE album_content (
    identifier integer NOT NULL,
    photo integer NOT NULL,
    album integer NOT NULL
);


ALTER TABLE public.album_content OWNER TO po_user;

--
-- Name: album_content_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE album_content_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.album_content_id_sequence OWNER TO po_user;

--
-- Name: album_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE album_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.album_id_sequence OWNER TO po_user;

--
-- Name: aperture; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE aperture (
    identifier integer NOT NULL,
    value numeric
);


ALTER TABLE public.aperture OWNER TO po_user;

--
-- Name: aperture_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE aperture_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.aperture_id_sequence OWNER TO po_user;

--
-- Name: calendar; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE calendar (
    identifier integer NOT NULL,
    users integer NOT NULL,
    start_date timestamp without time zone,
    end_date timestamp without time zone,
    date_of_creation timestamp without time zone,
    remark text
);


ALTER TABLE public.calendar OWNER TO po_user;

--
-- Name: calendar_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE calendar_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.calendar_id_sequence OWNER TO po_user;

--
-- Name: camera; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE camera (
    identifier integer NOT NULL,
    "type" integer,
    users integer,
    serial_number character varying(20),
    date_of_purchase timestamp without time zone,
    purchased_new character(1),
    access_rights integer NOT NULL,
    CONSTRAINT camera_purchased_new_check CHECK (((purchased_new = 't'::bpchar) OR (purchased_new = 'f'::bpchar)))
);


ALTER TABLE public.camera OWNER TO po_user;

--
-- Name: camera_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE camera_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.camera_id_sequence OWNER TO po_user;

--
-- Name: camera_metering; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE camera_metering (
    identifier integer NOT NULL,
    value character varying(40)
);


ALTER TABLE public.camera_metering OWNER TO po_user;

--
-- Name: camera_metering_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE camera_metering_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.camera_metering_id_sequence OWNER TO po_user;

--
-- Name: camera_program; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE camera_program (
    identifier integer NOT NULL,
    value character varying(40)
);


ALTER TABLE public.camera_program OWNER TO po_user;

--
-- Name: camera_program_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE camera_program_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.camera_program_id_sequence OWNER TO po_user;

--
-- Name: camera_type; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE camera_type (
    identifier integer NOT NULL,
    manufacturer integer NOT NULL,
    model character varying(100),
    variation character varying(100),
    last_modified_date timestamp without time zone,
    last_modifying_users integer,
    raw_icc_profile integer
);


ALTER TABLE public.camera_type OWNER TO po_user;

--
-- Name: camera_type_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE camera_type_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.camera_type_id_sequence OWNER TO po_user;

--
-- Name: client; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE client (
    identifier integer NOT NULL,
    users integer NOT NULL,
    client integer NOT NULL,
    date_of_creation timestamp without time zone,
    status integer NOT NULL,
    "trusted" character(1),
    CONSTRAINT client_trusted_check CHECK ((("trusted" = 't'::bpchar) OR ("trusted" = 'f'::bpchar)))
);


ALTER TABLE public.client OWNER TO po_user;

--
-- Name: client_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE client_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.client_id_sequence OWNER TO po_user;

--
-- Name: client_status; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE client_status (
    identifier integer NOT NULL,
    value character varying(12)
);


ALTER TABLE public.client_status OWNER TO po_user;

--
-- Name: client_status_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE client_status_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.client_status_id_sequence OWNER TO po_user;

--
-- Name: contact_info; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE contact_info (
    identifier integer NOT NULL,
    address1 character varying(100),
    address2 character varying(100),
    city character varying(100),
    zipcode character varying(10),
    state integer,
    country integer,
    phone character varying(40),
    email character varying(150),
    url character varying(150)
);


ALTER TABLE public.contact_info OWNER TO po_user;

--
-- Name: contact_info_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE contact_info_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.contact_info_id_sequence OWNER TO po_user;

--
-- Name: country; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE country (
    identifier integer NOT NULL,
    code character varying(5),
    value character varying(40)
);


ALTER TABLE public.country OWNER TO po_user;

--
-- Name: country_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE country_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.country_id_sequence OWNER TO po_user;

--
-- Name: currency; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE currency (
    identifier integer NOT NULL,
    numeric_code numeric,
    alpha_code character varying(5),
    name character varying(40),
    entity text
);


ALTER TABLE public.currency OWNER TO po_user;

--
-- Name: currency_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE currency_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.currency_id_sequence OWNER TO po_user;

--
-- Name: dcraw_options; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE dcraw_options (
    identifier integer NOT NULL,
    gamma double precision,
    brightness double precision,
    white_balance character varying(10),
    bitdepth integer,
    CONSTRAINT dcraw_options_bitdepth_check CHECK (((bitdepth = 24) OR (bitdepth = 48))),
    CONSTRAINT dcraw_options_white_balance_check CHECK ((((white_balance)::text = 'camera'::text) OR ((white_balance)::text = 'automatic'::text)))
);


ALTER TABLE public.dcraw_options OWNER TO po_user;

--
-- Name: dcraw_options_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE dcraw_options_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.dcraw_options_id_sequence OWNER TO po_user;

--
-- Name: ev_comp; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE ev_comp (
    identifier integer NOT NULL,
    value character varying(10)
);


ALTER TABLE public.ev_comp OWNER TO po_user;

--
-- Name: ev_comp_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE ev_comp_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.ev_comp_id_sequence OWNER TO po_user;

--
-- Name: film; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE film (
    identifier integer NOT NULL,
    "type" integer NOT NULL,
    users integer NOT NULL,
    access_rights integer NOT NULL
);


ALTER TABLE public.film OWNER TO po_user;

--
-- Name: film_format; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE film_format (
    identifier integer NOT NULL,
    value character varying(10)
);


ALTER TABLE public.film_format OWNER TO po_user;

--
-- Name: film_format_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE film_format_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.film_format_id_sequence OWNER TO po_user;

--
-- Name: film_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE film_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.film_id_sequence OWNER TO po_user;

--
-- Name: film_iso; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE film_iso (
    identifier integer NOT NULL,
    value integer
);


ALTER TABLE public.film_iso OWNER TO po_user;

--
-- Name: film_iso_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE film_iso_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.film_iso_id_sequence OWNER TO po_user;

--
-- Name: film_type; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE film_type (
    identifier integer NOT NULL,
    manufacturer integer NOT NULL,
    model character varying(100),
    iso integer NOT NULL,
    format integer NOT NULL,
    last_modified_date timestamp without time zone,
    last_modifying_users integer
);


ALTER TABLE public.film_type OWNER TO po_user;

--
-- Name: film_type_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE film_type_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.film_type_id_sequence OWNER TO po_user;

--
-- Name: filter; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE filter (
    identifier integer NOT NULL,
    "type" integer NOT NULL,
    users integer NOT NULL,
    date_of_purchase timestamp without time zone,
    purchased_new character(1),
    access_rights integer NOT NULL,
    serial_number character varying(20),
    CONSTRAINT filter_purchased_new_check CHECK (((purchased_new = 't'::bpchar) OR (purchased_new = 'f'::bpchar)))
);


ALTER TABLE public.filter OWNER TO po_user;

--
-- Name: filter_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE filter_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.filter_id_sequence OWNER TO po_user;

--
-- Name: filter_type; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE filter_type (
    identifier integer NOT NULL,
    manufacturer integer NOT NULL,
    model character varying(100),
    variation character varying(100),
    last_modified_date timestamp without time zone,
    last_modifying_users integer
);


ALTER TABLE public.filter_type OWNER TO po_user;

--
-- Name: filter_type_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE filter_type_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.filter_type_id_sequence OWNER TO po_user;

--
-- Name: flash; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE flash (
    identifier integer NOT NULL,
    "type" integer NOT NULL,
    users integer NOT NULL,
    serial_number character varying(20),
    date_of_purchase timestamp without time zone,
    purchased_new character(1),
    access_rights integer NOT NULL,
    CONSTRAINT flash_purchased_new_check CHECK (((purchased_new = 't'::bpchar) OR (purchased_new = 'f'::bpchar)))
);


ALTER TABLE public.flash OWNER TO po_user;

--
-- Name: flash_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE flash_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.flash_id_sequence OWNER TO po_user;

--
-- Name: flash_mode; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE flash_mode (
    identifier integer NOT NULL,
    value character varying(40)
);


ALTER TABLE public.flash_mode OWNER TO po_user;

--
-- Name: flash_mode_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE flash_mode_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.flash_mode_id_sequence OWNER TO po_user;

--
-- Name: flash_type; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE flash_type (
    identifier integer NOT NULL,
    manufacturer integer NOT NULL,
    model character varying(100),
    variation character varying(100),
    last_modified_date timestamp without time zone,
    last_modifying_users integer
);


ALTER TABLE public.flash_type OWNER TO po_user;

--
-- Name: flash_type_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE flash_type_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.flash_type_id_sequence OWNER TO po_user;

--
-- Name: focal_length; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE focal_length (
    identifier integer NOT NULL,
    value integer
);


ALTER TABLE public.focal_length OWNER TO po_user;

--
-- Name: focal_length_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE focal_length_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.focal_length_id_sequence OWNER TO po_user;

--
-- Name: folder; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE folder (
    identifier integer NOT NULL,
    parent_folder integer,
    users integer NOT NULL,
    caption text,
    date_of_creation timestamp without time zone,
    access_rights integer NOT NULL,
    orderby integer,
    description text
);


ALTER TABLE public.folder OWNER TO po_user;

--
-- Name: folder_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE folder_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.folder_id_sequence OWNER TO po_user;

--
-- Name: imagemagick_composite_options; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE imagemagick_composite_options (
    identifier integer NOT NULL,
    gravity character varying(20),
    watermark integer NOT NULL,
    photo_version integer,
    CONSTRAINT imagemagick_composite_options_gravity_check CHECK ((((((((((((gravity)::text = 'center'::text) OR ((gravity)::text = 'northwest'::text)) OR ((gravity)::text = 'north'::text)) OR ((gravity)::text = 'northeast'::text)) OR ((gravity)::text = 'west'::text)) OR ((gravity)::text = 'center'::text)) OR ((gravity)::text = 'east'::text)) OR ((gravity)::text = 'southwest'::text)) OR ((gravity)::text = 'south'::text)) OR ((gravity)::text = 'southeast'::text)))
);


ALTER TABLE public.imagemagick_composite_options OWNER TO po_user;

--
-- Name: imagemagick_composite_options_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE imagemagick_composite_options_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.imagemagick_composite_options_id_sequence OWNER TO po_user;

--
-- Name: imagemagick_options; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE imagemagick_options (
    identifier integer NOT NULL,
    preview_quality integer,
    preview_colorspace character varying(20),
    preview_gamma double precision,
    preview_sharpen_radius double precision,
    preview_sharpen_sigma double precision,
    preview_border_width integer,
    preview_border_height integer,
    preview_border_color character varying(6),
    thumb_quality integer,
    thumb_colorspace character varying(20),
    thumb_gamma double precision,
    thumb_sharpen_radius double precision,
    thumb_sharpen_sigma double precision,
    thumb_border_width integer,
    thumb_border_height integer,
    thumb_border_color character varying(6),
    preview_sharpen_threshold double precision,
    preview_sharpen_amount double precision,
    thumb_sharpen_threshold double precision,
    thumb_sharpen_amount double precision
);


ALTER TABLE public.imagemagick_options OWNER TO po_user;

--
-- Name: imagemagick_options_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE imagemagick_options_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.imagemagick_options_id_sequence OWNER TO po_user;

--
-- Name: label; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE label (
    identifier integer NOT NULL,
    users integer,
    manufacturer integer,
    name character varying(300),
    space_x double precision,
    space_y double precision,
    size_x double precision,
    size_y double precision,
    offset_x double precision,
    offset_y double precision,
    columns double precision,
    "rows" double precision,
    paper integer NOT NULL,
    date_of_creation timestamp without time zone,
    last_modified_date timestamp without time zone
);


ALTER TABLE public.label OWNER TO po_user;

--
-- Name: label_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE label_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.label_id_sequence OWNER TO po_user;

--
-- Name: lens; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE lens (
    identifier integer NOT NULL,
    "type" integer NOT NULL,
    users integer NOT NULL,
    serial_number character varying(20),
    date_of_purchase timestamp without time zone,
    purchased_new character(1),
    access_rights integer NOT NULL,
    CONSTRAINT lens_purchased_new_check CHECK (((purchased_new = 't'::bpchar) OR (purchased_new = 'f'::bpchar)))
);


ALTER TABLE public.lens OWNER TO po_user;

--
-- Name: lens_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE lens_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.lens_id_sequence OWNER TO po_user;

--
-- Name: lens_type; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE lens_type (
    identifier integer NOT NULL,
    manufacturer integer NOT NULL,
    model character varying(100),
    variation character varying(100),
    min_focal_length integer NOT NULL,
    max_focal_length integer NOT NULL,
    min_aperture integer NOT NULL,
    max_aperture integer NOT NULL,
    last_modified_date timestamp without time zone,
    last_modifying_users integer
);


ALTER TABLE public.lens_type OWNER TO po_user;

--
-- Name: lens_type_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE lens_type_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.lens_type_id_sequence OWNER TO po_user;

--
-- Name: location; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE "location" (
    identifier integer NOT NULL,
    place character varying(300),
    state integer,
    country integer,
    last_modified_date timestamp without time zone,
    users integer,
    city character varying(300),
    latitude character varying(10),
    longitude character varying(10),
    private boolean NOT NULL
);


ALTER TABLE public."location" OWNER TO po_user;

--
-- Name: location_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE location_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.location_id_sequence OWNER TO po_user;

--
-- Name: manufacturer; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE manufacturer (
    identifier integer NOT NULL,
    name character varying(100),
    url character varying(100),
    last_modified_date timestamp without time zone,
    last_modifying_users integer
);


ALTER TABLE public.manufacturer OWNER TO po_user;

--
-- Name: manufacturer_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE manufacturer_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.manufacturer_id_sequence OWNER TO po_user;

--
-- Name: orientations; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE orientations (
    identifier integer NOT NULL,
    name character varying(100),
    im_transform character varying(100)
);


ALTER TABLE public.orientations OWNER TO po_user;

--
-- Name: orientations_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE orientations_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.orientations_id_sequence OWNER TO po_user;

--
-- Name: paper; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE paper (
    identifier integer NOT NULL,
    name character varying(300),
    size_x double precision,
    size_y double precision,
    last_modified_date timestamp without time zone,
    last_modifying_users integer
);


ALTER TABLE public.paper OWNER TO po_user;

--
-- Name: paper_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE paper_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.paper_id_sequence OWNER TO po_user;

--
-- Name: photo; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE photo (
    identifier integer NOT NULL,
    users integer NOT NULL,
    folder integer NOT NULL,
    "location" integer NOT NULL,
    caption text,
    date_of_exposure timestamp without time zone,
    access_rights integer NOT NULL,
    views integer,
    copyright_statement text,
    hide_original character(1),
    author text,
    title text,
    caption_writer text,
    category character varying(3),
    credit text,
    source text,
    headline text,
    instructions text,
    transmission_reference text,
    supplemental_category text,
    web_statement text,
    CONSTRAINT photo_hide_original_check CHECK (((hide_original = 't'::bpchar) OR (hide_original = 'f'::bpchar)))
);


ALTER TABLE public.photo OWNER TO po_user;

--
-- Name: photo_dupe; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE photo_dupe (
    identifier integer NOT NULL,
    "key" integer NOT NULL,
    photo integer NOT NULL,
    date_of_creation timestamp without time zone,
    storage_location character varying(50),
    storage_index character varying(10),
    remark text
);


ALTER TABLE public.photo_dupe OWNER TO po_user;

--
-- Name: photo_dupe_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE photo_dupe_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.photo_dupe_id_sequence OWNER TO po_user;

--
-- Name: photo_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE photo_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.photo_id_sequence OWNER TO po_user;

--
-- Name: photo_item; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE photo_item (
    identifier integer NOT NULL,
    photo integer NOT NULL,
    shop_item integer NOT NULL,
    price numeric,
    currency integer,
    "comment" text,
    date_of_creation timestamp without time zone,
    date_of_last_edit timestamp without time zone,
    deleted character(1),
    CONSTRAINT photo_item_deleted_check CHECK (((deleted = 't'::bpchar) OR (deleted = 'f'::bpchar)))
);


ALTER TABLE public.photo_item OWNER TO po_user;

--
-- Name: photo_item_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE photo_item_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.photo_item_id_sequence OWNER TO po_user;

--
-- Name: photo_keywords; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE photo_keywords (
    photo integer NOT NULL,
    keyword text NOT NULL
);


ALTER TABLE public.photo_keywords OWNER TO po_user;

--
-- Name: photo_spooler; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE photo_spooler (
    identifier integer NOT NULL,
    users integer,
    photo integer
);


ALTER TABLE public.photo_spooler OWNER TO po_user;

--
-- Name: photo_spooler_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE photo_spooler_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.photo_spooler_id_sequence OWNER TO po_user;

--
-- Name: photo_tech; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE photo_tech (
    identifier integer NOT NULL,
    photo integer NOT NULL,
    camera integer,
    lens integer,
    film integer,
    flash integer,
    scanner integer,
    filter integer,
    scan_resolution integer,
    aperture integer,
    focal_length integer,
    shutter integer,
    camera_metering integer,
    camera_program integer,
    flash_mode integer,
    exposure_comp integer,
    flash_comp integer,
    ev_difference integer,
    iso_override integer,
    support integer,
    scan_bitdepth integer,
    scan_multiscan integer,
    exif text,
    iptc text
);


ALTER TABLE public.photo_tech OWNER TO po_user;

--
-- Name: photo_tech_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE photo_tech_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.photo_tech_id_sequence OWNER TO po_user;

--
-- Name: photo_version; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE photo_version (
    identifier integer NOT NULL,
    "key" integer NOT NULL,
    photo integer NOT NULL,
    master character(1),
    small_image_path character varying(500),
    medium_image_path character varying(500),
    large_image_path character varying(500),
    date_of_creation timestamp without time zone,
    "comment" text,
    original_image_name character varying(500),
    colorspace integer NOT NULL,
    orientation integer NOT NULL,
    CONSTRAINT photo_version_master_check CHECK (((master = 't'::bpchar) OR (master = 'f'::bpchar)))
);


ALTER TABLE public.photo_version OWNER TO po_user;

--
-- Name: photo_version_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE photo_version_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.photo_version_id_sequence OWNER TO po_user;

--
-- Name: preferences; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE preferences (
    identifier integer NOT NULL,
    print_out character(3),
    start_hour integer,
    end_hour integer,
    start_day integer,
    num_of_rows integer,
    num_of_columns integer,
    folder_view character(5),
    num_of_rows_l integer,
    bulk_upload_enable character(1),
    paper integer,
    label integer,
    shop_enable character(1),
    popup_enable character(1),
    popup_delay integer,
    quota_size integer,
    quota_count integer,
    search_enable_stemming character(1),
    search_default_mode integer,
    download_counter integer,
    download_expiry_period integer,
    CONSTRAINT preferences_bulk_upload_enable_check CHECK (((bulk_upload_enable = 't'::bpchar) OR (bulk_upload_enable = 'f'::bpchar))),
    CONSTRAINT preferences_folder_view_check CHECK (((folder_view = 'slide'::bpchar) OR (folder_view = 'list'::bpchar))),
    CONSTRAINT preferences_print_out_check CHECK (((print_out = 'ps'::bpchar) OR (print_out = 'pdf'::bpchar))),
    CONSTRAINT preferences_search_enable_stemming_check CHECK (((search_enable_stemming = 't'::bpchar) OR (search_enable_stemming = 'f'::bpchar))),
    CONSTRAINT preferences_shop_enable_check CHECK (((shop_enable = 't'::bpchar) OR (shop_enable = 'f'::bpchar))),
    CONSTRAINT preferences_shop_enable_check1 CHECK (((shop_enable = 't'::bpchar) OR (shop_enable = 'f'::bpchar))),
    CONSTRAINT preferences_start_day_check CHECK (((start_day = 1) OR (start_day = 0))),
    CONSTRAINT preferences_start_hour_check CHECK (((start_hour >= 0) AND (start_hour < 24))),
    CONSTRAINT preferences_start_hour_check1 CHECK (((start_hour >= 0) AND (start_hour < 24)))
);


ALTER TABLE public.preferences OWNER TO po_user;

--
-- Name: preferences_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE preferences_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.preferences_id_sequence OWNER TO po_user;

--
-- Name: print_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE print_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.print_id_sequence OWNER TO po_user;

--
-- Name: rating; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE rating (
    identifier integer NOT NULL,
    photo integer NOT NULL,
    users integer NOT NULL,
    date_of_creation timestamp without time zone,
    value integer NOT NULL,
    "comment" text
);


ALTER TABLE public.rating OWNER TO po_user;

--
-- Name: rating_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE rating_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.rating_id_sequence OWNER TO po_user;

--
-- Name: scan_bitdepth; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE scan_bitdepth (
    identifier integer NOT NULL,
    value character varying(6)
);


ALTER TABLE public.scan_bitdepth OWNER TO po_user;

--
-- Name: scan_bitdepth_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE scan_bitdepth_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.scan_bitdepth_id_sequence OWNER TO po_user;

--
-- Name: scan_multiscan; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE scan_multiscan (
    identifier integer NOT NULL,
    value integer
);


ALTER TABLE public.scan_multiscan OWNER TO po_user;

--
-- Name: scan_multiscan_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE scan_multiscan_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.scan_multiscan_id_sequence OWNER TO po_user;

--
-- Name: scan_resolution; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE scan_resolution (
    identifier integer NOT NULL,
    value character varying(6)
);


ALTER TABLE public.scan_resolution OWNER TO po_user;

--
-- Name: scan_resolution_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE scan_resolution_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.scan_resolution_id_sequence OWNER TO po_user;

--
-- Name: scanner; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE scanner (
    identifier integer NOT NULL,
    "type" integer NOT NULL,
    users integer NOT NULL,
    serial_number character varying(20),
    date_of_purchase timestamp without time zone,
    purchased_new character(1),
    access_rights integer NOT NULL,
    CONSTRAINT scanner_purchased_new_check CHECK (((purchased_new = 't'::bpchar) OR (purchased_new = 'f'::bpchar)))
);


ALTER TABLE public.scanner OWNER TO po_user;

--
-- Name: scanner_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE scanner_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.scanner_id_sequence OWNER TO po_user;

--
-- Name: scanner_type; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE scanner_type (
    identifier integer NOT NULL,
    manufacturer integer NOT NULL,
    model character varying(100),
    variation character varying(100),
    last_modified_date timestamp without time zone,
    last_modifying_users integer
);


ALTER TABLE public.scanner_type OWNER TO po_user;

--
-- Name: scanner_type_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE scanner_type_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.scanner_type_id_sequence OWNER TO po_user;

--
-- Name: shop_category; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE shop_category (
    identifier integer NOT NULL,
    users integer NOT NULL,
    caption character varying(300),
    date_of_creation timestamp without time zone
);


ALTER TABLE public.shop_category OWNER TO po_user;

--
-- Name: shop_category_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE shop_category_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.shop_category_id_sequence OWNER TO po_user;

--
-- Name: shop_item; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE shop_item (
    identifier integer NOT NULL,
    users integer,
    date_of_creation timestamp without time zone,
    date_of_last_edit timestamp without time zone,
    description character varying(200),
    category integer NOT NULL
);


ALTER TABLE public.shop_item OWNER TO po_user;

--
-- Name: shop_item_generator_rule; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE shop_item_generator_rule (
    identifier integer NOT NULL,
    users integer NOT NULL,
    shop_item integer NOT NULL,
    price numeric,
    currency integer,
    "comment" text,
    date_of_creation timestamp without time zone,
    date_of_last_edit timestamp without time zone
);


ALTER TABLE public.shop_item_generator_rule OWNER TO po_user;

--
-- Name: shop_item_generator_rule_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE shop_item_generator_rule_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.shop_item_generator_rule_id_sequence OWNER TO po_user;

--
-- Name: shop_item_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE shop_item_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.shop_item_id_sequence OWNER TO po_user;

--
-- Name: shop_order; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE shop_order (
    identifier integer NOT NULL,
    client integer,
    "transaction" integer,
    item integer NOT NULL,
    pieces numeric,
    date_of_creation timestamp without time zone,
    date_of_last_edit timestamp without time zone,
    download_counter integer,
    download_expiry_date date
);


ALTER TABLE public.shop_order OWNER TO po_user;

--
-- Name: shop_order_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE shop_order_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.shop_order_id_sequence OWNER TO po_user;

--
-- Name: shop_transaction; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE shop_transaction (
    identifier integer NOT NULL,
    status integer NOT NULL,
    remark text,
    date_of_creation timestamp without time zone,
    date_of_last_edit timestamp without time zone
);


ALTER TABLE public.shop_transaction OWNER TO po_user;

--
-- Name: shop_transaction_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE shop_transaction_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.shop_transaction_id_sequence OWNER TO po_user;

--
-- Name: shop_transaction_status; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE shop_transaction_status (
    identifier integer NOT NULL,
    value character varying(15)
);


ALTER TABLE public.shop_transaction_status OWNER TO po_user;

--
-- Name: shop_transaction_status_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE shop_transaction_status_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.shop_transaction_status_id_sequence OWNER TO po_user;

--
-- Name: shutter; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE shutter (
    identifier integer NOT NULL,
    value character varying(10)
);


ALTER TABLE public.shutter OWNER TO po_user;

--
-- Name: shutter_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE shutter_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.shutter_id_sequence OWNER TO po_user;

--
-- Name: state; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE state (
    identifier integer NOT NULL,
    code character varying(5),
    value character varying(40)
);


ALTER TABLE public.state OWNER TO po_user;

--
-- Name: state_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE state_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.state_id_sequence OWNER TO po_user;

--
-- Name: submission; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE submission (
    identifier integer NOT NULL,
    photo_dupe integer NOT NULL,
    status integer NOT NULL,
    users integer,
    date_of_creation timestamp without time zone,
    remark text
);


ALTER TABLE public.submission OWNER TO po_user;

--
-- Name: submission_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE submission_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.submission_id_sequence OWNER TO po_user;

--
-- Name: submission_status; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE submission_status (
    identifier integer NOT NULL,
    value character varying(10)
);


ALTER TABLE public.submission_status OWNER TO po_user;

--
-- Name: submission_status_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE submission_status_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.submission_status_id_sequence OWNER TO po_user;

--
-- Name: support; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE support (
    identifier integer NOT NULL,
    "type" integer NOT NULL,
    users integer NOT NULL,
    serial_number character varying(20),
    date_of_purchase timestamp without time zone,
    purchased_new character(1),
    access_rights integer NOT NULL,
    CONSTRAINT support_purchased_new_check CHECK (((purchased_new = 't'::bpchar) OR (purchased_new = 'f'::bpchar)))
);


ALTER TABLE public.support OWNER TO po_user;

--
-- Name: support_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE support_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.support_id_sequence OWNER TO po_user;

--
-- Name: support_type; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE support_type (
    identifier integer NOT NULL,
    manufacturer integer NOT NULL,
    model character varying(100),
    variation character varying(100),
    last_modified_date timestamp without time zone,
    last_modifying_users integer
);


ALTER TABLE public.support_type OWNER TO po_user;

--
-- Name: support_type_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE support_type_id_sequence
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.support_type_id_sequence OWNER TO po_user;

--
-- Name: system_preferences; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE system_preferences (
    identifier integer NOT NULL,
    new_user_type integer NOT NULL,
    new_user_bulk_upload_enable character(1),
    new_user_paper integer,
    new_user_label integer,
    current_volume character varying(500),
    volume_max_size integer,
    new_user_shop_enable character(1),
    new_user_quota_size integer,
    new_user_quota_count integer,
    new_user_shared character(1),
    CONSTRAINT system_preferences_new_user_bulk_upload_enable_check CHECK (((new_user_bulk_upload_enable = 't'::bpchar) OR (new_user_bulk_upload_enable = 'f'::bpchar))),
    CONSTRAINT system_preferences_new_user_shared_check CHECK (((new_user_shared = 't'::bpchar) OR (new_user_shared = 'f'::bpchar))),
    CONSTRAINT system_preferences_new_user_shop_enable_check CHECK (((new_user_shop_enable = 't'::bpchar) OR (new_user_shop_enable = 'f'::bpchar)))
);


ALTER TABLE public.system_preferences OWNER TO po_user;

--
-- Name: user_type; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE user_type (
    identifier integer NOT NULL,
    value character varying(15)
);


ALTER TABLE public.user_type OWNER TO po_user;

--
-- Name: user_type_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE user_type_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.user_type_id_sequence OWNER TO po_user;

--
-- Name: users; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE users (
    identifier integer NOT NULL,
    first_name character varying(50),
    last_name character varying(50),
    company character varying(50),
    username character varying(30),
    "password" character varying(30),
    session_id character varying(32),
    contact integer,
    member_since timestamp without time zone,
    preferences integer,
    "type" integer NOT NULL,
    imagemagick_options integer NOT NULL,
    shared character(1),
    imagemagick_composite_options integer NOT NULL,
    dcraw_options integer NOT NULL,
    CONSTRAINT users_shared_check CHECK (((shared = 't'::bpchar) OR (shared = 'f'::bpchar)))
);


ALTER TABLE public.users OWNER TO po_user;

--
-- Name: users_id_sequence; Type: SEQUENCE; Schema: public; Owner: po_user
--

CREATE SEQUENCE users_id_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.users_id_sequence OWNER TO po_user;

--
-- Name: version; Type: TABLE; Schema: public; Owner: po_user; Tablespace: 
--

CREATE TABLE version (
    identifier integer NOT NULL,
    description character varying(300),
    major smallint,
    minor smallint,
    variation character varying(1)
);


ALTER TABLE public.version OWNER TO po_user;

--
-- Name: view_camera; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_camera AS
    SELECT camera.identifier, manufacturer.name, camera_type.model, camera_type.variation, camera.serial_number, camera.users, camera.date_of_purchase, camera.purchased_new, manufacturer.url, access_type.value AS access_rights, camera_type.raw_icc_profile FROM camera_type, camera, manufacturer, access_type WHERE (((camera_type.manufacturer = manufacturer.identifier) AND (camera_type.identifier = camera."type")) AND (camera.access_rights = access_type.identifier)) ORDER BY manufacturer.name, camera_type.model, camera_type.variation;


ALTER TABLE public.view_camera OWNER TO po_user;

--
-- Name: view_camera_type; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_camera_type AS
    SELECT camera_type.identifier, manufacturer.name, camera_type.model, camera_type.variation, manufacturer.url, camera_type.raw_icc_profile FROM camera_type, manufacturer WHERE (camera_type.manufacturer = manufacturer.identifier) ORDER BY manufacturer.name, camera_type.model, camera_type.variation;


ALTER TABLE public.view_camera_type OWNER TO po_user;

--
-- Name: view_client; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_client AS
    SELECT client.identifier, client.users, client.client, users.last_name, users.first_name, client.date_of_creation, client_status.value, client.status, users."type", client."trusted" FROM client, users, client_status WHERE ((client.client = users.identifier) AND (client.status = client_status.identifier)) ORDER BY users.last_name, users.first_name;


ALTER TABLE public.view_client OWNER TO po_user;

--
-- Name: view_contact; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_contact AS
    SELECT client.identifier, client.users, client.client, users.last_name, users.first_name, client.date_of_creation, client_status.value, client.status FROM client, users, client_status WHERE ((client.client = users.identifier) AND (client.status = client_status.identifier)) ORDER BY users.last_name, users.first_name;


ALTER TABLE public.view_contact OWNER TO po_user;

--
-- Name: view_contact_info; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_contact_info AS
    SELECT contact_info.identifier, contact_info.address1, contact_info.address2, contact_info.city, contact_info.zipcode, (SELECT state.value FROM state WHERE (state.identifier = contact_info.state)) AS state, (SELECT country.value FROM country WHERE (country.identifier = contact_info.country)) AS country, contact_info.phone, contact_info.email, contact_info.url FROM contact_info;


ALTER TABLE public.view_contact_info OWNER TO po_user;

--
-- Name: view_film; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_film AS
    SELECT film.identifier, manufacturer.name, film_type.model, film_iso.value AS iso, film_format.value AS format, film.users, manufacturer.url, access_type.value AS access_rights FROM film_type, film, manufacturer, film_iso, film_format, access_type WHERE (((((film_type.manufacturer = manufacturer.identifier) AND (film_type.identifier = film."type")) AND (film_type.iso = film_iso.identifier)) AND (film_type.format = film_format.identifier)) AND (film.access_rights = access_type.identifier)) ORDER BY manufacturer.name, film_type.model, film_iso.value;


ALTER TABLE public.view_film OWNER TO po_user;

--
-- Name: view_film_type; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_film_type AS
    SELECT film_type.identifier, manufacturer.name, film_type.model, film_iso.value AS iso, film_format.value AS format, manufacturer.url FROM film_type, manufacturer, film_iso, film_format WHERE (((film_type.manufacturer = manufacturer.identifier) AND (film_type.iso = film_iso.identifier)) AND (film_type.format = film_format.identifier)) ORDER BY manufacturer.name, film_type.model, film_iso.value;


ALTER TABLE public.view_film_type OWNER TO po_user;

--
-- Name: view_filter; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_filter AS
    SELECT filter.identifier, manufacturer.name, filter_type.model, filter_type.variation, filter.users, filter.date_of_purchase, filter.purchased_new, manufacturer.url, access_type.value AS access_rights, filter.serial_number FROM filter_type, filter, manufacturer, access_type WHERE (((filter_type.manufacturer = manufacturer.identifier) AND (filter_type.identifier = filter."type")) AND (filter.access_rights = access_type.identifier)) ORDER BY manufacturer.name, filter_type.model, filter_type.variation;


ALTER TABLE public.view_filter OWNER TO po_user;

--
-- Name: view_filter_type; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_filter_type AS
    SELECT filter_type.identifier, manufacturer.name, filter_type.model, filter_type.variation, manufacturer.url FROM filter_type, manufacturer WHERE (filter_type.manufacturer = manufacturer.identifier) ORDER BY manufacturer.name, filter_type.model, filter_type.variation;


ALTER TABLE public.view_filter_type OWNER TO po_user;

--
-- Name: view_flash; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_flash AS
    SELECT flash.identifier, manufacturer.name, flash_type.model, flash_type.variation, flash.serial_number, flash.users, flash.date_of_purchase, flash.purchased_new, manufacturer.url, access_type.value AS access_rights FROM flash_type, flash, manufacturer, access_type WHERE (((flash_type.manufacturer = manufacturer.identifier) AND (flash_type.identifier = flash."type")) AND (flash.access_rights = access_type.identifier)) ORDER BY manufacturer.name, flash_type.model, flash_type.variation;


ALTER TABLE public.view_flash OWNER TO po_user;

--
-- Name: view_flash_type; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_flash_type AS
    SELECT flash_type.identifier, manufacturer.name, flash_type.model, flash_type.variation, manufacturer.url FROM flash_type, manufacturer WHERE (flash_type.manufacturer = manufacturer.identifier) ORDER BY manufacturer.name, flash_type.model, flash_type.variation;


ALTER TABLE public.view_flash_type OWNER TO po_user;

--
-- Name: view_lens; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_lens AS
    SELECT lens.identifier, manufacturer.name, lens_type.model, lens_type.variation, t_min_aperture.s_min_aperture, t_max_aperture.s_max_aperture, t_min_focal_length.s_min_focal_length, t_max_focal_length.s_max_focal_length, lens.serial_number, lens.users, lens.date_of_purchase, lens.purchased_new, manufacturer.url, access_type.value AS access_rights FROM lens_type, lens, manufacturer, access_type, (SELECT focal_length.identifier, focal_length.value AS s_min_focal_length FROM focal_length) t_min_focal_length, (SELECT focal_length.identifier, focal_length.value AS s_max_focal_length FROM focal_length) t_max_focal_length, (SELECT aperture.identifier, aperture.value AS s_min_aperture FROM aperture) t_min_aperture, (SELECT aperture.identifier, aperture.value AS s_max_aperture FROM aperture) t_max_aperture WHERE (((((((lens_type.manufacturer = manufacturer.identifier) AND (lens_type.identifier = lens."type")) AND (lens_type.min_focal_length = t_min_focal_length.identifier)) AND (lens_type.max_focal_length = t_max_focal_length.identifier)) AND (lens_type.min_aperture = t_min_aperture.identifier)) AND (lens_type.max_aperture = t_max_aperture.identifier)) AND (lens.access_rights = access_type.identifier)) ORDER BY manufacturer.name, t_min_focal_length.s_min_focal_length, lens_type.model, lens_type.variation;


ALTER TABLE public.view_lens OWNER TO po_user;

--
-- Name: view_lens_type; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_lens_type AS
    SELECT lens_type.identifier, manufacturer.name, lens_type.model, lens_type.variation, t_min_aperture.s_min_aperture, t_max_aperture.s_max_aperture, t_min_focal_length.s_min_focal_length, t_max_focal_length.s_max_focal_length, manufacturer.url FROM lens_type, manufacturer, (SELECT focal_length.identifier, focal_length.value AS s_min_focal_length FROM focal_length) t_min_focal_length, (SELECT focal_length.identifier, focal_length.value AS s_max_focal_length FROM focal_length) t_max_focal_length, (SELECT aperture.identifier, aperture.value AS s_min_aperture FROM aperture) t_min_aperture, (SELECT aperture.identifier, aperture.value AS s_max_aperture FROM aperture) t_max_aperture WHERE (((((lens_type.manufacturer = manufacturer.identifier) AND (lens_type.min_focal_length = t_min_focal_length.identifier)) AND (lens_type.max_focal_length = t_max_focal_length.identifier)) AND (lens_type.min_aperture = t_min_aperture.identifier)) AND (lens_type.max_aperture = t_max_aperture.identifier)) ORDER BY manufacturer.name, t_min_focal_length.s_min_focal_length, lens_type.model, lens_type.variation;


ALTER TABLE public.view_lens_type OWNER TO po_user;

--
-- Name: view_location; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_location AS
    SELECT "location".identifier, "location".place, "location".city, (SELECT state.value FROM state WHERE (state.identifier = "location".state)) AS state, (SELECT country.value FROM country WHERE (country.identifier = "location".country)) AS country, "location".users, "location".last_modified_date, "location".latitude, "location".longitude, "location".private FROM "location";


ALTER TABLE public.view_location OWNER TO po_user;

--
-- Name: view_photo; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_photo AS
    SELECT photo.identifier, photo.caption, photo.users, photo.date_of_exposure, photo_dupe.date_of_creation, photo_dupe.storage_location, photo_dupe.storage_index, photo_version.small_image_path, photo_version.medium_image_path, photo_version.large_image_path, photo.folder, access_type.value AS access_rights FROM photo, photo_dupe, photo_version, access_type WHERE (((photo.identifier = photo_version.photo) AND (photo.identifier = photo_dupe.photo)) AND (photo.access_rights = access_type.identifier)) ORDER BY photo.identifier;


ALTER TABLE public.view_photo OWNER TO po_user;

--
-- Name: view_random_photo; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_random_photo AS
    SELECT photo_version.small_image_path, photo_version.medium_image_path, photo_version.large_image_path FROM photo, photo_version WHERE ((photo.identifier = photo_version.photo) AND (photo.identifier = (SELECT ((random() * (count_photos())::double precision))::integer AS int4)));


ALTER TABLE public.view_random_photo OWNER TO po_user;

--
-- Name: view_rating; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_rating AS
    SELECT rating.identifier, rating.photo, rating.users, rating.date_of_creation, rating.value, users.first_name, users.last_name, rating."comment" FROM rating, users WHERE (rating.users = users.identifier);


ALTER TABLE public.view_rating OWNER TO po_user;

--
-- Name: view_scanner; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_scanner AS
    SELECT scanner.identifier, manufacturer.name, scanner_type.model, scanner_type.variation, scanner.serial_number, scanner.users, scanner.date_of_purchase, scanner.purchased_new, manufacturer.url, access_type.value AS access_rights FROM scanner_type, scanner, manufacturer, access_type WHERE (((scanner_type.manufacturer = manufacturer.identifier) AND (scanner_type.identifier = scanner."type")) AND (scanner.access_rights = access_type.identifier)) ORDER BY manufacturer.name, scanner_type.model, scanner_type.variation;


ALTER TABLE public.view_scanner OWNER TO po_user;

--
-- Name: view_scanner_type; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_scanner_type AS
    SELECT scanner_type.identifier, manufacturer.name, scanner_type.model, scanner_type.variation, manufacturer.url FROM scanner_type, manufacturer WHERE (scanner_type.manufacturer = manufacturer.identifier) ORDER BY manufacturer.name, scanner_type.model, scanner_type.variation;


ALTER TABLE public.view_scanner_type OWNER TO po_user;

--
-- Name: view_shop_item_generator_rule; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_shop_item_generator_rule AS
    SELECT shop_item_generator_rule.identifier, shop_category.caption AS shop_category, shop_item.description AS shop_item, currency.alpha_code AS currency, shop_item_generator_rule.price, shop_item_generator_rule."comment", shop_item_generator_rule.date_of_creation, shop_item_generator_rule.date_of_last_edit, shop_item_generator_rule.users FROM shop_item_generator_rule, shop_category, shop_item, currency WHERE (((shop_item_generator_rule.shop_item = shop_item.identifier) AND (shop_item.category = shop_category.identifier)) AND (shop_item_generator_rule.currency = currency.identifier)) ORDER BY shop_item_generator_rule.date_of_creation;


ALTER TABLE public.view_shop_item_generator_rule OWNER TO po_user;

--
-- Name: view_submission; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_submission AS
    SELECT submission.identifier, submission.photo_dupe, photo_dupe.photo, photo_dupe."key", (SELECT users.identifier FROM users WHERE (users.identifier = submission.users)) AS uidentifier, (SELECT users.first_name FROM users WHERE (users.identifier = submission.users)) AS first_name, (SELECT users.last_name FROM users WHERE (users.identifier = submission.users)) AS last_name, submission_status.value, submission.date_of_creation, submission.remark FROM submission, photo_dupe, submission_status WHERE ((submission.photo_dupe = photo_dupe.identifier) AND (submission.status = submission_status.identifier)) ORDER BY submission.date_of_creation, (SELECT users.last_name FROM users WHERE (users.identifier = submission.users)), (SELECT users.first_name FROM users WHERE (users.identifier = submission.users));


ALTER TABLE public.view_submission OWNER TO po_user;

--
-- Name: view_support; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_support AS
    SELECT support.identifier, manufacturer.name, support_type.model, support_type.variation, support.serial_number, support.users, support.date_of_purchase, support.purchased_new, manufacturer.url, access_type.value AS access_rights FROM support_type, support, manufacturer, access_type WHERE (((support_type.manufacturer = manufacturer.identifier) AND (support_type.identifier = support."type")) AND (support.access_rights = access_type.identifier)) ORDER BY manufacturer.name, support_type.model, support_type.variation;


ALTER TABLE public.view_support OWNER TO po_user;

--
-- Name: view_support_type; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_support_type AS
    SELECT support_type.identifier, manufacturer.name, support_type.model, support_type.variation, manufacturer.url FROM support_type, manufacturer WHERE (support_type.manufacturer = manufacturer.identifier) ORDER BY manufacturer.name, support_type.model, support_type.variation;


ALTER TABLE public.view_support_type OWNER TO po_user;

--
-- Name: view_users_subscribed_to; Type: VIEW; Schema: public; Owner: po_user
--

CREATE VIEW view_users_subscribed_to AS
    SELECT client.identifier, client.users, client.client, users.last_name, users.first_name, client.date_of_creation, client_status.value, client.status FROM client, users, client_status WHERE ((client.users = users.identifier) AND (client.status = client_status.identifier)) ORDER BY users.last_name, users.first_name;


ALTER TABLE public.view_users_subscribed_to OWNER TO po_user;

--
-- Name: access_type_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY access_type
    ADD CONSTRAINT access_type_pkey PRIMARY KEY (identifier);


--
-- Name: album_content_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY album_content
    ADD CONSTRAINT album_content_pkey PRIMARY KEY (identifier);


--
-- Name: album_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY album
    ADD CONSTRAINT album_pkey PRIMARY KEY (identifier);


--
-- Name: aperture_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY aperture
    ADD CONSTRAINT aperture_pkey PRIMARY KEY (identifier);


--
-- Name: calendar_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY calendar
    ADD CONSTRAINT calendar_pkey PRIMARY KEY (identifier);


--
-- Name: camera_metering_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY camera_metering
    ADD CONSTRAINT camera_metering_pkey PRIMARY KEY (identifier);


--
-- Name: camera_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY camera
    ADD CONSTRAINT camera_pkey PRIMARY KEY (identifier);


--
-- Name: camera_program_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY camera_program
    ADD CONSTRAINT camera_program_pkey PRIMARY KEY (identifier);


--
-- Name: camera_type_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY camera_type
    ADD CONSTRAINT camera_type_pkey PRIMARY KEY (identifier);


--
-- Name: client_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY client
    ADD CONSTRAINT client_pkey PRIMARY KEY (identifier);


--
-- Name: client_status_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY client_status
    ADD CONSTRAINT client_status_pkey PRIMARY KEY (identifier);


--
-- Name: contact_info_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY contact_info
    ADD CONSTRAINT contact_info_pkey PRIMARY KEY (identifier);


--
-- Name: country_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY country
    ADD CONSTRAINT country_pkey PRIMARY KEY (identifier);


--
-- Name: currency_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY currency
    ADD CONSTRAINT currency_pkey PRIMARY KEY (identifier);


--
-- Name: dcraw_options_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY dcraw_options
    ADD CONSTRAINT dcraw_options_pkey PRIMARY KEY (identifier);


--
-- Name: ev_comp_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY ev_comp
    ADD CONSTRAINT ev_comp_pkey PRIMARY KEY (identifier);


--
-- Name: film_format_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY film_format
    ADD CONSTRAINT film_format_pkey PRIMARY KEY (identifier);


--
-- Name: film_iso_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY film_iso
    ADD CONSTRAINT film_iso_pkey PRIMARY KEY (identifier);


--
-- Name: film_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY film
    ADD CONSTRAINT film_pkey PRIMARY KEY (identifier);


--
-- Name: film_type_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY film_type
    ADD CONSTRAINT film_type_pkey PRIMARY KEY (identifier);


--
-- Name: filter_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY filter
    ADD CONSTRAINT filter_pkey PRIMARY KEY (identifier);


--
-- Name: filter_type_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY filter_type
    ADD CONSTRAINT filter_type_pkey PRIMARY KEY (identifier);


--
-- Name: flash_mode_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY flash_mode
    ADD CONSTRAINT flash_mode_pkey PRIMARY KEY (identifier);


--
-- Name: flash_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY flash
    ADD CONSTRAINT flash_pkey PRIMARY KEY (identifier);


--
-- Name: flash_type_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY flash_type
    ADD CONSTRAINT flash_type_pkey PRIMARY KEY (identifier);


--
-- Name: focal_length_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY focal_length
    ADD CONSTRAINT focal_length_pkey PRIMARY KEY (identifier);


--
-- Name: folder_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY folder
    ADD CONSTRAINT folder_pkey PRIMARY KEY (identifier);


--
-- Name: imagemagick_composite_options_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY imagemagick_composite_options
    ADD CONSTRAINT imagemagick_composite_options_pkey PRIMARY KEY (identifier);


--
-- Name: imagemagick_options_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY imagemagick_options
    ADD CONSTRAINT imagemagick_options_pkey PRIMARY KEY (identifier);


--
-- Name: label_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY label
    ADD CONSTRAINT label_pkey PRIMARY KEY (identifier);


--
-- Name: lens_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY lens
    ADD CONSTRAINT lens_pkey PRIMARY KEY (identifier);


--
-- Name: lens_type_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY lens_type
    ADD CONSTRAINT lens_type_pkey PRIMARY KEY (identifier);


--
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY "location"
    ADD CONSTRAINT location_pkey PRIMARY KEY (identifier);


--
-- Name: manufacturer_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY manufacturer
    ADD CONSTRAINT manufacturer_pkey PRIMARY KEY (identifier);


--
-- Name: orientations_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY orientations
    ADD CONSTRAINT orientations_pkey PRIMARY KEY (identifier);


--
-- Name: paper_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY paper
    ADD CONSTRAINT paper_pkey PRIMARY KEY (identifier);


--
-- Name: photo_dupe_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY photo_dupe
    ADD CONSTRAINT photo_dupe_pkey PRIMARY KEY (identifier);


--
-- Name: photo_format_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY shop_item
    ADD CONSTRAINT photo_format_pkey PRIMARY KEY (identifier);


--
-- Name: photo_item_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY photo_item
    ADD CONSTRAINT photo_item_pkey PRIMARY KEY (identifier);


--
-- Name: photo_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY photo
    ADD CONSTRAINT photo_pkey PRIMARY KEY (identifier);


--
-- Name: photo_tech_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_pkey PRIMARY KEY (identifier);


--
-- Name: photo_version_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY photo_version
    ADD CONSTRAINT photo_version_pkey PRIMARY KEY (identifier);


--
-- Name: preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY preferences
    ADD CONSTRAINT preferences_pkey PRIMARY KEY (identifier);


--
-- Name: printer_spooler_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY photo_spooler
    ADD CONSTRAINT printer_spooler_pkey PRIMARY KEY (identifier);


--
-- Name: rating_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY rating
    ADD CONSTRAINT rating_pkey PRIMARY KEY (identifier);


--
-- Name: scan_bitdepth_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY scan_bitdepth
    ADD CONSTRAINT scan_bitdepth_pkey PRIMARY KEY (identifier);


--
-- Name: scan_multiscan_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY scan_multiscan
    ADD CONSTRAINT scan_multiscan_pkey PRIMARY KEY (identifier);


--
-- Name: scan_resolution_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY scan_resolution
    ADD CONSTRAINT scan_resolution_pkey PRIMARY KEY (identifier);


--
-- Name: scanner_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY scanner
    ADD CONSTRAINT scanner_pkey PRIMARY KEY (identifier);


--
-- Name: scanner_type_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY scanner_type
    ADD CONSTRAINT scanner_type_pkey PRIMARY KEY (identifier);


--
-- Name: shop_category_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY shop_category
    ADD CONSTRAINT shop_category_pkey PRIMARY KEY (identifier);


--
-- Name: shop_item_generator_rule_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY shop_item_generator_rule
    ADD CONSTRAINT shop_item_generator_rule_pkey PRIMARY KEY (identifier);


--
-- Name: shop_order_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY shop_order
    ADD CONSTRAINT shop_order_pkey PRIMARY KEY (identifier);


--
-- Name: shop_transaction_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY shop_transaction
    ADD CONSTRAINT shop_transaction_pkey PRIMARY KEY (identifier);


--
-- Name: shop_transaction_status_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY shop_transaction_status
    ADD CONSTRAINT shop_transaction_status_pkey PRIMARY KEY (identifier);


--
-- Name: shutter_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY shutter
    ADD CONSTRAINT shutter_pkey PRIMARY KEY (identifier);


--
-- Name: state_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY state
    ADD CONSTRAINT state_pkey PRIMARY KEY (identifier);


--
-- Name: submission_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY submission
    ADD CONSTRAINT submission_pkey PRIMARY KEY (identifier);


--
-- Name: submission_status_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY submission_status
    ADD CONSTRAINT submission_status_pkey PRIMARY KEY (identifier);


--
-- Name: support_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY support
    ADD CONSTRAINT support_pkey PRIMARY KEY (identifier);


--
-- Name: support_type_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY support_type
    ADD CONSTRAINT support_type_pkey PRIMARY KEY (identifier);


--
-- Name: system_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY system_preferences
    ADD CONSTRAINT system_preferences_pkey PRIMARY KEY (identifier);


--
-- Name: user_type_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY user_type
    ADD CONSTRAINT user_type_pkey PRIMARY KEY (identifier);


--
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY users
    ADD CONSTRAINT users_pkey PRIMARY KEY (identifier);


--
-- Name: version_pkey; Type: CONSTRAINT; Schema: public; Owner: po_user; Tablespace: 
--

ALTER TABLE ONLY version
    ADD CONSTRAINT version_pkey PRIMARY KEY (identifier);


--
-- Name: album_content_album_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX album_content_album_idx ON album_content USING btree (album);


--
-- Name: album_content_id_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX album_content_id_idx ON album_content USING btree (identifier);


--
-- Name: album_content_photo_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX album_content_photo_idx ON album_content USING btree (photo);


--
-- Name: album_id_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX album_id_idx ON album USING btree (identifier);


--
-- Name: album_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX album_users_idx ON album USING btree (users);


--
-- Name: calendar_id_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX calendar_id_idx ON calendar USING btree (identifier);


--
-- Name: camera_type_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX camera_type_idx ON camera USING btree ("type");


--
-- Name: camera_type_manufacturer_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX camera_type_manufacturer_idx ON camera_type USING btree (manufacturer);


--
-- Name: camera_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX camera_users_idx ON camera USING btree (users);


--
-- Name: client_client_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX client_client_idx ON client USING btree (client);


--
-- Name: client_id_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX client_id_idx ON client USING btree (identifier);


--
-- Name: client_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX client_users_idx ON client USING btree (users);


--
-- Name: contact_info_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX contact_info_idx ON contact_info USING btree (identifier);


--
-- Name: film_type_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX film_type_idx ON film USING btree ("type");


--
-- Name: film_type_manufacturer_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX film_type_manufacturer_idx ON film_type USING btree (manufacturer);


--
-- Name: film_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX film_users_idx ON film USING btree (users);


--
-- Name: filter_type_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX filter_type_idx ON filter USING btree ("type");


--
-- Name: filter_type_manufacturer_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX filter_type_manufacturer_idx ON filter_type USING btree (manufacturer);


--
-- Name: filter_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX filter_users_idx ON filter USING btree (users);


--
-- Name: flash_type_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX flash_type_idx ON flash USING btree ("type");


--
-- Name: flash_type_manufacturer_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX flash_type_manufacturer_idx ON flash_type USING btree (manufacturer);


--
-- Name: flash_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX flash_users_idx ON flash USING btree (users);


--
-- Name: folder_id_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX folder_id_idx ON folder USING btree (identifier);


--
-- Name: folder_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX folder_users_idx ON folder USING btree (users);


--
-- Name: label_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX label_idx ON label USING btree (identifier);


--
-- Name: lens_type_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX lens_type_idx ON lens USING btree ("type");


--
-- Name: lens_type_manufacturer_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX lens_type_manufacturer_idx ON lens_type USING btree (manufacturer);


--
-- Name: lens_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX lens_users_idx ON lens USING btree (users);


--
-- Name: paper_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX paper_idx ON paper USING btree (identifier);


--
-- Name: photo_id_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX photo_id_idx ON photo USING btree (identifier);


--
-- Name: photo_keywords_photo; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX photo_keywords_photo ON photo_keywords USING btree (photo);


--
-- Name: photo_location_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX photo_location_idx ON photo USING btree ("location");


--
-- Name: photo_tech_id_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX photo_tech_id_idx ON photo_tech USING btree (identifier);


--
-- Name: photo_tech_photo_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX photo_tech_photo_idx ON photo_tech USING btree (photo);


--
-- Name: photo_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX photo_users_idx ON photo USING btree (users);


--
-- Name: photo_version_photo_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX photo_version_photo_idx ON photo_version USING btree (photo);


--
-- Name: rating_id_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX rating_id_idx ON rating USING btree (identifier);


--
-- Name: rating_photo_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX rating_photo_idx ON rating USING btree (photo);


--
-- Name: rating_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX rating_users_idx ON rating USING btree (users);


--
-- Name: scanner_type_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX scanner_type_idx ON scanner USING btree ("type");


--
-- Name: scanner_type_manufacturer_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX scanner_type_manufacturer_idx ON scanner_type USING btree (manufacturer);


--
-- Name: scanner_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX scanner_users_idx ON scanner USING btree (users);


--
-- Name: support_type_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX support_type_idx ON support USING btree ("type");


--
-- Name: support_type_manufacturer_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX support_type_manufacturer_idx ON support_type USING btree (manufacturer);


--
-- Name: support_users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX support_users_idx ON support USING btree (users);


--
-- Name: users_idx; Type: INDEX; Schema: public; Owner: po_user; Tablespace: 
--

CREATE INDEX users_idx ON users USING btree (identifier);


--
-- Name: album_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY album
    ADD CONSTRAINT album_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: album_content_album_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY album_content
    ADD CONSTRAINT album_content_album_fkey FOREIGN KEY (album) REFERENCES album(identifier);


--
-- Name: album_content_photo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY album_content
    ADD CONSTRAINT album_content_photo_fkey FOREIGN KEY (photo) REFERENCES photo(identifier);


--
-- Name: album_parent_album_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY album
    ADD CONSTRAINT album_parent_album_fkey FOREIGN KEY (parent_album) REFERENCES album(identifier);


--
-- Name: album_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY album
    ADD CONSTRAINT album_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: calendar_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY calendar
    ADD CONSTRAINT calendar_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: camera_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY camera
    ADD CONSTRAINT camera_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: camera_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY camera
    ADD CONSTRAINT camera_type_fkey FOREIGN KEY ("type") REFERENCES camera_type(identifier);


--
-- Name: camera_type_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY camera_type
    ADD CONSTRAINT camera_type_last_modifying_users_fkey FOREIGN KEY (last_modifying_users) REFERENCES users(identifier);


--
-- Name: camera_type_manufacturer_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY camera_type
    ADD CONSTRAINT camera_type_manufacturer_fkey FOREIGN KEY (manufacturer) REFERENCES manufacturer(identifier);


--
-- Name: camera_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY camera
    ADD CONSTRAINT camera_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: client_client_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY client
    ADD CONSTRAINT client_client_fkey FOREIGN KEY (client) REFERENCES users(identifier);


--
-- Name: client_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY client
    ADD CONSTRAINT client_status_fkey FOREIGN KEY (status) REFERENCES client_status(identifier);


--
-- Name: client_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY client
    ADD CONSTRAINT client_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: contact_info_country_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY contact_info
    ADD CONSTRAINT contact_info_country_fkey FOREIGN KEY (country) REFERENCES country(identifier);


--
-- Name: contact_info_state_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY contact_info
    ADD CONSTRAINT contact_info_state_fkey FOREIGN KEY (state) REFERENCES state(identifier);


--
-- Name: film_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY film
    ADD CONSTRAINT film_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: film_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY film
    ADD CONSTRAINT film_type_fkey FOREIGN KEY ("type") REFERENCES film_type(identifier);


--
-- Name: film_type_format_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY film_type
    ADD CONSTRAINT film_type_format_fkey FOREIGN KEY (format) REFERENCES film_format(identifier);


--
-- Name: film_type_iso_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY film_type
    ADD CONSTRAINT film_type_iso_fkey FOREIGN KEY (iso) REFERENCES film_iso(identifier);


--
-- Name: film_type_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY film_type
    ADD CONSTRAINT film_type_last_modifying_users_fkey FOREIGN KEY (last_modifying_users) REFERENCES users(identifier);


--
-- Name: film_type_manufacturer_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY film_type
    ADD CONSTRAINT film_type_manufacturer_fkey FOREIGN KEY (manufacturer) REFERENCES manufacturer(identifier);


--
-- Name: film_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY film
    ADD CONSTRAINT film_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: filter_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY filter
    ADD CONSTRAINT filter_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: filter_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY filter
    ADD CONSTRAINT filter_type_fkey FOREIGN KEY ("type") REFERENCES filter_type(identifier);


--
-- Name: filter_type_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY filter_type
    ADD CONSTRAINT filter_type_last_modifying_users_fkey FOREIGN KEY (last_modifying_users) REFERENCES users(identifier);


--
-- Name: filter_type_manufacturer_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY filter_type
    ADD CONSTRAINT filter_type_manufacturer_fkey FOREIGN KEY (manufacturer) REFERENCES manufacturer(identifier);


--
-- Name: filter_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY filter
    ADD CONSTRAINT filter_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: flash_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY flash
    ADD CONSTRAINT flash_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: flash_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY flash
    ADD CONSTRAINT flash_type_fkey FOREIGN KEY ("type") REFERENCES flash_type(identifier);


--
-- Name: flash_type_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY flash_type
    ADD CONSTRAINT flash_type_last_modifying_users_fkey FOREIGN KEY (last_modifying_users) REFERENCES users(identifier);


--
-- Name: flash_type_manufacturer_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY flash_type
    ADD CONSTRAINT flash_type_manufacturer_fkey FOREIGN KEY (manufacturer) REFERENCES manufacturer(identifier);


--
-- Name: flash_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY flash
    ADD CONSTRAINT flash_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: folder_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY folder
    ADD CONSTRAINT folder_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: folder_parent_folder_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY folder
    ADD CONSTRAINT folder_parent_folder_fkey FOREIGN KEY (parent_folder) REFERENCES folder(identifier);


--
-- Name: folder_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY folder
    ADD CONSTRAINT folder_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: imagemagick_composite_options_photo_version_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY imagemagick_composite_options
    ADD CONSTRAINT imagemagick_composite_options_photo_version_fkey FOREIGN KEY (photo_version) REFERENCES photo_version(identifier);


--
-- Name: label_manufacturer_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY label
    ADD CONSTRAINT label_manufacturer_fkey FOREIGN KEY (manufacturer) REFERENCES manufacturer(identifier);


--
-- Name: label_paper_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY label
    ADD CONSTRAINT label_paper_fkey FOREIGN KEY (paper) REFERENCES paper(identifier);


--
-- Name: label_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY label
    ADD CONSTRAINT label_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: lens_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY lens
    ADD CONSTRAINT lens_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: lens_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY lens
    ADD CONSTRAINT lens_type_fkey FOREIGN KEY ("type") REFERENCES lens_type(identifier);


--
-- Name: lens_type_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY lens_type
    ADD CONSTRAINT lens_type_last_modifying_users_fkey FOREIGN KEY (last_modifying_users) REFERENCES users(identifier);


--
-- Name: lens_type_manufacturer_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY lens_type
    ADD CONSTRAINT lens_type_manufacturer_fkey FOREIGN KEY (manufacturer) REFERENCES manufacturer(identifier);


--
-- Name: lens_type_max_aperture_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY lens_type
    ADD CONSTRAINT lens_type_max_aperture_fkey FOREIGN KEY (max_aperture) REFERENCES aperture(identifier);


--
-- Name: lens_type_max_focal_length_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY lens_type
    ADD CONSTRAINT lens_type_max_focal_length_fkey FOREIGN KEY (max_focal_length) REFERENCES focal_length(identifier);


--
-- Name: lens_type_min_aperture_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY lens_type
    ADD CONSTRAINT lens_type_min_aperture_fkey FOREIGN KEY (min_aperture) REFERENCES aperture(identifier);


--
-- Name: lens_type_min_focal_length_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY lens_type
    ADD CONSTRAINT lens_type_min_focal_length_fkey FOREIGN KEY (min_focal_length) REFERENCES focal_length(identifier);


--
-- Name: lens_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY lens
    ADD CONSTRAINT lens_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: location_country_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY "location"
    ADD CONSTRAINT location_country_fkey FOREIGN KEY (country) REFERENCES country(identifier);


--
-- Name: location_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY "location"
    ADD CONSTRAINT location_last_modifying_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: location_state_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY "location"
    ADD CONSTRAINT location_state_fkey FOREIGN KEY (state) REFERENCES state(identifier);


--
-- Name: manufacturer_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY manufacturer
    ADD CONSTRAINT manufacturer_last_modifying_users_fkey FOREIGN KEY (last_modifying_users) REFERENCES users(identifier);


--
-- Name: paper_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY paper
    ADD CONSTRAINT paper_last_modifying_users_fkey FOREIGN KEY (last_modifying_users) REFERENCES users(identifier);


--
-- Name: photo_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo
    ADD CONSTRAINT photo_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: photo_dupe_photo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_dupe
    ADD CONSTRAINT photo_dupe_photo_fkey FOREIGN KEY (photo) REFERENCES photo(identifier);


--
-- Name: photo_folder_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo
    ADD CONSTRAINT photo_folder_fkey FOREIGN KEY (folder) REFERENCES folder(identifier);


--
-- Name: photo_format_category_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_item
    ADD CONSTRAINT photo_format_category_fkey FOREIGN KEY (category) REFERENCES shop_category(identifier);


--
-- Name: photo_format_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_item
    ADD CONSTRAINT photo_format_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: photo_item_currency_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_item
    ADD CONSTRAINT photo_item_currency_fkey FOREIGN KEY (currency) REFERENCES currency(identifier);


--
-- Name: photo_item_format_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_item
    ADD CONSTRAINT photo_item_format_fkey FOREIGN KEY (shop_item) REFERENCES shop_item(identifier);


--
-- Name: photo_item_photo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_item
    ADD CONSTRAINT photo_item_photo_fkey FOREIGN KEY (photo) REFERENCES photo(identifier);


--
-- Name: photo_keywords_photo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_keywords
    ADD CONSTRAINT photo_keywords_photo_fkey FOREIGN KEY (photo) REFERENCES photo(identifier);


--
-- Name: photo_location_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo
    ADD CONSTRAINT photo_location_fkey FOREIGN KEY ("location") REFERENCES "location"(identifier);


--
-- Name: photo_tech_aperture_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_aperture_fkey FOREIGN KEY (aperture) REFERENCES aperture(identifier);


--
-- Name: photo_tech_camera_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_camera_fkey FOREIGN KEY (camera) REFERENCES camera(identifier);


--
-- Name: photo_tech_camera_metering_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_camera_metering_fkey FOREIGN KEY (camera_metering) REFERENCES camera_metering(identifier);


--
-- Name: photo_tech_camera_program_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_camera_program_fkey FOREIGN KEY (camera_program) REFERENCES camera_program(identifier);


--
-- Name: photo_tech_ev_difference_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_ev_difference_fkey FOREIGN KEY (ev_difference) REFERENCES ev_comp(identifier);


--
-- Name: photo_tech_exposure_comp_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_exposure_comp_fkey FOREIGN KEY (exposure_comp) REFERENCES ev_comp(identifier);


--
-- Name: photo_tech_film_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_film_fkey FOREIGN KEY (film) REFERENCES film(identifier);


--
-- Name: photo_tech_filter_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_filter_fkey FOREIGN KEY (filter) REFERENCES filter(identifier);


--
-- Name: photo_tech_flash_comp_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_flash_comp_fkey FOREIGN KEY (flash_comp) REFERENCES ev_comp(identifier);


--
-- Name: photo_tech_flash_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_flash_fkey FOREIGN KEY (flash) REFERENCES flash(identifier);


--
-- Name: photo_tech_flash_mode_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_flash_mode_fkey FOREIGN KEY (flash_mode) REFERENCES flash_mode(identifier);


--
-- Name: photo_tech_focal_length_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_focal_length_fkey FOREIGN KEY (focal_length) REFERENCES focal_length(identifier);


--
-- Name: photo_tech_iso_override_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_iso_override_fkey FOREIGN KEY (iso_override) REFERENCES film_iso(identifier);


--
-- Name: photo_tech_lens_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_lens_fkey FOREIGN KEY (lens) REFERENCES lens(identifier);


--
-- Name: photo_tech_photo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_photo_fkey FOREIGN KEY (photo) REFERENCES photo(identifier);


--
-- Name: photo_tech_scan_bitdepth_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_scan_bitdepth_fkey FOREIGN KEY (scan_bitdepth) REFERENCES scan_bitdepth(identifier);


--
-- Name: photo_tech_scan_multiscan_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_scan_multiscan_fkey FOREIGN KEY (scan_multiscan) REFERENCES scan_multiscan(identifier);


--
-- Name: photo_tech_scan_resolution_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_scan_resolution_fkey FOREIGN KEY (scan_resolution) REFERENCES scan_resolution(identifier);


--
-- Name: photo_tech_scanner_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_scanner_fkey FOREIGN KEY (scanner) REFERENCES scanner(identifier);


--
-- Name: photo_tech_shutter_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_shutter_fkey FOREIGN KEY (shutter) REFERENCES shutter(identifier);


--
-- Name: photo_tech_support_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_tech
    ADD CONSTRAINT photo_tech_support_fkey FOREIGN KEY (support) REFERENCES support(identifier);


--
-- Name: photo_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo
    ADD CONSTRAINT photo_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: photo_version_orientation_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_version
    ADD CONSTRAINT photo_version_orientation_fkey FOREIGN KEY (orientation) REFERENCES orientations(identifier);


--
-- Name: photo_version_photo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_version
    ADD CONSTRAINT photo_version_photo_fkey FOREIGN KEY (photo) REFERENCES photo(identifier);


--
-- Name: preferences_label_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY preferences
    ADD CONSTRAINT preferences_label_fkey FOREIGN KEY (label) REFERENCES label(identifier);


--
-- Name: preferences_paper_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY preferences
    ADD CONSTRAINT preferences_paper_fkey FOREIGN KEY (paper) REFERENCES paper(identifier);


--
-- Name: printer_spooler_photo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_spooler
    ADD CONSTRAINT printer_spooler_photo_fkey FOREIGN KEY (photo) REFERENCES photo(identifier);


--
-- Name: printer_spooler_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY photo_spooler
    ADD CONSTRAINT printer_spooler_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: rating_photo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY rating
    ADD CONSTRAINT rating_photo_fkey FOREIGN KEY (photo) REFERENCES photo(identifier);


--
-- Name: rating_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY rating
    ADD CONSTRAINT rating_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: scanner_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY scanner
    ADD CONSTRAINT scanner_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: scanner_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY scanner
    ADD CONSTRAINT scanner_type_fkey FOREIGN KEY ("type") REFERENCES scanner_type(identifier);


--
-- Name: scanner_type_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY scanner_type
    ADD CONSTRAINT scanner_type_last_modifying_users_fkey FOREIGN KEY (last_modifying_users) REFERENCES users(identifier);


--
-- Name: scanner_type_manufacturer_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY scanner_type
    ADD CONSTRAINT scanner_type_manufacturer_fkey FOREIGN KEY (manufacturer) REFERENCES manufacturer(identifier);


--
-- Name: scanner_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY scanner
    ADD CONSTRAINT scanner_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: shop_category_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_category
    ADD CONSTRAINT shop_category_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: shop_item_generator_rule_currency_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_item_generator_rule
    ADD CONSTRAINT shop_item_generator_rule_currency_fkey FOREIGN KEY (currency) REFERENCES currency(identifier);


--
-- Name: shop_item_generator_rule_shop_item_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_item_generator_rule
    ADD CONSTRAINT shop_item_generator_rule_shop_item_fkey FOREIGN KEY (shop_item) REFERENCES shop_item(identifier);


--
-- Name: shop_item_generator_rule_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_item_generator_rule
    ADD CONSTRAINT shop_item_generator_rule_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: shop_order_client_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_order
    ADD CONSTRAINT shop_order_client_fkey FOREIGN KEY (client) REFERENCES users(identifier);


--
-- Name: shop_order_item_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_order
    ADD CONSTRAINT shop_order_item_fkey FOREIGN KEY (item) REFERENCES photo_item(identifier);


--
-- Name: shop_order_transaction_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_order
    ADD CONSTRAINT shop_order_transaction_fkey FOREIGN KEY ("transaction") REFERENCES shop_transaction(identifier);


--
-- Name: shop_transaction_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY shop_transaction
    ADD CONSTRAINT shop_transaction_status_fkey FOREIGN KEY (status) REFERENCES shop_transaction_status(identifier);


--
-- Name: submission_photo_dupe_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY submission
    ADD CONSTRAINT submission_photo_dupe_fkey FOREIGN KEY (photo_dupe) REFERENCES photo_dupe(identifier);


--
-- Name: submission_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY submission
    ADD CONSTRAINT submission_status_fkey FOREIGN KEY (status) REFERENCES submission_status(identifier);


--
-- Name: submission_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY submission
    ADD CONSTRAINT submission_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: support_access_rights_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY support
    ADD CONSTRAINT support_access_rights_fkey FOREIGN KEY (access_rights) REFERENCES access_type(identifier);


--
-- Name: support_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY support
    ADD CONSTRAINT support_type_fkey FOREIGN KEY ("type") REFERENCES support_type(identifier);


--
-- Name: support_type_last_modifying_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY support_type
    ADD CONSTRAINT support_type_last_modifying_users_fkey FOREIGN KEY (last_modifying_users) REFERENCES users(identifier);


--
-- Name: support_type_manufacturer_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY support_type
    ADD CONSTRAINT support_type_manufacturer_fkey FOREIGN KEY (manufacturer) REFERENCES manufacturer(identifier);


--
-- Name: support_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY support
    ADD CONSTRAINT support_users_fkey FOREIGN KEY (users) REFERENCES users(identifier);


--
-- Name: system_preferences_new_user_label_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY system_preferences
    ADD CONSTRAINT system_preferences_new_user_label_fkey FOREIGN KEY (new_user_label) REFERENCES label(identifier);


--
-- Name: system_preferences_new_user_paper_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY system_preferences
    ADD CONSTRAINT system_preferences_new_user_paper_fkey FOREIGN KEY (new_user_paper) REFERENCES paper(identifier);


--
-- Name: system_preferences_new_user_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY system_preferences
    ADD CONSTRAINT system_preferences_new_user_type_fkey FOREIGN KEY (new_user_type) REFERENCES user_type(identifier);


--
-- Name: users_contact_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY users
    ADD CONSTRAINT users_contact_fkey FOREIGN KEY (contact) REFERENCES contact_info(identifier);


--
-- Name: users_dcraw_options_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY users
    ADD CONSTRAINT users_dcraw_options_fkey FOREIGN KEY (dcraw_options) REFERENCES dcraw_options(identifier);


--
-- Name: users_imagemagick_composite_options_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY users
    ADD CONSTRAINT users_imagemagick_composite_options_fkey FOREIGN KEY (imagemagick_composite_options) REFERENCES imagemagick_composite_options(identifier);


--
-- Name: users_imagemagick_options_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY users
    ADD CONSTRAINT users_imagemagick_options_fkey FOREIGN KEY (imagemagick_options) REFERENCES imagemagick_options(identifier);


--
-- Name: users_preferences_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY users
    ADD CONSTRAINT users_preferences_fkey FOREIGN KEY (preferences) REFERENCES preferences(identifier);


--
-- Name: users_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: po_user
--

ALTER TABLE ONLY users
    ADD CONSTRAINT users_type_fkey FOREIGN KEY ("type") REFERENCES user_type(identifier);


--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
-- PostgreSQL database dump complete
--

podoc/schema-2.33c.1176498640.txt.gz · Last modified: 2007/04/13 21:10 by Luud