开发者

Process through all the tables in postgresql stored procedures

I need to loop through all the table in a database in postgresql. i开发者_如何学Gos there a similar stored procedure like mssql sp_msforeachtable for postgresql?


I usually use this query against information_schema.tables:

SELECT table_name
FROM information_schema.tables
WHERE table_type   = 'BASE TABLE'
  AND table_schema = 'public'
ORDER BY table_name

You might want to adjust the table_schema to suit your needs though. This query should (AFAIK) work in any database that follows the standard.


Look in the information schema: information_schema.tables.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜