Õzbek Õzbek - 1 year ago 135
SQL Question

how to get column size and type through my database in PostgreSQL

I've changed column length manually in my previous database.

But after creating new database via HQL it's creating

and I need to make it longer.

I need to find which table's column should I change?

I can find it manually but now I have about 200 tables and I need a query to do this.

How can I get the column type and its length in Postgres using a SQL query?

Answer Source

The INFORMATION_SCHEMA tables will help you here:

select *

You can examine the table_name, column_name, data_type and character_maximum_length columns in the result set.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download