postgres
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン | |||
| postgres [2020/01/16 02:40] – nullpon | postgres [2020/01/16 02:45] (現在) – nullpon | ||
|---|---|---|---|
| 行 80: | 行 80: | ||
| </ | </ | ||
| - | ===== Postgres特有の機能 | + | ===== lastval |
| - | ==== lastval ==== | + | mysqlのlast_insert_idに相当 |
| - | + | ||
| - | mysqlのlast_insert_idに当たるやつ | + | |
| < | < | ||
| 行 90: | 行 88: | ||
| </ | </ | ||
| - | ==== truncate ==== | + | ===== truncate |
| - | truncateもトランザクション内で実行される | + | truncateがトランザクション内で実行される。 |
| <code sql> | <code sql> | ||
| 行 107: | 行 105: | ||
| 100 | 100 | ||
| </ | </ | ||
| + | |||
| + | `delete from xxx;` の代わりに有り難く利用しよう。deleteの場合、データ領域を解放しないが、truncateは解放するので削除後にvacuumする必要がなくなる。 | ||
| ===== copy ===== | ===== copy ===== | ||
postgres.1579142435.txt.gz · 最終更新: by nullpon