/*==============================================================*/
/* DBMS name: PostgreSQL 8 */
/* Created on: 2008-1-18 21:38:04 */
/*==============================================================*/
drop table T_MENU;drop table T_ROLE;drop table T_ROLEMENU;drop table T_USER;drop table T_USERROLE;/*==============================================================*/
/* Table: T_MENU */
/*==============================================================*/
create table T_MENU (
id number(2) not null,
menu_id number(2) null,
menu_name varchar(10) null,
menu_link varchar(200) null,
constraint PK_T_MENU primary key (id)
);/*==============================================================*/
/* Table: T_ROLE */
/*==============================================================*/
create table T_ROLE (
id number(2) not null,
role_id number(2) null,
role_name varchar(10) null,
constraint PK_T_ROLE primary key (id)
);/*==============================================================*/
/* Table: T_ROLEMENU */
/*==============================================================*/
create table T_ROLEMENU (
T_M_id number(2) null,
id number(2) null
);/*==============================================================*/
/* Table: T_USER */
/*==============================================================*/
create table T_USER (
id number(4) not null,
user_id number(4) null,
user_password VARCHAR(8) null,
user_role number(2) null,
user_gender VARCHAR(1) null,
user_email varchar(20) null,
constraint PK_T_USER primary key (id)
);/*==============================================================*/
/* Table: T_USERROLE */
/*==============================================================*/
create table T_USERROLE (
id number(4) null,
T_R_id number(2) null
);alter table T_ROLEMENU
add constraint FK_TABLE_5_REFE foreign key (T_M_id)
references T_MENU (id)
on delete restrict on update restrict;alter table T_ROLEMENU
add constraint FK_TABLE_5_REF2 foreign key (id)
references T_ROLE (id)
on delete restrict on update restrict;alter table T_USERROLE
add constraint FK_T_USERRO_REF foreign key (id)
references T_USER (id)
on delete restrict on update restrict;alter table T_USERROLE
add constraint FK_T_USERRO_RE2 foreign key (T_R_id)
references T_ROLE (id)
on delete restrict on update restrict;
上边是用powerdesginer生成的sql语句
我将他导入postgresql出现了错误
说ERROR: syntax error at or near "("
SQL 状态: 42601
字符:632不知道是哪出了毛病!请高手请教
/* DBMS name: PostgreSQL 8 */
/* Created on: 2008-1-18 21:38:04 */
/*==============================================================*/
drop table T_MENU;drop table T_ROLE;drop table T_ROLEMENU;drop table T_USER;drop table T_USERROLE;/*==============================================================*/
/* Table: T_MENU */
/*==============================================================*/
create table T_MENU (
id number(2) not null,
menu_id number(2) null,
menu_name varchar(10) null,
menu_link varchar(200) null,
constraint PK_T_MENU primary key (id)
);/*==============================================================*/
/* Table: T_ROLE */
/*==============================================================*/
create table T_ROLE (
id number(2) not null,
role_id number(2) null,
role_name varchar(10) null,
constraint PK_T_ROLE primary key (id)
);/*==============================================================*/
/* Table: T_ROLEMENU */
/*==============================================================*/
create table T_ROLEMENU (
T_M_id number(2) null,
id number(2) null
);/*==============================================================*/
/* Table: T_USER */
/*==============================================================*/
create table T_USER (
id number(4) not null,
user_id number(4) null,
user_password VARCHAR(8) null,
user_role number(2) null,
user_gender VARCHAR(1) null,
user_email varchar(20) null,
constraint PK_T_USER primary key (id)
);/*==============================================================*/
/* Table: T_USERROLE */
/*==============================================================*/
create table T_USERROLE (
id number(4) null,
T_R_id number(2) null
);alter table T_ROLEMENU
add constraint FK_TABLE_5_REFE foreign key (T_M_id)
references T_MENU (id)
on delete restrict on update restrict;alter table T_ROLEMENU
add constraint FK_TABLE_5_REF2 foreign key (id)
references T_ROLE (id)
on delete restrict on update restrict;alter table T_USERROLE
add constraint FK_T_USERRO_REF foreign key (id)
references T_USER (id)
on delete restrict on update restrict;alter table T_USERROLE
add constraint FK_T_USERRO_RE2 foreign key (T_R_id)
references T_ROLE (id)
on delete restrict on update restrict;
上边是用powerdesginer生成的sql语句
我将他导入postgresql出现了错误
说ERROR: syntax error at or near "("
SQL 状态: 42601
字符:632不知道是哪出了毛病!请高手请教
解决方案 »
- 怎么在存储过程(触发器)中抛出异常
- mysql中没有设置innodb_data_file_path怎么办?
- 查询有多个商品订单的语句
- 数据日期比较 急。
- MySql中如何查询多个具有相同前缀名的表?在线等高人讲解
- 在mysql5的存储过程里,当有错误发生时,如何获得错误号是多少?
- MySQL远程访问速度为什么慢(使用MyODBC)?
- 我想把表里的自增字段按照另一字段的排序进行重构,有办法吗?
- 为什么直接在别的机器上拷过来的MYSQL(约60M)在我WIN2000上不能用,非要安装吗?请高手路过指点!
- MySQL/Postgresql 有没有c语言的api接口?
- 请问postgresql-8.0.1只能安装在ntfs格式下吗?
- 关于字段复制的问题
:)
想问下一般用户的id用什么属性比较好!(指的是在postgresql里)