From 3dab4abe95b39a11c9055548916f4614354680fd Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sun, 28 Jun 2015 21:28:34 -0500 Subject: [PATCH] Add Temporary Tables as a postgres til. --- README.md | 1 + postgres/temporary-tables.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 postgres/temporary-tables.md diff --git a/README.md b/README.md index 0914ba4..a100f46 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [List All Columns Of A Specific Type](postgres/list-all-columns-of-a-specific-type.md) - [String Contains Another String](postgres/string-contains-another-string.md) - [Temporarily Disable Triggers](postgres/temporarily-disable-triggers.md) +- [Temporary Tables](postgres/temporary-tables.md) - [Timestamp Functions](postgres/timestamp-functions.md) - [Toggling The Pager In PSQL](postgres/toggling-the-pager-in-psql.md) - [Turning Timing On](postgres/turning-timing-on.md) diff --git a/postgres/temporary-tables.md b/postgres/temporary-tables.md new file mode 100644 index 0000000..9ca304d --- /dev/null +++ b/postgres/temporary-tables.md @@ -0,0 +1,14 @@ +# Temporary Tables + +Create a temporary table in Postgres like so + +```sql +create temp table posts ( + ... +); +``` + +This table (and its data) will only last for the duration of the session. +It is created on a schema specific to temporary tables. It is also worth +noting that it won't be autovacuumed, so this must be done manually as +necessary.