Skip to content

Instantly share code, notes, and snippets.

@artemrogov
Created July 5, 2019 17:21
Show Gist options
  • Save artemrogov/c529f9b73aba43d3c1817799d3a28af2 to your computer and use it in GitHub Desktop.
Save artemrogov/c529f9b73aba43d3c1817799d3a28af2 to your computer and use it in GitHub Desktop.
команды СУБД PostgreSQL
#просмотр таблиц схемы:
select table_name FROM information_schema.tables WHERE table_schema NOT IN('inforamtion_schema','pg_catalog') AND table_schema IN('public','<имя_схемы>');
#список схемы БД:
\dn
#список ролей БД
\du
#Список БД
\l+
#Структура таблицы БД (схемы)
\d <name_schema.table_name>
----------------------------------------------------------------------------------------------------------------------------
#Дамп и восстановление БД:
#установка чистого дампа без данных:
psql dwh < имя_файла_с_дампом
#Установить ЯП для хранимых процедур(python):
createlang plpythonu <db_name>
#Инструкции по установке расширений для PostgreSQL:
1)Установка POSTGIS:
https://www.gis-blog.com/how-to-install-postgis-2-3-on-ubuntu-16-04-lts/
2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment