表名字  test
ID bigserial PRIMARY KEY 标识
Account Varchar(50) not null 用户帐号
AddTime timestamp not null default localtimestamp 加入时间
Comment Text 注释
AreaCode Varchar(10) 地区编码这个是文档里面的。但是里面没数据,我web部分不太好做。我手动老是插不进去。 谁可以帮我写个sql啊,随便插一条数据就行。

解决方案 »

  1.   

    insert into test values (标识,用户帐号,加入时间,注释,地区编码)
      

  2.   

    给你一个完整的示例吧:
    iihero=# create table t2(id bigserial primary key, account varchar(50) not null,
    iihero(# addtime timestamp not null default localtimestamp, comment text, areacode varchar(10));
    NOTICE:  CREATE TABLE will create implicit sequence "t2_id_seq" for serial column "t2.id"
    NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t2_pkey" for table "t2"
    CREATE TABLE
    iihero=# select * from t2;
     id | account | addtime | comment | areacode
    ----+---------+---------+---------+----------
    (0 rows)
    iihero=# insert into t2(account, comment, areacode) values('iihero', 'sample', '100038');
    INSERT 0 1
    iihero=# select * from t2;
     id | account |         addtime         | comment | areacode
    ----+---------+-------------------------+---------+----------
      1 | iihero  | 2010-05-07 19:17:27.234 | sample  | 100038
    (1 row)
    iihero=#