mirror of
https://github.com/jbranchaud/til
synced 2026-01-07 00:58:02 +00:00
Add Temporary Tables as a postgres til.
This commit is contained in:
@@ -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)
|
- [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)
|
- [String Contains Another String](postgres/string-contains-another-string.md)
|
||||||
- [Temporarily Disable Triggers](postgres/temporarily-disable-triggers.md)
|
- [Temporarily Disable Triggers](postgres/temporarily-disable-triggers.md)
|
||||||
|
- [Temporary Tables](postgres/temporary-tables.md)
|
||||||
- [Timestamp Functions](postgres/timestamp-functions.md)
|
- [Timestamp Functions](postgres/timestamp-functions.md)
|
||||||
- [Toggling The Pager In PSQL](postgres/toggling-the-pager-in-psql.md)
|
- [Toggling The Pager In PSQL](postgres/toggling-the-pager-in-psql.md)
|
||||||
- [Turning Timing On](postgres/turning-timing-on.md)
|
- [Turning Timing On](postgres/turning-timing-on.md)
|
||||||
|
|||||||
14
postgres/temporary-tables.md
Normal file
14
postgres/temporary-tables.md
Normal file
@@ -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.
|
||||||
Reference in New Issue
Block a user