Skip to content

Instantly share code, notes, and snippets.

@cubespace
Forked from igorpronin/postgresql
Created May 30, 2017 08:57
Show Gist options
  • Save cubespace/f46c19f8c75d511a8dabc140e552de5b to your computer and use it in GitHub Desktop.
Save cubespace/f46c19f8c75d511a8dabc140e552de5b to your computer and use it in GitHub Desktop.
Вывести имена колонок и тип данных для определенной таблицы
-- 1
select column_name, data_type
from information_schema.columns
where table_name = 'users';
-- 2
SELECT
column_name, data_type, character_maximum_length
FROM
information_schema.COLUMNS
WHERE
TABLE_NAME = 'sales_funnel';
-- 3
SELECT
*
FROM
information_schema.COLUMNS
WHERE
TABLE_NAME = 'sales_funnel';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment