Print postgres version on start in a single-session mode

This commit is contained in:
Dan Sosedoff
2017-09-13 23:42:44 -05:00
parent 7832b5b8b8
commit af7e504e4f
2 changed files with 8 additions and 0 deletions

View File

@@ -79,6 +79,10 @@ func initClient() {
exitWithMessage(err.Error())
}
if !command.Opts.Sessions {
fmt.Printf("Server runs PostgreSQL v%s\n", cl.ServerVersion())
}
fmt.Println("Checking database objects...")
_, err = cl.Objects()
if err != nil {

View File

@@ -260,6 +260,10 @@ func (client *Client) SetReadOnlyMode() error {
return nil
}
func (client *Client) ServerVersion() string {
return client.serverVersion
}
func (client *Client) query(query string, args ...interface{}) (*Result, error) {
// We're going to force-set transaction mode on every query.
// This is needed so that default mode could not be changed by user.