E
E
Eserchik2017-06-15 15:38:50
PostgreSQL
Eserchik, 2017-06-15 15:38:50

How to get a list of columns from a table of type Date?

Hello. Please help. DB Postgrees The
task is to display the names of columns with the Date type from the table (not data, but columns).
Ie to find all columns in the table having type Date.
Column names cannot be specified.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
V Sh., 2017-06-15
@Eserchik

Well, write a query to the system table, which stores information about all columns of all database tables. In ORACLE it is, if my memory serves me, ALL_TAB_COLUMNS. What is it called in POSTGRES Google will help you.

E
Eserchik, 2017-06-15
@Eserchik

Thanks)
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'tablename'
ORDER BY ordinal_position;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question