DbPgsql.class.php 写法有误

浏览:105 发布日期:2010/09/03
- 普通 - 未处理
在code.google.com上找到了这个类,但是只能读取信息列表,但是无法创建数据经查验,下列代码未返回结果造成,疑为SQL错误,初识Pgsql,不知怎办,求教各位,谢谢!

$result = $model->query("select a.attname as \"Field\",
t.typname as \"Type\",
a.attnotnull as \"Null\",
i.indisprimary as \"Key\",
d.adsrc as \"Default\"
from pg_class c
inner join pg_attribute a on a.attrelid = c.oid
inner join pg_type t on a.atttypid = t.oid
left join pg_attrdef d on a.attrelid=d.adrelid and d.adnum=a.attnum
left join pg_index i on a.attnum=ANY(i.indkey) and c.oid = i.indrelid
where (c.relname='{$tablename}' or c.relname = lower('{$tablename}')) AND a.attnum > 0
order by a.attnum asc;");
评论(
后面还有条评论,点击查看>>