+-- Name: packages; Type: VIEW; Schema: sparc; Owner: wbadm
+--
+
+CREATE VIEW packages AS
+ SELECT packages.package, packages.distribution, packages.version, packages.state, packages.section, packages.priority, packages.installed_version, packages.previous_state, packages.state_change, packages.notes, packages.builder, packages.failed, packages.old_failed, packages.binary_nmu_version, packages.binary_nmu_changelog, packages.failed_category, packages.permbuildpri, packages.buildpri, packages.depends, packages.rel, packages.bd_problem, packages.extra_depends, packages.extra_conflicts, packages.build_arch_all FROM public.packages packages WHERE ((packages.architecture)::text = 'sparc'::text);
+
+
+ALTER TABLE sparc.packages OWNER TO wbadm;
+
+--
+-- Name: pkg_history; Type: VIEW; Schema: sparc; Owner: wbadm
+--
+
+CREATE VIEW pkg_history AS
+ SELECT pkg_history.package, pkg_history.distribution, pkg_history.version, pkg_history."timestamp", pkg_history.result, pkg_history.build_time, pkg_history.disk_space, pkg_history.builder FROM public.pkg_history WHERE ((pkg_history.architecture)::text = 'sparc'::text);
+
+
+ALTER TABLE sparc.pkg_history OWNER TO wbadm;
+
+--
+-- Name: transactions; Type: VIEW; Schema: sparc; Owner: wbadm
+--
+
+CREATE VIEW transactions AS
+ SELECT transactions.package, transactions.distribution, transactions.version, transactions.action, transactions.prevstate, transactions.state, transactions.real_user, transactions.set_user, transactions."time" FROM public.transactions WHERE ((transactions.architecture)::text = 'sparc'::text);
+
+
+ALTER TABLE sparc.transactions OWNER TO wbadm;
+
+--
+-- Name: users; Type: VIEW; Schema: sparc; Owner: wbadm
+--
+
+CREATE VIEW users AS
+ SELECT users.username, users.distribution, users.last_seen FROM public.users WHERE ((users.architecture)::text = 'sparc'::text);
+
+
+ALTER TABLE sparc.users OWNER TO wbadm;
+
+SET search_path = sparc_public, pg_catalog;
+
+--
+-- Name: packages; Type: VIEW; Schema: sparc_public; Owner: wbadm
+--
+
+CREATE VIEW packages AS
+ SELECT packages.package, packages.distribution, packages.version, packages.state, packages.section, packages.priority, packages.installed_version, packages.previous_state, packages.state_change, packages.notes, packages.builder, packages.failed, packages.old_failed, packages.binary_nmu_version, packages.binary_nmu_changelog, packages.failed_category, packages.permbuildpri, packages.buildpri, packages.depends, packages.rel, packages.bd_problem, packages.extra_depends, packages.extra_conflicts, packages.build_arch_all FROM (public.packages NATURAL JOIN public.distributions) WHERE ((distributions.public = true) AND ((packages.architecture)::text = 'sparc'::text));
+
+
+ALTER TABLE sparc_public.packages OWNER TO wbadm;
+
+--
+-- Name: pkg_history; Type: VIEW; Schema: sparc_public; Owner: wbadm
+--
+
+CREATE VIEW pkg_history AS
+ SELECT pkg_history.package, pkg_history.distribution, pkg_history.version, pkg_history."timestamp", pkg_history.result, pkg_history.build_time, pkg_history.disk_space, pkg_history.builder FROM (public.pkg_history NATURAL JOIN public.distributions) WHERE ((distributions.public = true) AND ((pkg_history.architecture)::text = 'sparc'::text));
+
+
+ALTER TABLE sparc_public.pkg_history OWNER TO wbadm;
+
+--
+-- Name: transactions; Type: VIEW; Schema: sparc_public; Owner: wbadm
+--
+
+CREATE VIEW transactions AS
+ SELECT transactions.package, transactions.distribution, transactions.version, transactions.action, transactions.prevstate, transactions.state, transactions.real_user, transactions.set_user, transactions."time" FROM (public.transactions NATURAL JOIN public.distributions) WHERE ((distributions.public = true) AND ((transactions.architecture)::text = 'sparc'::text));
+
+
+ALTER TABLE sparc_public.transactions OWNER TO wbadm;
+
+--
+-- Name: users; Type: VIEW; Schema: sparc_public; Owner: wbadm
+--
+
+CREATE VIEW users AS
+ SELECT users.username, users.distribution, users.last_seen FROM (public.users NATURAL JOIN public.distributions) WHERE ((distributions.public = true) AND ((users.architecture)::text = 'sparc'::text));
+
+
+ALTER TABLE sparc_public.users OWNER TO wbadm;
+
+SET search_path = public, pg_catalog;
+
+--
+-- Name: architectures_pkey; Type: CONSTRAINT; Schema: public; Owner: wbadm; Tablespace:
+--
+
+ALTER TABLE ONLY architectures
+ ADD CONSTRAINT architectures_pkey PRIMARY KEY (architecture);
+
+
+--
+-- Name: distribution_aliases_pkey; Type: CONSTRAINT; Schema: public; Owner: wbadm; Tablespace:
+--
+
+ALTER TABLE ONLY distribution_aliases
+ ADD CONSTRAINT distribution_aliases_pkey PRIMARY KEY (alias);
+
+
+--
+-- Name: distribution_architectures_pkey; Type: CONSTRAINT; Schema: public; Owner: wbadm; Tablespace:
+--
+
+ALTER TABLE ONLY distribution_architectures
+ ADD CONSTRAINT distribution_architectures_pkey PRIMARY KEY (distribution, architecture);
+
+
+--
+-- Name: packages_pkey; Type: CONSTRAINT; Schema: public; Owner: wbadm; Tablespace:
+--
+
+ALTER TABLE ONLY packages
+ ADD CONSTRAINT packages_pkey PRIMARY KEY (architecture, package, distribution);
+
+
+--
+-- Name: pkg_history_pkey; Type: CONSTRAINT; Schema: public; Owner: wbadm; Tablespace:
+--
+
+ALTER TABLE ONLY pkg_history
+ ADD CONSTRAINT pkg_history_pkey PRIMARY KEY (architecture, package, distribution, version, "timestamp");
+
+
+--
+-- Name: priorities_pkey; Type: CONSTRAINT; Schema: public; Owner: wbadm; Tablespace:
+--
+
+ALTER TABLE ONLY priorities
+ ADD CONSTRAINT priorities_pkey PRIMARY KEY (type, value);
+
+
+--
+-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: wbadm; Tablespace:
+--
+
+ALTER TABLE ONLY users
+ ADD CONSTRAINT users_pkey PRIMARY KEY (architecture, username, distribution);
+
+
+--
+-- Name: distribution_unique; Type: INDEX; Schema: public; Owner: wbadm; Tablespace:
+--
+
+CREATE UNIQUE INDEX distribution_unique ON distributions USING btree (distribution);
+
+
+--
+-- Name: distributions_distribution; Type: INDEX; Schema: public; Owner: wbadm; Tablespace:
+--
+
+CREATE INDEX distributions_distribution ON distributions USING hash (distribution);
+
+
+--
+-- Name: packages_arch_dist_state; Type: INDEX; Schema: public; Owner: wbadm; Tablespace:
+--
+
+CREATE INDEX packages_arch_dist_state ON packages USING btree (architecture, distribution, upper((state)::text));
+
+
+--
+-- Name: packages_dist_pkg; Type: INDEX; Schema: public; Owner: wbadm; Tablespace:
+--
+
+CREATE INDEX packages_dist_pkg ON packages USING btree (distribution, package);
+
+
+--
+-- Name: pkg_history_timestamp; Type: INDEX; Schema: public; Owner: wbadm; Tablespace:
+--
+
+CREATE INDEX pkg_history_timestamp ON pkg_history USING btree ("timestamp");
+
+
+SET search_path = alpha, pg_catalog;
+
+--
+-- Name: packages_delete; Type: RULE; Schema: alpha; Owner: wbadm
+--
+
+CREATE RULE packages_delete AS ON DELETE TO packages DO INSTEAD DELETE FROM public.packages p WHERE ((((p.architecture)::text = 'alpha'::text) AND ((p.package)::text = (old.package)::text)) AND ((p.distribution)::text = (old.distribution)::text));
+
+
+--
+-- Name: packages_insert; Type: RULE; Schema: alpha; Owner: wbadm
+--
+
+CREATE RULE packages_insert AS ON INSERT TO packages DO INSTEAD INSERT INTO public.packages (architecture, package, distribution, version, state, section, priority, installed_version, previous_state, state_change, notes, builder, failed, old_failed, binary_nmu_version, binary_nmu_changelog, failed_category, permbuildpri, buildpri, depends, rel, bd_problem, extra_depends, extra_conflicts, build_arch_all) VALUES ('alpha'::character varying, new.package, new.distribution, new.version, new.state, new.section, new.priority, new.installed_version, new.previous_state, new.state_change, new.notes, new.builder, new.failed, new.old_failed, new.binary_nmu_version, new.binary_nmu_changelog, new.failed_category, new.permbuildpri, new.buildpri, new.depends, new.rel, new.bd_problem, new.extra_depends, new.extra_conflicts, new.build_arch_all);
+
+
+--
+-- Name: packages_update; Type: RULE; Schema: alpha; Owner: wbadm
+--
+
+CREATE RULE packages_update AS ON UPDATE TO packages DO INSTEAD UPDATE public.packages p SET version = new.version, state = new.state, section = new.section, priority = new.priority, installed_version = new.installed_version, previous_state = new.previous_state, state_change = new.state_change, notes = new.notes, builder = new.builder, failed = new.failed, old_failed = new.old_failed, binary_nmu_version = new.binary_nmu_version, binary_nmu_changelog = new.binary_nmu_changelog, failed_category = new.failed_category, permbuildpri = new.permbuildpri, buildpri = new.buildpri, depends = new.depends, rel = new.rel, bd_problem = new.bd_problem, extra_depends = new.extra_depends, extra_conflicts = new.extra_conflicts, build_arch_all = new.build_arch_all WHERE ((((p.architecture)::text = 'alpha'::text) AND ((p.package)::text = (old.package)::text)) AND ((p.distribution)::text = (old.distribution)::text));
+
+
+--
+-- Name: pkg_history_delete; Type: RULE; Schema: alpha; Owner: wbadm
+--
+
+CREATE RULE pkg_history_delete AS ON DELETE TO pkg_history DO INSTEAD DELETE FROM public.pkg_history p WHERE ((((((p.architecture)::text = 'alpha'::text) AND ((p.package)::text = (old.package)::text)) AND ((p.distribution)::text = (old.distribution)::text)) AND (p.version OPERATOR(public.=) old.version)) AND (p."timestamp" = old."timestamp"));
+
+
+--
+-- Name: pkg_history_insert; Type: RULE; Schema: alpha; Owner: wbadm
+--
+
+CREATE RULE pkg_history_insert AS ON INSERT TO pkg_history DO INSTEAD INSERT INTO public.pkg_history (architecture, package, distribution, version, "timestamp", result, build_time, disk_space, builder) VALUES ('alpha'::character varying, new.package, new.distribution, new.version, new."timestamp", new.result, new.build_time, new.disk_space, new.builder);
+
+
+--
+-- Name: pkg_history_update; Type: RULE; Schema: alpha; Owner: wbadm