Merge branch 'master' of github.com:go-xorm/xorm

This commit is contained in:
Lunny Xiao 2015-12-02 17:15:08 +08:00
commit 829677bc38
1 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ func parseURL(connstr string) (string, error) {
return "", err
}
if u.Scheme != "postgres" {
if u.Scheme != "postgresql" && u.Scheme != "postgres" {
return "", fmt.Errorf("invalid connection protocol: %s", u.Scheme)
}
@ -103,7 +103,7 @@ func (p *pqDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) {
db := &core.Uri{DbType: core.POSTGRES}
o := make(values)
var err error
if strings.HasPrefix(dataSourceName, "postgres://") {
if strings.HasPrefix(dataSourceName, "postgresql://") || strings.HasPrefix(dataSourceName, "postgres://") {
dataSourceName, err = parseURL(dataSourceName)
if err != nil {
return nil, err