提交 99d1cbf8 编写于 作者: H Heikki Linnakangas

Don't recreate 'world' test tables in with_clause test.

Loading the tables takes a few seconds, so let's not duplicate that work.
上级 b677127a
--
-- PostgreSQL port of the MySQL "World" database.
--
-- The sample data used in the world database is Copyright Statistics
-- Finland, http://www.stat.fi/worldinfigures.
--
-- Modified to use it with GPDB
--start_ignore
DROP TABLE IF EXISTS city cascade;
DROP TABLE IF EXISTS country cascade;
DROP TABLE IF EXISTS countrylanguage cascade;
--end_ignore
BEGIN;
--SET client_encoding = 'LATIN1';
CREATE TABLE city (
id integer NOT NULL,
name text NOT NULL,
countrycode character(3) NOT NULL,
district text NOT NULL,
population integer NOT NULL
) distributed by(id);
CREATE TABLE country (
code character(3) NOT NULL,
name text NOT NULL,
continent text NOT NULL,
region text NOT NULL,
surfacearea real NOT NULL,
indepyear smallint,
population integer NOT NULL,
lifeexpectancy real,
gnp numeric(10,2),
gnpold numeric(10,2),
localname text NOT NULL,
governmentform text NOT NULL,
headofstate text,
capital integer,
code2 character(2) NOT NULL
) distributed by (code);
CREATE TABLE countrylanguage (
countrycode character(3) NOT NULL,
"language" text NOT NULL,
isofficial boolean NOT NULL,
percentage real NOT NULL
)distributed by (countrycode,language);
COPY city (id, name, countrycode, district, population) FROM stdin;
--
-- Data for Name: country; Type: TABLE DATA; Schema: public; Owner: chriskl
--
COPY country (code, name, continent, region, surfacearea, indepyear, population, lifeexpectancy, gnp, gnpold, localname, governmentform, headofstate, capital, code2) FROM stdin WITH NULL AS '';
--
-- Data for Name: countrylanguage; Type: TABLE DATA; Schema: public; Owner: chriskl
--
COPY countrylanguage (countrycode, "language", isofficial, percentage) FROM stdin;
ALTER TABLE ONLY city
ADD CONSTRAINT city_pkey PRIMARY KEY (id);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "city_pkey" for table "city"
ALTER TABLE ONLY country
ADD CONSTRAINT country_pkey PRIMARY KEY (code);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "country_pkey" for table "country"
ALTER TABLE ONLY countrylanguage
ADD CONSTRAINT countrylanguage_pkey PRIMARY KEY (countrycode, "language");
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "countrylanguage_pkey" for table "countrylanguage"
COMMIT;
ANALYZE city;
ANALYZE country;
ANALYZE countrylanguage;
-- These queries depend on the tables created by the 'world' test.
with capitals as (select country.code,id,city.name from city,country where city.countrycode = country.code AND city.id = country.capital)
--start_ignore
select * from capitals,countrylanguage where capitals.code = countrylanguage.countrycode and isofficial='true' order by capitals.code,countrylanguage.language;
......@@ -2362,4 +2297,3 @@ select * from bad_headofstates order by region,headofstate;
(16 rows)
drop table bad_headofstates;
......@@ -12,6 +12,7 @@ test: wrkloadadmin
test: xpath
ignore: jdbc
test: world
test: with_clause
test: jetpack
test: spi
test: security
......@@ -23,7 +24,6 @@ test: bkup_gp
test: mpp-11333
test: DMLstmnt
test: optquery
test: with_clause
test: codecoverage
test: gist_indexes
ignore: failover
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册