Update 05.4.md

typographical errors and improved readability
This commit is contained in:
Jimmy99
2016-04-06 08:10:47 +02:00
committed by James Miranda
parent 63593a3364
commit 0d74277d0e

View File

@@ -1,6 +1,6 @@
# 5.4 PostgreSQL
PostgreSQL is an object-relational database management system available for many platforms including Linux, FreeBSD, Solaris, Microsoft Windows and Mac OS X. It is released under an MIT-style license, and is thus free and open source software. It's larger than MySQL because it's designed for enterprise usage like Oracle. Postgresql is good choice for enterprise type projects.
PostgreSQL is an object-relational database management system available for many platforms including Linux, FreeBSD, Solaris, Microsoft Windows and Mac OS X. It is released under an MIT-style license, and is thus free and open source software. It's larger than MySQL because it's designed for enterprise usage as an alternative to Oracle. Postgresql is a good choice for enterprise type projects.
## PostgreSQL drivers
@@ -10,7 +10,7 @@ There are many database drivers available for PostgreSQL. Here are three example
- [https://github.com/jbarham/gopgsqldriver](https://github.com/jbarham/gopgsqldriver) supports `database/sql`, written in pure Go.
- [https://github.com/lxn/go-pgsql](https://github.com/lxn/go-pgsql) supports `database/sql`, written in pure Go.
I'll use the first one in my following examples.
I will use the first one in the examples that follow.
## Samples
@@ -104,7 +104,7 @@ An example:
}
Note that PostgreSQL uses the `$1, $2` format instead of the `?` that MySQL uses, and it has a different DSN format in `sql.Open`.
Another thing is that the Postgres driver does not support `sql.Result.LastInsertId()`.
Another thing is that the PostgreSQL driver does not support `sql.Result.LastInsertId()`.
So instead of this,
stmt, err := db.Prepare("INSERT INTO userinfo(username,departname,created) VALUES($1,$2,$3);")