Skip to content

Commit

Permalink
added tests for quoted schemas in search_path
Browse files Browse the repository at this point in the history
  • Loading branch information
fordfrog committed Jun 1, 2012
1 parent d7707da commit 2dbe150
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/test/java/cz/startnet/utils/pgdiff/PgDiffTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ public static Collection<?> parameters() {
// Tests function arguments beginning with in_
{"function_bug3084274", false, true, false, false},
// Tests addition of comment when new column has been added
{"add_comment_new_column", false, true, false, false}
{"add_comment_new_column", false, true, false, false},
// Tests handling of quoted schemas in search_path
{"quoted_schema", false, true, false, false}
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

SET search_path = "ABC", pg_catalog;

CREATE TABLE testtable2 (
id integer,
name character varying(100) NOT NULL
);
92 changes: 92 additions & 0 deletions src/test/resources/cz/startnet/utils/pgdiff/quoted_schema_new.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- Name: ABC; Type: SCHEMA; Schema: -; Owner: fordfrog
--

CREATE SCHEMA "ABC";


ALTER SCHEMA "ABC" OWNER TO fordfrog;

--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


SET search_path = "ABC", pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: testtable; Type: TABLE; Schema: ABC; Owner: fordfrog; Tablespace:
--

CREATE TABLE testtable (
field1 integer,
field2 integer,
field3 character varying(150) DEFAULT 'none'::character varying,
field4 double precision
);


ALTER TABLE "ABC".testtable OWNER TO fordfrog;

--
-- Name: testtable2; Type: TABLE; Schema: ABC; Owner: fordfrog; Tablespace:
--

CREATE TABLE testtable2 (
id integer,
name character varying(100) NOT NULL
);


ALTER TABLE "ABC".testtable2 OWNER TO fordfrog;

--
-- Data for Name: testtable; Type: TABLE DATA; Schema: ABC; Owner: fordfrog
--

COPY testtable (field1, field2, field3, field4) FROM stdin;
\.


--
-- Data for Name: testtable2; Type: TABLE DATA; Schema: ABC; Owner: fordfrog
--

COPY testtable2 (id, name) FROM stdin;
\.


--
-- Name: testindex; Type: INDEX; Schema: ABC; Owner: fordfrog; Tablespace:
--

CREATE INDEX testindex ON testtable USING btree (field3);


--
-- PostgreSQL database dump complete
--

Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- Name: ABC; Type: SCHEMA; Schema: -; Owner: fordfrog
--

CREATE SCHEMA "ABC";


ALTER SCHEMA "ABC" OWNER TO fordfrog;

--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


SET search_path = "ABC", pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: testtable; Type: TABLE; Schema: ABC; Owner: fordfrog; Tablespace:
--

CREATE TABLE testtable (
field1 integer,
field2 integer,
field3 character varying(150) DEFAULT 'none'::character varying,
field4 double precision
);


ALTER TABLE "ABC".testtable OWNER TO fordfrog;

--
-- Data for Name: testtable; Type: TABLE DATA; Schema: ABC; Owner: fordfrog
--

COPY testtable (field1, field2, field3, field4) FROM stdin;
\.


--
-- Name: testindex; Type: INDEX; Schema: ABC; Owner: fordfrog; Tablespace:
--

CREATE INDEX testindex ON testtable USING btree (field3);


--
-- PostgreSQL database dump complete
--

0 comments on commit 2dbe150

Please sign in to comment.