|
1 | 1 | CREATE SEQUENCE "cities_id_seq" start 7 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ; |
2 | | -SELECT nextval ('cities_id_seq'); |
| 2 | +SELECT nextval ('"cities_id_seq"'); |
3 | 3 | CREATE TABLE "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 | CREATE TABLE "pga_forms" ( |
12 | 13 | "formname" character varying(64), |
13 | | - "formsource" text); |
| 14 | + "formsource" text |
| 15 | +); |
14 | 16 | CREATE TABLE "pga_scripts" ( |
15 | 17 | "scriptname" character varying(64), |
16 | | - "scriptsource" text); |
| 18 | + "scriptsource" text |
| 19 | +); |
17 | 20 | CREATE TABLE "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 | CREATE TABLE "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 | CREATE TABLE "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 | CREATE TABLE "pga_schema" ( |
35 | 41 | "schemaname" character varying(64), |
36 | 42 | "schematables" text, |
37 | | - "schemalinks" text); |
| 43 | + "schemalinks" text |
| 44 | +); |
38 | 45 | REVOKE ALL on "pga_schema" from PUBLIC; |
39 | 46 | GRANT ALL on "pga_schema" to PUBLIC; |
40 | 47 | CREATE TABLE "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 ALL on "cities" from PUBLIC; |
| 53 | +GRANT INSERT,SELECT,RULE on "cities" to "teo"; |
45 | 54 | CREATE FUNCTION "getcityprefix" (int4 ) RETURNS varchar AS 'select prefix from cities where id = $1 ' LANGUAGE 'SQL'; |
46 | 55 | COPY "pga_queries" FROM stdin; |
47 | 56 | Query that can be saved as view S select * from phonebook where continent='usa' \N \N \N \N |
|
0 commit comments