Postgres
Exclude Table Data from …
There are many reasons why you may want to exclude table data from specific tables during a pg_dump. Tables might contain sensitive data (umm encryption!!), table size, unnecessary for things like local development, etc. If you want to export a database include all table schemas and some, but not …
Reorder Columns in …
Sometimes you need to reorder columns in your database to align with other data models, to show relevant data first, to satisfy your O.C.D (✋ that’s me). If you’re using PostgreSQL for your relational database (really any SQL database) and you already have data in your database, here are …
Change a Column Type in …
When designing a database sometimes we get it wrong, here is the command you can use to change a column type for an existing table: ALTER TABLE <table name> ALTER COLUMN <column name> TYPE <new column type> USING <column name>::<column type> Example Use: ALTER TABLE …