git_sitools_idoc / flarecast / database / PGSQL / pgsql_test.sql @ master
| 1 | d2a8c3fd | Marc NICOLAS | --
|
|---|---|---|---|
| 2 | -- PostgreSQL database dump
|
||
| 3 | --
|
||
| 4 | |||
| 5 | -- Dumped from database version 8.4.7
|
||
| 6 | -- Dumped by pg_dump version 9.0.1
|
||
| 7 | -- Started on 2011-09-22 10:01:48
|
||
| 8 | |||
| 9 | SET statement_timeout = 0; |
||
| 10 | SET client_encoding = 'UTF8'; |
||
| 11 | SET standard_conforming_strings = off;
|
||
| 12 | SET check_function_bodies = false; |
||
| 13 | SET client_min_messages = warning;
|
||
| 14 | SET escape_string_warning = off;
|
||
| 15 | |||
| 16 | DROP SCHEMA IF EXISTS test CASCADE; |
||
| 17 | CREATE SCHEMA test;
|
||
| 18 | ALTER SCHEMA test OWNER TO sitools; |
||
| 19 | |||
| 20 | SET search_path = test, pg_catalog;
|
||
| 21 | |||
| 22 | SET default_tablespace = ''; |
||
| 23 | |||
| 24 | SET default_with_oids = false; |
||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | --
|
||
| 29 | -- TOC entry 1604 (class 1259 OID 17766)
|
||
| 30 | -- Dependencies: 12
|
||
| 31 | -- Name: table_tests; Type: TABLE; Schema: test; Owner: sitools; Tablespace:
|
||
| 32 | --
|
||
| 33 | |||
| 34 | CREATE TABLE table_tests ( |
||
| 35 | "int" integer, |
||
| 36 | "float" real,
|
||
| 37 | double double precision, |
||
| 38 | "varchar" character varying(200), |
||
| 39 | varchar_id character varying(10) NOT NULL, |
||
| 40 | text text, |
||
| 41 | "timestamp" timestamp without time zone, |
||
| 42 | timestamp_with_time_zone timestamp with time zone, |
||
| 43 | date date, |
||
| 44 | "time" time with time zone, |
||
| 45 | "smallint" smallint, |
||
| 46 | "char" character(1), |
||
| 47 | bool boolean, |
||
| 48 | "bigint" bigint, |
||
| 49 | "numeric" numeric,
|
||
| 50 | char10 character(10),
|
||
| 51 | serial integer NOT NULL, |
||
| 52 | bigserial bigint NOT NULL, |
||
| 53 | time_without_time_zone time without time zone |
||
| 54 | ); |
||
| 55 | |||
| 56 | |||
| 57 | ALTER TABLE test.table_tests OWNER TO sitools; |
||
| 58 | |||
| 59 | --
|
||
| 60 | -- TOC entry 1608 (class 1259 OID 17961)
|
||
| 61 | -- Dependencies: 12 1604
|
||
| 62 | -- Name: table_tests_bigserial_seq; Type: SEQUENCE; Schema: test; Owner: sitools
|
||
| 63 | --
|
||
| 64 | |||
| 65 | CREATE SEQUENCE table_tests_bigserial_seq
|
||
| 66 | START WITH 1
|
||
| 67 | INCREMENT BY 1 |
||
| 68 | NO MINVALUE |
||
| 69 | NO MAXVALUE |
||
| 70 | CACHE 1;
|
||
| 71 | |||
| 72 | |||
| 73 | ALTER TABLE test.table_tests_bigserial_seq OWNER TO sitools; |
||
| 74 | |||
| 75 | --
|
||
| 76 | -- TOC entry 1904 (class 0 OID 0)
|
||
| 77 | -- Dependencies: 1608
|
||
| 78 | -- Name: table_tests_bigserial_seq; Type: SEQUENCE OWNED BY; Schema: test; Owner: sitools
|
||
| 79 | --
|
||
| 80 | |||
| 81 | ALTER SEQUENCE table_tests_bigserial_seq OWNED BY table_tests.bigserial; |
||
| 82 | |||
| 83 | |||
| 84 | --
|
||
| 85 | -- TOC entry 1905 (class 0 OID 0)
|
||
| 86 | -- Dependencies: 1608
|
||
| 87 | -- Name: table_tests_bigserial_seq; Type: SEQUENCE SET; Schema: test; Owner: sitools
|
||
| 88 | --
|
||
| 89 | |||
| 90 | SELECT pg_catalog.setval('table_tests_bigserial_seq', 5, true); |
||
| 91 | |||
| 92 | |||
| 93 | --
|
||
| 94 | -- TOC entry 1607 (class 1259 OID 17951)
|
||
| 95 | -- Dependencies: 1604 12
|
||
| 96 | -- Name: table_tests_serial_seq; Type: SEQUENCE; Schema: test; Owner: sitools
|
||
| 97 | --
|
||
| 98 | |||
| 99 | CREATE SEQUENCE table_tests_serial_seq
|
||
| 100 | START WITH 1
|
||
| 101 | INCREMENT BY 1 |
||
| 102 | NO MINVALUE |
||
| 103 | NO MAXVALUE |
||
| 104 | CACHE 1;
|
||
| 105 | |||
| 106 | |||
| 107 | ALTER TABLE test.table_tests_serial_seq OWNER TO sitools; |
||
| 108 | |||
| 109 | --
|
||
| 110 | -- TOC entry 1906 (class 0 OID 0)
|
||
| 111 | -- Dependencies: 1607
|
||
| 112 | -- Name: table_tests_serial_seq; Type: SEQUENCE OWNED BY; Schema: test; Owner: sitools
|
||
| 113 | --
|
||
| 114 | |||
| 115 | ALTER SEQUENCE table_tests_serial_seq OWNED BY table_tests.serial; |
||
| 116 | |||
| 117 | |||
| 118 | --
|
||
| 119 | -- TOC entry 1907 (class 0 OID 0)
|
||
| 120 | -- Dependencies: 1607
|
||
| 121 | -- Name: table_tests_serial_seq; Type: SEQUENCE SET; Schema: test; Owner: sitools
|
||
| 122 | --
|
||
| 123 | |||
| 124 | SELECT pg_catalog.setval('table_tests_serial_seq', 5, true); |
||
| 125 | |||
| 126 | --
|
||
| 127 | -- TOC entry 1891 (class 2604 OID 17953)
|
||
| 128 | -- Dependencies: 1607 1604
|
||
| 129 | -- Name: serial; Type: DEFAULT; Schema: test; Owner: sitools
|
||
| 130 | --
|
||
| 131 | |||
| 132 | ALTER TABLE table_tests ALTER COLUMN serial SET DEFAULT nextval('table_tests_serial_seq'::regclass); |
||
| 133 | |||
| 134 | |||
| 135 | --
|
||
| 136 | -- TOC entry 1892 (class 2604 OID 17963)
|
||
| 137 | -- Dependencies: 1608 1604
|
||
| 138 | -- Name: bigserial; Type: DEFAULT; Schema: test; Owner: sitools
|
||
| 139 | --
|
||
| 140 | |||
| 141 | ALTER TABLE table_tests ALTER COLUMN bigserial SET DEFAULT nextval('table_tests_bigserial_seq'::regclass); |
||
| 142 | |||
| 143 | --
|
||
| 144 | -- TOC entry 1897 (class 0 OID 17766)
|
||
| 145 | -- Dependencies: 1604
|
||
| 146 | -- Data for Name: table_tests; Type: TABLE DATA; Schema: test; Owner: sitools
|
||
| 147 | --
|
||
| 148 | |||
| 149 | INSERT INTO table_tests VALUES (1, 1.316118, 5.9160387339626901, '1', '1', 'ceci est un enregistrement 1', '2011-04-21 14:01:13.048296', '2011-08-21 14:01:13.048297+02', '2011-04-27', '14:25:13.04697+02', 2, 'y', false, 22, 3.43866701866351, 'ceci est 5', 2, 2, '14:28:13.04697'); |
||
| 150 | INSERT INTO table_tests VALUES (0, 1.1553268, 8.9609593900505402, '0', '0', 'ceci est un enregistrement 0', '2011-04-21 14:01:13.047791', '2011-04-21 14:01:13.047794+02', '2011-04-21', '14:01:13.04697+02', 1, 'y', true, 97, 0.675227390775783, 'ceci est 8', 1, 1, '14:01:13.04697'); |
||
| 151 | |||
| 152 | --
|
||
| 153 | -- TOC entry 1895 (class 2606 OID 17773)
|
||
| 154 | -- Dependencies: 1604 1604
|
||
| 155 | -- Name: varchar_id; Type: CONSTRAINT; Schema: test; Owner: sitools; Tablespace:
|
||
| 156 | --
|
||
| 157 | |||
| 158 | ALTER TABLE ONLY table_tests |
||
| 159 | ADD CONSTRAINT varchar_id PRIMARY KEY (varchar_id); |
||
| 160 | |||
| 161 | |||
| 162 | --
|
||
| 163 | -- TOC entry 1908 (class 0 OID 0)
|
||
| 164 | -- Dependencies: 1603
|
||
| 165 | -- Name: test_date; Type: ACL; Schema: test; Owner: sitools
|
||
| 166 | --
|
||
| 167 | |||
| 168 | REVOKE ALL ON TABLE table_tests FROM PUBLIC; |
||
| 169 | REVOKE ALL ON TABLE table_tests FROM sitools; |
||
| 170 | GRANT ALL ON TABLE table_tests TO sitools; |
||
| 171 | GRANT ALL ON TABLE table_tests TO PUBLIC; |
||
| 172 | |||
| 173 | --
|
||
| 174 | -- TOC entry 1611 (class 1259 OID 17988)
|
||
| 175 | -- Dependencies: 12
|
||
| 176 | -- Name: table_tests_3m; Type: TABLE; Schema: test; Owner: sitools; Tablespace:
|
||
| 177 | --
|
||
| 178 | |||
| 179 | CREATE TABLE table_tests_3m ( |
||
| 180 | "int" integer, |
||
| 181 | "float" real,
|
||
| 182 | double double precision, |
||
| 183 | "varchar" character varying(200), |
||
| 184 | varchar_id character varying(10) NOT NULL, |
||
| 185 | text text, |
||
| 186 | "timestamp" timestamp without time zone, |
||
| 187 | timestamp_with_time_zone timestamp with time zone, |
||
| 188 | date date, |
||
| 189 | "time" time with time zone, |
||
| 190 | "smallint" smallint, |
||
| 191 | "char" character(1), |
||
| 192 | bool boolean, |
||
| 193 | "bigint" bigint, |
||
| 194 | "numeric" numeric,
|
||
| 195 | char10 character(10),
|
||
| 196 | serial integer NOT NULL, |
||
| 197 | bigserial bigint NOT NULL, |
||
| 198 | time_without_time_zone time without time zone |
||
| 199 | ); |
||
| 200 | |||
| 201 | |||
| 202 | ALTER TABLE test.table_tests_3m OWNER TO sitools; |
||
| 203 | |||
| 204 | --
|
||
| 205 | -- TOC entry 1610 (class 1259 OID 17986)
|
||
| 206 | -- Dependencies: 12 1611
|
||
| 207 | -- Name: table_tests_3m_bigserial_seq; Type: SEQUENCE; Schema: test; Owner: sitools
|
||
| 208 | --
|
||
| 209 | |||
| 210 | CREATE SEQUENCE table_tests_3m_bigserial_seq
|
||
| 211 | START WITH 1
|
||
| 212 | INCREMENT BY 1 |
||
| 213 | NO MINVALUE |
||
| 214 | NO MAXVALUE |
||
| 215 | CACHE 1;
|
||
| 216 | |||
| 217 | |||
| 218 | ALTER TABLE test.table_tests_3m_bigserial_seq OWNER TO sitools; |
||
| 219 | |||
| 220 | --
|
||
| 221 | -- TOC entry 1976 (class 0 OID 0)
|
||
| 222 | -- Dependencies: 1610
|
||
| 223 | -- Name: table_tests_3m_bigserial_seq; Type: SEQUENCE OWNED BY; Schema: test; Owner: sitools
|
||
| 224 | --
|
||
| 225 | |||
| 226 | ALTER SEQUENCE table_tests_3m_bigserial_seq OWNED BY table_tests_3m.bigserial; |
||
| 227 | |||
| 228 | |||
| 229 | --
|
||
| 230 | -- TOC entry 1609 (class 1259 OID 17984)
|
||
| 231 | -- Dependencies: 1611 12
|
||
| 232 | -- Name: table_tests_3m_serial_seq; Type: SEQUENCE; Schema: test; Owner: sitools
|
||
| 233 | --
|
||
| 234 | |||
| 235 | CREATE SEQUENCE table_tests_3m_serial_seq
|
||
| 236 | START WITH 1
|
||
| 237 | INCREMENT BY 1 |
||
| 238 | NO MINVALUE |
||
| 239 | NO MAXVALUE |
||
| 240 | CACHE 1;
|
||
| 241 | |||
| 242 | |||
| 243 | ALTER TABLE test.table_tests_3m_serial_seq OWNER TO sitools; |
||
| 244 | |||
| 245 | --
|
||
| 246 | -- TOC entry 1977 (class 0 OID 0)
|
||
| 247 | -- Dependencies: 1609
|
||
| 248 | -- Name: table_tests_3m_serial_seq; Type: SEQUENCE OWNED BY; Schema: test; Owner: sitools
|
||
| 249 | --
|
||
| 250 | |||
| 251 | ALTER SEQUENCE table_tests_3m_serial_seq OWNED BY table_tests_3m.serial; |
||
| 252 | |||
| 253 | --
|
||
| 254 | -- TOC entry 1924 (class 2604 OID 17991)
|
||
| 255 | -- Dependencies: 1611 1609 1611
|
||
| 256 | -- Name: serial; Type: DEFAULT; Schema: test; Owner: sitools
|
||
| 257 | --
|
||
| 258 | |||
| 259 | ALTER TABLE table_tests_3m ALTER COLUMN serial SET DEFAULT nextval('table_tests_3m_serial_seq'::regclass); |
||
| 260 | |||
| 261 | |||
| 262 | --
|
||
| 263 | -- TOC entry 1925 (class 2604 OID 17992)
|
||
| 264 | -- Dependencies: 1610 1611 1611
|
||
| 265 | -- Name: bigserial; Type: DEFAULT; Schema: test; Owner: sitools
|
||
| 266 | --
|
||
| 267 | |||
| 268 | ALTER TABLE table_tests_3m ALTER COLUMN bigserial SET DEFAULT nextval('table_tests_3m_bigserial_seq'::regclass); |
||
| 269 | |||
| 270 | --
|
||
| 271 | -- TOC entry 1951 (class 2606 OID 17997)
|
||
| 272 | -- Dependencies: 1611 1611
|
||
| 273 | -- Name: varchar_id_3m; Type: CONSTRAINT; Schema: test; Owner: sitools; Tablespace:
|
||
| 274 | --
|
||
| 275 | |||
| 276 | ALTER TABLE ONLY table_tests_3m |
||
| 277 | ADD CONSTRAINT varchar_id_3m PRIMARY KEY (varchar_id); |
||
| 278 | |||
| 279 | -- Completed on 2011-09-22 10:01:49
|
||
| 280 | |||
| 281 | --
|
||
| 282 | -- PostgreSQL database dump complete
|
||
| 283 | --
|
||
| 284 |