source: branches/stable/cgi-bin/ipdb.psql@ 125

Last change on this file since 125 was 91, checked in by Kris Deugau, 20 years ago

/branches/stable

Overhaul of city listings - first stage. Cities are now listed in
ONE place for stuffing into HTML and so on. City list also updated
with most of the cities currently listed, and a few that have
probably been removed.
SQL schema updated with new table

File size: 5.8 KB
RevLine 
[4]1--
2-- Selected TOC Entries:
3--
4\connect - postgres
5
6--
[91]7-- TOC Entry ID 22 (OID 16556)
[4]8--
9-- Name: "plpgsql_call_handler" () Type: FUNCTION Owner: postgres
10--
11
12CREATE FUNCTION "plpgsql_call_handler" () RETURNS opaque AS '$libdir/plpgsql', 'plpgsql_call_handler' LANGUAGE 'C';
13
14--
[91]15-- TOC Entry ID 23 (OID 16557)
[4]16--
17-- Name: plpgsql Type: PROCEDURAL LANGUAGE Owner:
18--
19
20CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER "plpgsql_call_handler" LANCOMPILER '';
21
22\connect - ipdb
23
24--
[75]25-- TOC Entry ID 2 (OID 25854)
[4]26--
27-- Name: customers Type: TABLE Owner: ipdb
28--
29
30CREATE TABLE "customers" (
31 "custid" character varying(16) DEFAULT '' NOT NULL,
32 "name" character varying(64),
33 "street" character varying(25),
34 "street2" character varying(25),
35 "city" character varying(30),
36 "province" character(2),
37 "pocode" character varying(7),
38 "phone" character varying(15),
39 "abuse" character varying(50),
40 "def_rdns" character varying(40),
41 "description" text,
42 Constraint "customers_pkey" Primary Key ("custid")
43);
44
45--
[75]46-- TOC Entry ID 3 (OID 25854)
[4]47--
[59]48-- Name: customers Type: ACL Owner:
[4]49--
50
[59]51REVOKE ALL on "customers" from PUBLIC;
52GRANT ALL on "customers" to "kdeugau";
53GRANT ALL on "customers" to "ipdb";
[4]54
55--
[75]56-- TOC Entry ID 4 (OID 25872)
[4]57--
58-- Name: masterblocks Type: TABLE Owner: ipdb
59--
60
61CREATE TABLE "masterblocks" (
62 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL,
63 Constraint "masterblocks_pkey" Primary Key ("cidr")
64);
65
66--
[75]67-- TOC Entry ID 5 (OID 25872)
[4]68--
[59]69-- Name: masterblocks Type: ACL Owner:
70--
71
72REVOKE ALL on "masterblocks" from PUBLIC;
73GRANT ALL on "masterblocks" to "kdeugau";
74GRANT ALL on "masterblocks" to "ipdb";
75
76--
[75]77-- TOC Entry ID 6 (OID 25875)
[59]78--
[4]79-- Name: routed Type: TABLE Owner: ipdb
80--
81
82CREATE TABLE "routed" (
83 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL,
84 "maskbits" integer DEFAULT 128,
85 "city" character varying(30) DEFAULT '',
86 Constraint "routed_pkey" Primary Key ("cidr")
87);
88
89--
[75]90-- TOC Entry ID 7 (OID 25875)
[4]91--
[59]92-- Name: routed Type: ACL Owner:
93--
94
95REVOKE ALL on "routed" from PUBLIC;
96GRANT ALL on "routed" to "kdeugau";
97GRANT ALL on "routed" to "ipdb";
98
99--
[75]100-- TOC Entry ID 8 (OID 31131)
[59]101--
[4]102-- Name: temp Type: TABLE Owner: ipdb
103--
104
105CREATE TABLE "temp" (
106 "ofs" integer
107);
108
[59]109--
[75]110-- TOC Entry ID 9 (OID 31131)
[59]111--
112-- Name: temp Type: ACL Owner:
113--
114
115REVOKE ALL on "temp" from PUBLIC;
116GRANT ALL on "temp" to "kdeugau";
117GRANT ALL on "temp" to "ipdb";
118
119--
[75]120-- TOC Entry ID 10 (OID 73917)
[59]121--
122-- Name: searchme Type: VIEW Owner: ipdb
123--
124
125CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.ptype, poolips.city, poolips.description FROM poolips;
126
127--
[75]128-- TOC Entry ID 11 (OID 73917)
[59]129--
130-- Name: searchme Type: ACL Owner:
131--
132
133REVOKE ALL on "searchme" from PUBLIC;
134GRANT ALL on "searchme" to "kdeugau";
135GRANT ALL on "searchme" to "ipdb";
136
137--
[75]138-- TOC Entry ID 12 (OID 91065)
[59]139--
140-- Name: freeblocks Type: TABLE Owner: ipdb
141--
142
143CREATE TABLE "freeblocks" (
144 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL,
145 "maskbits" integer DEFAULT 128,
146 "city" character varying(30) DEFAULT '',
147 "routed" character(1) DEFAULT 'n',
148 Constraint "freeblocks_pkey" Primary Key ("cidr")
149);
150
151--
[75]152-- TOC Entry ID 13 (OID 91065)
[59]153--
154-- Name: freeblocks Type: ACL Owner:
155--
156
157REVOKE ALL on "freeblocks" from PUBLIC;
158GRANT ALL on "freeblocks" to "kdeugau";
159GRANT ALL on "freeblocks" to "ipdb";
160
[75]161--
162-- TOC Entry ID 14 (OID 92444)
163--
164-- Name: poolips Type: TABLE Owner: ipdb
165--
166
167CREATE TABLE "poolips" (
168 "pool" cidr DEFAULT '255.255.255.255/32' NOT NULL,
169 "ip" cidr DEFAULT '255.255.255.255/32' NOT NULL,
170 "custid" character varying(16) DEFAULT '' NOT NULL,
171 "city" character varying(30) DEFAULT '',
172 "ptype" character(1) DEFAULT 'c' NOT NULL,
173 "available" character(1) DEFAULT 'y',
174 "notes" text DEFAULT '',
175 "description" character varying(64) DEFAULT '',
176 "circuitid" character varying(128) DEFAULT '',
177 CHECK (((available = 'y'::bpchar) OR (available = 'n'::bpchar))),
178 Constraint "poolips_pkey" Primary Key ("ip")
179);
180
181--
182-- TOC Entry ID 15 (OID 92444)
183--
184-- Name: poolips Type: ACL Owner:
185--
186
187REVOKE ALL on "poolips" from PUBLIC;
188GRANT ALL on "poolips" to "kdeugau";
189GRANT ALL on "poolips" to "ipdb";
190
191--
192-- TOC Entry ID 16 (OID 92725)
193--
194-- Name: allocations Type: TABLE Owner: ipdb
195--
196
197CREATE TABLE "allocations" (
198 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL,
199 "custid" character varying(16) DEFAULT '',
200 "type" character(2) DEFAULT '',
201 "city" character varying(30) DEFAULT '',
202 "description" character varying(64) DEFAULT '',
203 "notes" text DEFAULT '',
204 "maskbits" integer DEFAULT 128,
205 "circuitid" character varying(128) DEFAULT '',
206 Constraint "allocations_pkey" Primary Key ("cidr")
207);
208
209--
210-- TOC Entry ID 17 (OID 92725)
211--
212-- Name: allocations Type: ACL Owner:
213--
214
215REVOKE ALL on "allocations" from PUBLIC;
216GRANT ALL on "allocations" to "kdeugau";
217GRANT ALL on "allocations" to "ipdb";
218
[91]219--
220-- TOC Entry ID 18 (OID 92809)
221--
222-- Name: alloctypes Type: TABLE Owner: ipdb
223--
224
225CREATE TABLE "alloctypes" (
226 "type" character(2) DEFAULT '' NOT NULL,
227 "listname" character varying(40) DEFAULT '',
228 "dispname" character varying(40) DEFAULT '',
229 "listorder" integer DEFAULT 0,
230 Constraint "alloctypes_pkey" Primary Key ("type")
231);
232
233--
234-- TOC Entry ID 19 (OID 92809)
235--
236-- Name: alloctypes Type: ACL Owner:
237--
238
239REVOKE ALL on "alloctypes" from PUBLIC;
240GRANT ALL on "alloctypes" to "kdeugau";
241GRANT ALL on "alloctypes" to "ipdb";
242
243--
244-- TOC Entry ID 20 (OID 93964)
245--
246-- Name: cities Type: TABLE Owner: ipdb
247--
248
249CREATE TABLE "cities" (
250 "city" character varying(30) DEFAULT '' NOT NULL,
251 "routing" character(1) DEFAULT 'n' NOT NULL,
252 Constraint "cities_pkey" Primary Key ("city")
253);
254
255--
256-- TOC Entry ID 21 (OID 93964)
257--
258-- Name: cities Type: ACL Owner:
259--
260
261REVOKE ALL on "cities" from PUBLIC;
262GRANT ALL on "cities" to "kdeugau";
263GRANT ALL on "cities" to "ipdb";
264
Note: See TracBrowser for help on using the repository browser.