---
title: "PostgreSQL View Table Info"
author: "wwbutton"
date: "2008-08-07T10:34:59Z"
tags: []
slug: "postgresql-view-table-info"
draft: false
lastmod: "2008-08-07T10:34:59Z"
id: 225316
url: "https://button.iteye.com/blog/225316"
---

SELECT * FROM pg_attribute WHERE attrelid = ‘tablename’::regclass;
–只查看字段名
SELECT attname FROM pg_attribute WHERE attrelid = ‘tablename’::regclass;