Changeset 507 for branches/stable/cgi-bin/ipdb.psql
- Timestamp:
- 11/15/11 18:08:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/ipdb.psql
r445 r507 1 DROP DATABASE ipdb; 2 3 CREATE USER ipdb WITH PASSWORD 'ipdbpwd'; 4 5 CREATE DATABASE ipdb; 6 7 -- Need to do this or our triggers don't work. Why do we need to do this? 8 CREATE FUNCTION "plpgsql_call_handler" () RETURNS language_handler AS '$libdir/plpgsql' LANGUAGE C; 9 CREATE TRUSTED LANGUAGE "plpgsql" HANDLER "plpgsql_call_handler"; 10 11 UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='ipdb') 12 WHERE datname='ipdb'; 13 14 \connect ipdb ipdb 1 -- Initial table setup for IP Database 15 2 16 3 CREATE TABLE "customers" ( … … 32 19 ); 33 20 34 REVOKE ALL on "customers" from PUBLIC;35 GRANT ALL on "customers" to "ipdb";36 37 21 CREATE TABLE "masterblocks" ( 38 22 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY, … … 41 25 "rwhois" character(1) DEFAULT 'n' NOT NULL 42 26 ); 43 44 REVOKE ALL on "masterblocks" from PUBLIC;45 GRANT ALL on "masterblocks" to "ipdb";46 27 47 28 CREATE TABLE "routed" ( … … 52 33 ); 53 34 54 REVOKE ALL on "routed" from PUBLIC;55 GRANT ALL on "routed" to "ipdb";56 GRANT SELECT on "routed" to "ipdb";57 58 35 CREATE TABLE "temp" ( 59 36 "ofs" integer 60 37 ); 61 62 REVOKE ALL on "temp" from PUBLIC;63 GRANT ALL on "temp" to "ipdb";64 38 65 39 CREATE TABLE "freeblocks" ( … … 69 43 "routed" character(1) DEFAULT 'n' 70 44 ); 71 72 REVOKE ALL on "freeblocks" from PUBLIC;73 GRANT ALL on "freeblocks" to "ipdb";74 45 75 46 CREATE TABLE "poolips" ( … … 90 61 ); 91 62 92 REVOKE ALL on "poolips" from PUBLIC;93 GRANT ALL on "poolips" to "ipdb";94 95 63 CREATE TABLE "allocations" ( 96 64 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY, … … 109 77 ); 110 78 111 REVOKE ALL on "allocations" from PUBLIC;112 GRANT ALL on "allocations" to "ipdb";113 114 79 CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description, allocations.notes, allocations.oldcustid, allocations.circuitid FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.type, poolips.city, poolips.description, poolips.notes, poolips.oldcustid, poolips.circuitid FROM poolips; 115 116 REVOKE ALL on "searchme" from PUBLIC;117 GRANT ALL on "searchme" to "ipdb";118 80 119 81 CREATE TABLE "alloctypes" ( … … 167 129 \. 168 130 169 REVOKE ALL on "alloctypes" from PUBLIC;170 GRANT ALL on "alloctypes" to "ipdb";171 172 131 CREATE TABLE "cities" ( 173 132 "id" serial NOT NULL PRIMARY KEY, … … 175 134 "routing" character(1) DEFAULT 'n' NOT NULL 176 135 ); 177 178 REVOKE ALL on "cities" from PUBLIC;179 GRANT ALL on "cities" to "ipdb";180 136 181 137 --
Note:
See TracChangeset
for help on using the changeset viewer.