之前 個Website down 之後發現原來係 PostgresSQL connection 爆左.. 所以個server 唔可以再make connection… 想知道個SQL D connection 用左幾多… Stackoverflow 完之後搵到一個 PSQL 既 query, 可以用黎 check 下用緊幾多connection 同仲有幾多connection remain https://dba.stackexchange.com/questions/161760/number-of-active-connections-and-remaining-connections 解決方法: select max_conn,used,res_for_super,max_conn-used-res_for_super res_for_normal from (select count(*) used from pg_stat_activity) t1, (select setting::int res_for_super from pg_settings where name=$$superuser_reserved_connections$$) t2, (select setting::int max_conn from pg_settings where name=$$max_connections$$) t3 hope you find it useful
有時候個SQL script 太大.. 如果用 SQL editor 去 run 個 .sql file 好大機會 會crash 我地可以用 command 來 execute 呢個 .sql 我就用呢個方法去Restore database backup 解決方法: psql -h [`hostname`] -U [`username`] -d [`database_name`] -f [`sql_script.sql`] psql -h localhost -U postgres -d local-db -f dump-local-db-20220701150001.sql hope you find it useful
如果想幫 PostgresSQL 做個database backup 之後係 SQL Editor 上..load 返呢個 SQL backup file 我地可以用 pg_dump 去backup 個 database 用佢個 insert statement option 便可 解決方法: pg_dump --verbose --host=[`hostname`] --port=[`port`] --username=[`username`] --format=p --encoding=UTF-8 --inserts --no-owner --file [`filename`].sql -n "public" [`database_name`] pg_dump --verbose --host=localhost --port=5432 --username=postgres --format=p --encoding=UTF-8 --inserts --no-owner --file dump-local-db-$(date '+%Y%m%d%H%M%S').sql -n "public" local-db hope you find it useful
如何在 postgresql 上rebuild database index REINDEX DATABASE "database-name"; Hope you find it useful
轉左用 NodeJs 之後就發現 Entity Framework 有多好 之前用 EF 很方便便可以知道 EF Generate 果條 係Prisma 度點先可以Log 到條query 呢? 解決方便 我們只需要在declare Prisma Client 時加上 log query 這個 parameter 便可: const prisma = new PrismaClient({ log: ['query'] }); Hope you find it useful
Solved You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1)
This post show you how to download Google 粵語輸入法 - Google Cantonese Input
Create React Native App without Expo
azure flexible server create database via cli
Share where you can check Microsoft Azure Sponsorships balance and usage