This video talks about default PostgreSQL database server. Below is the notes used in this recording:
***
Three default databases:
1) Postgres: User database
2) Template0: Template database. but, please don't drop this database
3) Template1: Is modifiable. You can drop this. And copy back from Template0.
a) Database location: $PGDATA/base/
b) Creation of a basic database
create database testdb1;
c) drop template1 database:
UPDATE pg_database SET datistemplate = 'f' WHERE datname = 'template1';
DROP DATABASE template1;
d) recreate template1 database:
CREATE DATABASE template1 TEMPLATE = template0 IS_TEMPLATE = 1;
e) psql -E : To display backend queries of backslash/metadata commands
f) pg_database: metadata table
g) Query to display database information:
SELECT d.datname as "Name",
pg_catalog.pg_get_userbyid(d.datdba) as "Owner",
pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding",
d.datcollate as "Collate",
d.datctype as "Ctype",
pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges"
FROM pg_catalog.pg_database d
ORDER BY 1;
***
Смотрите видео PostgreSQL default and Template databases онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Ravi Nandigam 29 Сентябрь 2019, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,259 раз и оно понравилось 54 людям.