|
1 | 1 | CREATESEQUENCE "cities_id_seq" start7 increment1 maxvalue2147483647 minvalue1 cache1 ; |
2 | | -SELECT nextval ('cities_id_seq'); |
| 2 | +SELECT nextval ('"cities_id_seq"'); |
3 | 3 | CREATETABLE "pga_queries" ( |
4 | 4 | "queryname"character varying(64), |
5 | 5 | "querytype" character, |
6 | 6 | "querycommand"text, |
7 | 7 | "querytables"text, |
8 | 8 | "querylinks"text, |
9 | 9 | "queryresults"text, |
10 | | -"querycomments"text); |
| 10 | +"querycomments"text |
| 11 | +); |
11 | 12 | CREATETABLE "pga_forms" ( |
12 | 13 | "formname"character varying(64), |
13 | | -"formsource"text); |
| 14 | +"formsource"text |
| 15 | +); |
14 | 16 | CREATETABLE "pga_scripts" ( |
15 | 17 | "scriptname"character varying(64), |
16 | | -"scriptsource"text); |
| 18 | +"scriptsource"text |
| 19 | +); |
17 | 20 | CREATETABLE "pga_reports" ( |
18 | 21 | "reportname"character varying(64), |
19 | 22 | "reportsource"text, |
20 | 23 | "reportbody"text, |
21 | 24 | "reportprocs"text, |
22 | | -"reportoptions"text); |
| 25 | +"reportoptions"text |
| 26 | +); |
23 | 27 | CREATETABLE "phonebook" ( |
24 | 28 | "name"character varying(32), |
25 | 29 | "phone_nr"character varying(16), |
26 | 30 | "city"character varying(32), |
27 | 31 | "company" bool, |
28 | | -"continent"character varying(16)); |
| 32 | +"continent"character varying(16) |
| 33 | +); |
29 | 34 | CREATETABLE "pga_layout" ( |
30 | 35 | "tablename"character varying(64), |
31 | 36 | "nrcols" int2, |
32 | 37 | "colnames"text, |
33 | | -"colwidth"text); |
| 38 | +"colwidth"text |
| 39 | +); |
34 | 40 | CREATETABLE "pga_schema" ( |
35 | 41 | "schemaname"character varying(64), |
36 | 42 | "schematables"text, |
37 | | -"schemalinks"text); |
| 43 | +"schemalinks"text |
| 44 | +); |
38 | 45 | REVOKE ALLon"pga_schema"from PUBLIC; |
39 | 46 | GRANT ALLon"pga_schema" to PUBLIC; |
40 | 47 | CREATETABLE "cities" ( |
41 | | -"id" int4 DEFAULT nextval ('"cities_id_seq"')NOT NULL, |
| 48 | +"id" int4 DEFAULT nextval('cities_id_seq'::text)NOT NULL, |
42 | 49 | "name"character varying(32)NOT NULL, |
43 | | -"prefix"character varying(16)NOT NULL); |
| 50 | +"prefix"character varying(16)NOT NULL |
| 51 | +); |
44 | 52 | REVOKE ALLon"cities"from PUBLIC; |
| 53 | +GRANT INSERT,SELECT,RULEon"cities" to"teo"; |
45 | 54 | CREATEFUNCTION "getcityprefix" (int4 ) RETURNSvarcharAS'select prefix from cities where id = $1' LANGUAGE'SQL'; |
46 | 55 | COPY"pga_queries"FROM stdin; |
47 | 56 | Query that can be savedas viewSselect*from phonebookwhere continent='usa' \N\N\N\N |
|