I am using the postgresql db for openproject. I added two custom column in front end webpage ie. Actual start date and Actual End date . I need to record the start and end of the actual dates for a project. I dont know which table both columns has been created and storing the records. My database is having 110 tables and its really hard for me to search each table one by one. Can you please help and give me a query to find the both columns. Thanks in advance.
i ran the following
This gives you the schema name as well as the table name of a specific column.
select t.table_schema,
t.table_name,
c.column_name from information_schema.tables t inner join information_schema.columns c on c.table_name = t.table_name
and c.table_schema = t.table_schema where c.column_name = 'column_name'
and t.table_schema not in ('information_schema', 'pg_catalog')
and t.table_type = 'BASE TABLE' order by t.table_schema;
Where obviously 'column_name' is the name you have to pass in for a column. I ran the below query.
select t.table_schema,
t.table_name from information_schema.tables t inner join information_schema.columns c on c.table_name = t.table_name
and c.table_schema = t.table_schema where c.column_name = '%actual%start%date%'
and t.table_schema not in ('information_schema', 'pg_catalog')
and t.table_type = 'BASE TABLE' order by t.table_schema;
But i did not get any answer from the Database.
You used a wildcard with an equality (=) operator:
c.column_name = '%actual%start%date%'
Use like instead:
c.column_name like '%actual%start%date%'