Skip to content
02-tap_schema.sql 8.91 KiB
Newer Older
--
-- PostgreSQL database dump
--

-- Dumped from database version 11.9 (Debian 11.9-1.pgdg90+1)
-- Dumped by pg_dump version 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: TAP_SCHEMA; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA "TAP_SCHEMA";


ALTER SCHEMA "TAP_SCHEMA" OWNER TO postgres;

SET default_tablespace = '';

--
-- Name: columns; Type: TABLE; Schema: TAP_SCHEMA; Owner: postgres
--

CREATE TABLE "TAP_SCHEMA".columns (
    table_name character varying(128) NOT NULL,
    column_name character varying(64) NOT NULL,
    datatype character varying(64),
    size integer,
    description text,
    utype character varying,
    unit character varying(64),
    ucd character varying(64),
    indexed boolean NOT NULL,
    principal boolean NOT NULL,
    std boolean NOT NULL,
    arraysize character varying,
    xtype character varying,
    column_index integer
);


ALTER TABLE "TAP_SCHEMA".columns OWNER TO postgres;

--
-- Name: key_columns; Type: TABLE; Schema: TAP_SCHEMA; Owner: postgres
--

CREATE TABLE "TAP_SCHEMA".key_columns (
    key_id character varying(64),
    from_column character varying(64),
    target_column character varying(64)
);


ALTER TABLE "TAP_SCHEMA".key_columns OWNER TO postgres;

--
-- Name: keys; Type: TABLE; Schema: TAP_SCHEMA; Owner: postgres
--

CREATE TABLE "TAP_SCHEMA".keys (
    key_id character varying(64) NOT NULL,
    from_table character varying(128),
    target_table character varying(128),
    description text,
    utype character varying
);


ALTER TABLE "TAP_SCHEMA".keys OWNER TO postgres;

--
-- Name: schemas; Type: TABLE; Schema: TAP_SCHEMA; Owner: postgres
--

CREATE TABLE "TAP_SCHEMA".schemas (
    schema_name character varying(64) NOT NULL,
    utype character varying,
    description text
);


ALTER TABLE "TAP_SCHEMA".schemas OWNER TO postgres;

--
-- Name: tables; Type: TABLE; Schema: TAP_SCHEMA; Owner: postgres
--

CREATE TABLE "TAP_SCHEMA".tables (
    schema_name character varying(64) NOT NULL,
    table_name character varying(128) NOT NULL,
    table_type character varying(8),
    utype character varying,
    description text,
    table_index integer
);


ALTER TABLE "TAP_SCHEMA".tables OWNER TO postgres;

--
-- Data for Name: columns; Type: TABLE DATA; Schema: TAP_SCHEMA; Owner: postgres
--

COPY "TAP_SCHEMA".columns (table_name, column_name, datatype, size, description, utype, unit, ucd, indexed, principal, std, arraysize, xtype, column_index) FROM stdin;
demo.private_rows	group	char	255	\N	\N	\N	\N	f	f	f	255*	\N	\N
demo.private_rows	policy	char	255	\N	\N	\N	\N	f	f	f	255*	\N	\N
demo.private_rows	value	char	255	\N	\N	\N	\N	f	f	f	255*	\N	\N
TAP_SCHEMA.columns	arraysize	char	\N	\N	\N	\N	\N	f	f	t	*	\N	\N
TAP_SCHEMA.columns	column_index	int	\N	\N	\N	\N	\N	f	f	t	\N	\N	\N
TAP_SCHEMA.columns	column_name	char	64	the column name	\N	\N	\N	t	f	t	64*	\N	\N
TAP_SCHEMA.columns	datatype	char	64	lists the ADQL datatype of columns in the tableset	\N	\N	\N	f	f	t	64*	\N	\N
TAP_SCHEMA.columns	description	char	\N	describes the columns in the tableset	\N	\N	\N	f	f	t	*	\N	\N
TAP_SCHEMA.columns	indexed	boolean	\N	an indexed column	\N	\N	\N	f	f	t	\N	\N	\N
TAP_SCHEMA.columns	principal	boolean	\N	a principal column	\N	\N	\N	f	f	t	\N	\N	\N
TAP_SCHEMA.columns	size	int	\N	lists the size of variable-length columns in the tableset	\N	\N	\N	f	f	t	\N	\N	\N
TAP_SCHEMA.columns	std	boolean	\N	a standard column	\N	\N	\N	f	f	t	\N	\N	\N
TAP_SCHEMA.columns	table_name	char	128	the table this column belongs to	\N	\N	\N	t	f	t	128*	\N	\N
TAP_SCHEMA.columns	ucd	char	64	lists the UCDs of columns in the tableset	\N	\N	\N	f	f	t	64*	\N	\N
TAP_SCHEMA.columns	unit	char	64	lists the unit used for column values in the tableset	\N	\N	\N	f	f	t	64*	\N	\N
TAP_SCHEMA.columns	utype	char	\N	lists the utypes of columns in the tableset	\N	\N	\N	f	f	t	*	\N	\N
TAP_SCHEMA.columns	xtype	char	\N	\N	\N	\N	\N	f	f	t	*	\N	\N
TAP_SCHEMA.key_columns	from_column	char	64	column in the from_table	\N	\N	\N	f	f	t	64*	\N	\N
TAP_SCHEMA.key_columns	key_id	char	64	key to join to TAP_SCHEMA.keys	\N	\N	\N	t	f	t	64*	\N	\N
TAP_SCHEMA.key_columns	target_column	char	64	column in the target_table	\N	\N	\N	f	f	t	64*	\N	\N
TAP_SCHEMA.keys	description	char	\N	describes keys in the tableset	\N	\N	\N	f	f	t	*	\N	\N
TAP_SCHEMA.keys	from_table	char	128	the table with the foreign key	\N	\N	\N	t	f	t	128*	\N	\N
TAP_SCHEMA.keys	key_id	char	64	unique key to join to TAP_SCHEMA.key_columns	\N	\N	\N	t	f	t	64*	\N	\N
TAP_SCHEMA.keys	target_table	char	128	the table with the primary key	\N	\N	\N	t	f	t	128*	\N	\N
TAP_SCHEMA.keys	utype	char	\N	lists the utype of keys in the tableset	\N	\N	\N	f	f	t	*	\N	\N
TAP_SCHEMA.schemas	description	char	\N	describes schemas in the tableset	\N	\N	\N	f	f	t	*	\N	\N
TAP_SCHEMA.schemas	schema_name	char	64	schema name for reference to TAP_SCHEMA.schemas	\N	\N	\N	t	f	t	64*	\N	\N
TAP_SCHEMA.schemas	utype	char	\N	lists the utypes of schemas in the tableset	\N	\N	\N	f	f	t	*	\N	\N
TAP_SCHEMA.tables	description	char	\N	describes tables in the tableset	\N	\N	\N	f	f	t	*	\N	\N
TAP_SCHEMA.tables	schema_name	char	64	the schema this table belongs to	\N	\N	\N	t	f	t	64*	\N	\N
TAP_SCHEMA.tables	table_index	int	\N	\N	\N	\N	\N	f	f	t	\N	\N	\N
TAP_SCHEMA.tables	table_name	char	128	the fully qualified table name	\N	\N	\N	t	f	t	128*	\N	\N
TAP_SCHEMA.tables	table_type	char	8	one of: table view	\N	\N	\N	f	f	t	8*	\N	\N
TAP_SCHEMA.tables	utype	char	\N	lists the utype of tables in the tableset	\N	\N	\N	f	f	t	*	\N	\N
\.


--
-- Data for Name: key_columns; Type: TABLE DATA; Schema: TAP_SCHEMA; Owner: postgres
--

COPY "TAP_SCHEMA".key_columns (key_id, from_column, target_column) FROM stdin;
\.


--
-- Data for Name: keys; Type: TABLE DATA; Schema: TAP_SCHEMA; Owner: postgres
--

COPY "TAP_SCHEMA".keys (key_id, from_table, target_table, description, utype) FROM stdin;
\.


--
-- Data for Name: schemas; Type: TABLE DATA; Schema: TAP_SCHEMA; Owner: postgres
--

COPY "TAP_SCHEMA".schemas (schema_name, utype, description) FROM stdin;
demo	\N	\N
TAP_SCHEMA	\N	a special schema to describe a TAP tableset
\.


--
-- Data for Name: tables; Type: TABLE DATA; Schema: TAP_SCHEMA; Owner: postgres
--

COPY "TAP_SCHEMA".tables (schema_name, table_name, table_type, utype, description, table_index) FROM stdin;
demo	demo.private_rows	table	\N	\N	\N
TAP_SCHEMA	TAP_SCHEMA.columns	table	\N	description of columns in this tableset	\N
TAP_SCHEMA	TAP_SCHEMA.key_columns	table	\N	description of foreign key columns in this tableset	\N
TAP_SCHEMA	TAP_SCHEMA.keys	table	\N	description of foreign keys in this tableset	\N
TAP_SCHEMA	TAP_SCHEMA.schemas	table	\N	description of schemas in this tableset	\N
TAP_SCHEMA	TAP_SCHEMA.tables	table	\N	description of tables in this tableset	\N
\.


--
-- Name: columns columns_pkey; Type: CONSTRAINT; Schema: TAP_SCHEMA; Owner: postgres
--

ALTER TABLE ONLY "TAP_SCHEMA".columns
    ADD CONSTRAINT columns_pkey PRIMARY KEY (table_name, column_name);


--
-- Name: keys keys_pkey; Type: CONSTRAINT; Schema: TAP_SCHEMA; Owner: postgres
--

ALTER TABLE ONLY "TAP_SCHEMA".keys
    ADD CONSTRAINT keys_pkey PRIMARY KEY (key_id);


--
-- Name: schemas schemas_pkey; Type: CONSTRAINT; Schema: TAP_SCHEMA; Owner: postgres
--

ALTER TABLE ONLY "TAP_SCHEMA".schemas
    ADD CONSTRAINT schemas_pkey PRIMARY KEY (schema_name);


--
-- Name: tables tables_pkey; Type: CONSTRAINT; Schema: TAP_SCHEMA; Owner: postgres
--

ALTER TABLE ONLY "TAP_SCHEMA".tables
    ADD CONSTRAINT tables_pkey PRIMARY KEY (table_name);


--
-- Name: columns fk_columns_table_name; Type: FK CONSTRAINT; Schema: TAP_SCHEMA; Owner: postgres
--

ALTER TABLE ONLY "TAP_SCHEMA".columns
    ADD CONSTRAINT fk_columns_table_name FOREIGN KEY (table_name) REFERENCES "TAP_SCHEMA".tables(table_name);


--
-- Name: key_columns fk_key_columns_key_id; Type: FK CONSTRAINT; Schema: TAP_SCHEMA; Owner: postgres
--

ALTER TABLE ONLY "TAP_SCHEMA".key_columns
    ADD CONSTRAINT fk_key_columns_key_id FOREIGN KEY (key_id) REFERENCES "TAP_SCHEMA".keys(key_id);


--
-- Name: keys fk_keys_from_table; Type: FK CONSTRAINT; Schema: TAP_SCHEMA; Owner: postgres
--

ALTER TABLE ONLY "TAP_SCHEMA".keys
    ADD CONSTRAINT fk_keys_from_table FOREIGN KEY (from_table) REFERENCES "TAP_SCHEMA".tables(table_name);


--
-- Name: keys fk_keys_target_table; Type: FK CONSTRAINT; Schema: TAP_SCHEMA; Owner: postgres
--

ALTER TABLE ONLY "TAP_SCHEMA".keys
    ADD CONSTRAINT fk_keys_target_table FOREIGN KEY (target_table) REFERENCES "TAP_SCHEMA".tables(table_name);


--
-- Name: tables fk_tables_schema_name; Type: FK CONSTRAINT; Schema: TAP_SCHEMA; Owner: postgres
--

ALTER TABLE ONLY "TAP_SCHEMA".tables
    ADD CONSTRAINT fk_tables_schema_name FOREIGN KEY (schema_name) REFERENCES "TAP_SCHEMA".schemas(schema_name);


--
-- PostgreSQL database dump complete
--