\connect - postgres CREATE SEQUENCE "uid_seq" start 1000 increment 1 maxvalue 2147483647 minvalue 1000 cache 1 ; CREATE TABLE "a_passwd" ( "username" text NOT NULL, "passwd" character DEFAULT 'x', "uid" int4 DEFAULT nextval('uid_seq'), "gid" int4, "gecos" text, "homedir" text, "shell" text, PRIMARY KEY ("username") ); REVOKE ALL on "a_passwd" from PUBLIC; GRANT SELECT on "a_passwd" to "shlookup"; GRANT SELECT on "a_passwd" to "pwlookup"; CREATE TABLE "a_shadow" ( "username" text NOT NULL, "passwd" text, "lastchange" int4, "min" int4 DEFAULT -1, "max" int4 DEFAULT -1, "warn" int4 DEFAULT -1, "inact" int4 DEFAULT -1, "expire" int4 DEFAULT -1, "flag" int4 DEFAULT -1, PRIMARY KEY ("username") ); REVOKE ALL on "a_shadow" from PUBLIC; GRANT SELECT on "a_shadow" to "shlookup"; CREATE SEQUENCE "gid_seq" start 1000 increment 1 maxvalue 2147483647 minvalue 1000 cache 1 ; CREATE TABLE "a_group" ( "groupname" text NOT NULL, "passwd" text, "gid" int4 DEFAULT nextval('gid_seq'), "members" text, PRIMARY KEY ("groupname") ); REVOKE ALL on "a_group" from PUBLIC; GRANT SELECT on "a_group" to "shlookup"; GRANT SELECT on "a_group" to "pwlookup"; CREATE UNIQUE INDEX "users_uid_key" on "users" using btree ( "uid" "int4_ops" ); CREATE UNIQUE INDEX "group_gid_key" on "group" using btree ( "gid" "int4_ops" );