David Coelho
David Coelho

Reputation: 153

Export DESCRIBE TABLE Postgres to .txt file with PHP

Is it possible to generate a .txt file with the DESCRIBE TABLE from a table in Postgres by PHP? I need to download a .txt file with the description of the fields (name, type, character size) of the table where the query is being made.

Upvotes: 0

Views: 424

Answers (1)

Vao Tsun
Vao Tsun

Reputation: 51609

run smth like:

select * from information_schema.columns where table_name ='s100';

it will definetely give you info on (name, type, character size)

And if you want smth more wide, like oracles DESC, run psql -E in terminal and then \d+ your_table to see queries you need to use to get additional info

Upvotes: 2

Related Questions