Home > Database > Mysql Tutorial > body text

PostgreSQL 列所有表结构的查询语句

WBOY
Release: 2016-06-07 17:26:58
Original
1133 people have browsed it

PostgreSQL 列所有表结构的查询语句 SELECT tablename FROM pg_tables WHERE tablename NOT LIKE

PostgreSQL 列所有表结构的查询语句

SELECT  tablename  FROM  pg_tables 
WHERE  tablename  NOT  LIKE  'pg%' 
AND tablename NOT LIKE 'sql_%'
ORDER  BY  tablename;

查询表t_appointment_apply表的字段信息
SELECT a.attnum,a.attname AS field,t.typname AS type,a.attlen AS length,a
.atttypmod AS lengthvar,a.attnotnull AS notnull from pg_class c,pg_attribute a,pg_type t where c.relname='t_appointment_apply' and a.attnum>0 and a.attrelid=c.oid and a.atttypid=t.oid

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!