Xzorax
Xzorax

Reputation: 91

postgresql list all table fields information within a server

i'm in need to create VIEWS in postresql 9, to mimic oracle's col table, basically it should display ALL table fields information from ALL table and ALL database on that server.

Can someone please point me a way? thanks.

Upvotes: 0

Views: 1062

Answers (2)

fonini
fonini

Reputation: 3341

I don't think is possible to get metadata information from a different database of that you've working right now. To extract metadata from the current database, take a look here: http://www.alberton.info/postgresql_meta_info.html

Upvotes: 1

user330315
user330315

Reputation:

Unlike Oracle, PostgreSQL implements the ANSI information_schema.

So Oracle's ALL_TAB_COLUMNS view corresponds to information_schema.columns

But this is only restricted to the current database. It is not possible to get this information for all databases - which is the same for Oracle, ALL_TAB_COLUMNS only shows the columns for the current database (=instance)

More details about the information_schema can be found in the manual

http://www.postgresql.org/docs/current/static/information-schema.html

Upvotes: 2

Related Questions