chore(postgres): dump acquired knowledge

This commit is contained in:
Michele Cereda
2024-10-04 08:20:06 +02:00
parent 151ff0f0f8
commit c189b20a9e
2 changed files with 11 additions and 0 deletions

View File

@@ -3,6 +3,16 @@
# Start DBs
docker run --rm --name 'postgres' -d -p '5432:5432' -e POSTGRES_PASSWORD='password' 'postgres:14.12'
# Start PgAdmin
# Retain data in a volume between sessions
docker run -d --name 'pgadmin' \
--rm -v 'pgadmin-overrides:/pgadmin4' \
--rm -v 'pgadmin-data:/var/lib/pgadmin' \
-p 8080:80 \
-e 'PGADMIN_DEFAULT_EMAIL=me@company.com' \
-e 'PGADMIN_DEFAULT_PASSWORD=password' \
'dpage/pgadmin4'
# Connect to DBs
psql 'postgres'
psql 'postgres' 'admin'

View File

@@ -302,6 +302,7 @@ CREATE OR REPLACE FUNCTION return_1() RETURNS INTEGER LANGUAGE SQL RETURN 1;
-- Type casting
SELECT pg_typeof(10);
SELECT
CAST ('21' AS INTEGER), 420.69::INTEGER,
CAST('100' AS DOUBLE PRECISION), '100.93'::FLOAT,