作者 主題: 建立postfix.sql檔時出錯,請大家熱情幫助!  (閱讀 2948 次)

0 會員 與 1 訪客 正在閱讀本文。

fandy

  • 懷疑的國中生
  • **
  • 文章數: 75
    • 檢視個人資料
我在建立資料庫時出現錯誤,請大家支援一下:

我的postfix.sql檔內容以下:

CREATE TABLE "admin" (
"username" character varying(255) NOT NULL default '',
"password" character varying(255) NOT NULL default '',
"created" timestamp with time zone default now(),
"modified" timestamp with time zone default now(),
"active" boolean NOT NULL default true,
Constraint "admin_key" Primary Key ("username")
);
COMMENT ON TABLE admin IS 'Postfix Admin - Virtual Admins';

CREATE TABLE alias (
address character varying(255) NOT NULL default '',
goto text NOT NULL,
domain character varying(255) NOT NULL default '',
created timestamp with time zone default now(),
modified timestamp with time zone default now(),
active boolean NOT NULL default true,
-- PRIMARY KEY ("address"),
-- KEY address ("address"),
Constraint "alias_key" Primary Key ("address")
);
COMMENT ON TABLE alias IS 'Postfix Admin - Virtual Aliases';

CREATE TABLE domain (
domain character varying(255) NOT NULL default '',
description character varying(255) NOT NULL default '',
aliases integer NOT NULL default 0,
mailboxes integer NOT NULL default 0,
maxquota integer NOT NULL default 0,
transport character varying(255) default NULL,
backupmx boolean NOT NULL default false,
created timestamp with time zone default now(),
modified timestamp with time zone default now(),
active boolean NOT NULL default true,
-- PRIMARY KEY ("domain"),
-- KEY domain ("domain"),
Constraint "domain_key" Primary Key ("domain")
);
COMMENT ON TABLE domain IS 'Postfix Admin - Virtual Domains';

CREATE TABLE domain_admins (
username character varying(255) NOT NULL default '',
domain character varying(255) NOT NULL default '',
created timestamp with time zone default now(),
active boolean NOT NULL default true
-- KEY username ("username")
);
COMMENT ON TABLE domain_admins IS 'Postfix Admin - Domain Admins';

CREATE TABLE log (
timestamp timestamp with time zone default now(),
username character varying(255) NOT NULL default '',
domain character varying(255) NOT NULL default '',
action character varying(255) NOT NULL default '',
data character varying(255) NOT NULL default ''
-- KEY timestamp ("timestamp")
);
COMMENT ON TABLE log IS 'Postfix Admin - Log';

CREATE TABLE mailbox (
username character varying(255) NOT NULL default '',
password character varying(255) NOT NULL default '',
name character varying(255) NOT NULL default '',
maildir character varying(255) NOT NULL default '',
quota integer NOT NULL default 0,
domain character varying(255) NOT NULL default '',
created timestamp with time zone default now(),
modified timestamp with time zone default now(),
active boolean NOT NULL default true,
-- PRIMARY KEY ("username"),
-- KEY username ("username"),
Constraint "mailbox_key" Primary Key ("username")
);
COMMENT ON TABLE mailbox IS 'Postfix Admin - Virtual Mailboxes';

CREATE TABLE vacation (
email character varying(255) NOT NULL default '',
subject character varying(255) NOT NULL default '',
body text NOT NULL,
cache text NOT NULL,
domain character varying(255) NOT NULL default '',
created timestamp with time zone default now(),
active boolean NOT NULL default true,
-- PRIMARY KEY ("email"),
-- KEY email ("email")
Constraint "vacation_key" Primary Key ("email")
);
COMMENT ON TABLE vacation IS 'Postfix Admin - Virtual Vacation';

GRANT SELECT,INSERT,UPDATE,DELETE ON admin,alias,domain,domain_admins,log,mailbox,vacation TO postfixadmin_user;

以下為我的建立過程:

$ createuser –P postfix
$ createuser –P postfixadmin
$ createdb postfix
$ psql -U postfix -f \postfix.sql postfix
psql:postfix.sql:8: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit ind ex "admin_key" for table "admin"
CREATE TABLE
COMMENT
psql:postfix.sql:21: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit in dex "alias_key" for table "alias"
CREATE TABLE
COMMENT
psql:postfix.sql:38: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit in dex "domain_key" for table "domain"
CREATE TABLE
COMMENT
CREATE TABLE
COMMENT
CREATE TABLE
COMMENT
psql:postfix.sql:73: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit in dex "mailbox_key" for table "mailbox"
CREATE TABLE
COMMENT
psql:postfix.sql:87: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit in dex "vacation_key" for table "vacation"
CREATE TABLE
COMMENT
psql:postfix.sql:90: ERROR: role "postfixadmin_user" does not exist
[postgres@mail /]$

不知道是什麼原因啦!希望各位大俠可以幫助一下小弟,多謝先!

elleryq

  • 鑽研的研究生
  • *****
  • 文章數: 908
  • 性別: 男
    • 檢視個人資料
    • Thinking more...
建立postfix.sql檔時出錯,請大家熱情幫助!
« 回覆 #1 於: 2005-12-20 20:15 »
看起來是因為沒有這個 user: postfixadmin_user
Plan your work, then work your plan.
我的首頁:http://blog.elleryq.idv.tw
351899by http://counter.li.org