Created
February 12, 2015 23:43
-
-
Save felixbuenemann/056f157a200e334dc5b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- PostgreSQL database dump | |
-- | |
SET statement_timeout = 0; | |
SET lock_timeout = 0; | |
SET client_encoding = 'UTF8'; | |
SET standard_conforming_strings = on; | |
SET check_function_bodies = false; | |
SET client_min_messages = warning; | |
SET search_path = public, pg_catalog; | |
-- | |
-- Name: foo_label(integer); Type: FUNCTION; Schema: public; Owner: - | |
-- | |
CREATE FUNCTION foo_label(value integer) RETURNS text | |
LANGUAGE sql STABLE | |
AS $$ SELECT label FROM foo WHERE id = value; $$; | |
SET default_tablespace = ''; | |
SET default_with_oids = false; | |
-- | |
-- Name: baz; Type: TABLE; Schema: public; Owner: -; Tablespace: | |
-- | |
CREATE TABLE baz ( | |
id integer | |
); | |
-- | |
-- Name: bar; Type: MATERIALIZED VIEW; Schema: public; Owner: -; Tablespace: | |
-- | |
CREATE MATERIALIZED VIEW bar AS | |
SELECT foo_label(baz.id) AS foo_label | |
FROM baz | |
WITH NO DATA; | |
-- | |
-- Name: foo; Type: TABLE; Schema: public; Owner: -; Tablespace: | |
-- | |
CREATE TABLE foo ( | |
id integer, | |
label text | |
); | |
-- | |
-- PostgreSQL database dump complete | |
-- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dump created on PostgreSQL 9.4.1 with
pg_dump -x -s -O -f foo.sql foo
and loaded withpsql bar -f foo.sql
gives error: