psql -U postgres
CREATE DATABASE my_test_db
\l
\c my_test_db
\d
\c database_name;
ALTER TABLE table_name ADD COLUMN IF NOT EXISTS column_name INTEGER;
ALTER TABLE table_name DROP COLUMN IF EXISTS column_name;
psql -U postgres -d northwind
psql -U postgres
CREATE DATABASE my_test_db
\l
\c my_test_db
\d
\c database_name;
ALTER TABLE table_name ADD COLUMN IF NOT EXISTS column_name INTEGER;
ALTER TABLE table_name DROP COLUMN IF EXISTS column_name;
psql -U postgres -d northwind
You can use the array()
and array_to_string()
functions together with your query.
With SELECT array( SELECT id FROM table ); you will get a result like: {1,2,3,4,5,6}
Then, if you wish to remove the {} signs, you can just use the array_to_string()
function and use comma as separator, so: SELECT array_to_string( array( SELECT id FROM table ), ',' ) will get a result like: 1,2,3,4,5,6
psql -U postgres -c 'show hba_file'
brew services restart postgresql@16
HAProxy
https://www.haproxy.com/documentation/haproxy-runtime-api/reference/set-weight/
http://www.haproxy.org/download/1.4/doc/configuration.txt
Scale
https://www.sql-easy.com/learn/how-to-scale-postgresql/
https://www.timescale.com/learn/guide-to-postgresql-scaling