Help to find-the-maximum-length-of-field-in-a-particular-column-in-allthe tables

Поиск
Список
Период
Сортировка
От postgann2020 s
Тема Help to find-the-maximum-length-of-field-in-a-particular-column-in-allthe tables
Дата
Msg-id CANynezP9ND2xh4Jn9cToki0RYm8=8PeqLSO_8dv0Lde3Fu9ozQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Help to find-the-maximum-length-of-field-in-a-particular-column-in-allthe tables
Re: Help to find-the-maximum-length-of-field-in-a-particular-column-in-allthe tables
Список pgsql-admin
Hi Team,

Good Evening,

We are trying to syncing the table field size with other db tables filed size.

We have multiple tables in multiple schemas in DB. we are tyring to findout maximum size of each column in table for all tables and for all schemas in DB.

How to find the maximum length of data field in a particular column in a table and for all tables in schema.

Example column names in table: a,b,c,d,e,f,g
Example schema names in DB: A,B,C,D

Expected output:
column_name Max_size_of_column
a 10
b 20

or
column_name, Max_size_of_column, column_table, table_schema
a 10 Table1 Schema1
b 20 Table1 Schema1

I have tried below query, but not able to get desired output.

SELECT (select column_name from INFORMATION_SCHEMA.COLUMNS where table_name='building'), select max(length(select column_name from INFORMATION_SCHEMA.COLUMNS where table_name='building')) from from INFORMATION_SCHEMA.COLUMNS where table_name='building'
group by column_name;

Please help us to get the desired output.

Below is the reference i have used for above one. https://stackoverflow.com/questions/43123311/how-to-find-the-maximum-length-of-data-in-a-particular-field-in-postgresql

Regards,
Postgann.  

В списке pgsql-admin по дате отправления:

Предыдущее
От: Ashutosh Sharma
Дата:
Сообщение: Re: PG query to count all objects
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Help to find-the-maximum-length-of-field-in-a-particular-column-in-allthe tables