Postgres

1) docker run —name postgresql -e POSTGRESQL_USERNAME=my_user -e POSTGRESQL_PASSWORD=password123 -e POSTGRESQL_DATABASE=my_database bitnami/postgresql:latest

2) docker exec -ti postgresql bash
3) psql -d my_database -U my_user -W password123
4)

CREATE TABLE playground (
equip_id serial PRIMARY KEY,
type varchar (50) NOT NULL,
color varchar (25) NOT NULL,
location varchar(25) check (location in ('north', 'south', 'west', 'east', 'northeast', 'southeast', 'southwest', 'northwest')),
install_date date
);

INSERT INTO playground (type, color, location, install_date) VALUES ('slide', 'blue', 'south', '2014-04-28');
INSERT INTO playground (type, color, location, install_date) VALUES ('swing', 'yellow', 'northwest', '2010-08-16');

SELECT * FROM playground;

BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ;
show transaction isolation level;
..
update playground set location='south123' where equip_id=1;
delete from playground where equip_id=2;
COMMIT;

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04
https://www.postgresql.org/docs/9.5/transaction-iso.html

docker run —name mysql -e ALLOW_EMPTY_PASSWORD=yes -e MYSQL_USER=my_user -e MYSQL_PASSWORD=my_password -e MYSQL_DATABASE=my_database bitnami/mysql:latest
mysql -u my_user -p my_database

SELECT @@TX_ISOLATION;
SHOW VARIABLES LIKE 'tx_isolation';
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
START TRANSACTION;
..
COMMIT;

https://stackoverflow.com/questions/41825832/mysql-how-to-find-out-isolation-level-for-the-transactions

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License