Write data into a PostgreSQL COPY WITH BINARY
format, somewhat faster way to insert a lot of entries into database
that plain text or CSV.
| | PostgreSQL type | Rust equivalent
|---|--------------------------|-----------------
| ✔ | smallint | i16
| ✔ | integer | i32
| ✔ | bigint | i64
| | decimal |
| | numeric |
| ✔ | real | f32
| ✔ | double | f64
| ✔ | char | char
| ✔ | char varying | &str
| ✔ | text | &str
| ✔ | bytea | &[u8]
| ✔ | timestamp | chrono::naive::NaiveDateTime
| ✔ | timestamp with time zone | chrono::DateTime
| ✔ | date | chrono::Date or chrono::naive::NaiveDate
| ✔ | time | chrono::naive::NaiveTime
| | interval |
| ✔ | boolean | bool
| | cidr |
| | inet |
| | macaddr |
| | macaddr8 |
| ✔ | uuid | uuid::Uuid
| | xml |
| | json |
| | jsonb |
| | array |