generated from admin/template
Добавлена лаба 1 и 2
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
-- docker run --name johtho-tcg-server -e POSTGRES_USER=professor_elm -e POSTGRES_PASSWORD=totodile_secret -e POSTGRES_DB=johtho_db -e POSTGRES_INITDB_ARGS="-k" -p 5433:5432 -d postgres:16
|
||||
|
||||
-- Команды выполняются внутри контейнера (docker exec -it johtho-tcg-server bash):
|
||||
-- echo "\setenv PSQL_PAGER 'less -XS'" > /var/lib/postgresql/.psqlrc
|
||||
-- echo "\set PROMPT1 '%n@%/%R%x%# '" >> /var/lib/postgresql/.psqlrc
|
||||
-- echo "\set PROMPT2 '%n@%/%R%x%# '" >> /var/lib/postgresql/.psqlrc
|
||||
-- echo "\timing on" >> /var/lib/postgresql/.psqlrc
|
||||
-- echo "\set find_starter 'SELECT * FROM starter_set.pokemon_cards WHERE hp >= 45;'" >> /var/lib/postgresql/.psqlrc
|
||||
|
||||
\conninfo
|
||||
SHOW data_checksums;
|
||||
SHOW data_directory;
|
||||
|
||||
CREATE SCHEMA starter_set;
|
||||
|
||||
CREATE TABLE starter_set.pokemon_cards (
|
||||
card_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
name VARCHAR(100) NOT NULL,
|
||||
hp INT NOT NULL,
|
||||
card_number INT NOT NULL,
|
||||
rarity VARCHAR(50)
|
||||
);
|
||||
|
||||
INSERT INTO starter_set.pokemon_cards (name, hp, card_number, rarity) VALUES
|
||||
('Chikorita', 45, 1, 'Common'),
|
||||
('Cyndaquil', 39, 2, 'Common'),
|
||||
('Totodile', 50, 3, 'Common');
|
||||
|
||||
\set find_starter 'SELECT * FROM starter_set.pokemon_cards WHERE hp >= 45;'
|
||||
:find_starter
|
||||
Reference in New Issue
Block a user