manniwood.com
Home
Browse
A PostgreSQL function to return the extension of a filename
Advisory Locks in PostgreSQL
Arrays and the PostgreSQL Query Planner
Best way to execute sql scripts using psql
Calculate the database cache hit ratio:
Cancel a user's query based on procpid from pg_stat_activity
Create a new database
Create a user who can, in turn, create databases and other users
Deadlock detection in PostgreSQL and MySQL
Diffing Tables in PostgreSQL
Easier Go slice SQL parameter using ANY and array type
Expand yet keep performance
Find all tables with a certain column name
Find first/last day of month given any date
Find live vs. dead tuples of a table
Find out how many pages and tuples are used by a table
Find out when a table was last analyzed or vacuumed
Find schemas associated with a particular user
Find the number of connections to your database
Find the size of a table
Force use of indexes by query planner
Get IO stats for a particular table
Get a partial database dump that can be restored to a different user
Get row number in select result
Get sizes of objects using built-in functions
Get table row counts quickly
Get the columns that an index operates on
Get the size of a database
Hidden columns in PostgreSQL tables
How to change the default unix socket location from /tmp for PostgreSQL
How to clear your screen in a psql session:
How to copy a table from one database to another
How to drop all of a table's indices
How to dump only particular tables from particular schemas
How to get a one row select into bash variables named for each column in the row
How to get a single scalar select value into a shell variable
How to list all of a table's indices
How to make an hours of week dimension table
How to restore a dump flexibly
How to restore only some items from a dump file
How to use bash to do a job in chunks using a control table
ISO-8601 Format for PostgreSQL
Initialise a new database cluster
Kill a user's session based on procpid from pg_stat_activity
List tables that will be autovacuumed next
Log long-running statements in PostgreSQL
Logging from pgx
Lookup tables / value tables
Make running lots of multi-line sql statements prettier
Multiline psql copy command
Neat way to get the last day of the month in PostgreSQL
PostgreSQL 10.0 Compile/Install HOWTO
PostgreSQL 11.2 Compile/Install HOWTO
PostgreSQL 12.3 Compile/Install HOWTO
PostgreSQL 13.3 Compile/Install HOWTO
PostgreSQL 14.0 Compile/Install HOWTO
PostgreSQL 15.0 Compile/Install HOWTO
PostgreSQL 16.1 Compile/Install HOWTO
PostgreSQL 9.3 Compile/Install HOWTO
PostgreSQL 9.4 Compile/Install HOWTO
PostgreSQL 9.4 Replication HOWTO
PostgreSQL 9.4 in RAM HOWTO
PostgreSQL 9.5 Compile/Install HOWTO
PostgreSQL 9.6.3 Compile/Install HOWTO
PostgreSQL Durability Test
PostgreSQL Monitoring Scripts
PostgreSQL Vacuum Test
PostgreSQL startup script for /etc/init.d
Re-create build index SQL
Read PostgreSQL Table Files with Go
Read activity stats for a particular table
Read enhanced activity stats for a particular table
Recommended .psqlrc
Regexp to get file extension
Reusing SQL Prepared Statements in Go
Run a bunch of sql commands in a single transaction.
SQL values as in-query tables
Set a sequence to the max value of a table column
Set extra_float_digits before using copy
Set up Linux kernel parameters for PostgreSQL
Set up automatic updating of tables with updated columns
Set work_mem higher for this session.
Shell script to dump contents of bytea column to a file
Show blocked locks in PostgreSQL
Show page cache hits (and misses) in query explain plan
Show which tables are closest to transaction id wraparound
Test Data
Typical changes to postgresql.conf for large database installations
Using the PG* environmental variables to make your shell scripts more terse.
copy a database
fizzbuzz in PostgreSQL
maintenence_work_mem to help vacuuming
tcpdump PostgreSQL