1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-07 09:08:01 +00:00

Add Insert Just The Defaults as a postgres til.

This commit is contained in:
jbranchaud
2015-10-23 09:03:53 -05:00
parent 37104b1ef7
commit 169f7f8ab8
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
# Insert Just The Defaults
If you are constructing an `INSERT` statement for a table whose required
columns all have default values, you may just want to use the defaults. In
this situation, you can break away from the standard:
```
> insert into table_name (column1, column2) values (value1, value2);
```
Instead, simply tell Postgres that you want it to use the default values:
```
> insert into table_name default values;
```