func Invalid(msg string, args ...interface{}) Err {
	msg = fmt.Sprintf("invalid "+msg, args...)
	return &err{M: msg, C: "42000", P: -1}
}
Invalid indicates that the user request is invalid or otherwise incorrect.
It's very much similar to a syntax error, except that the invalidity is
logical within the request rather than syntactic. For example, using a non-
boolean expression in WHERE, or when a requested data type, table, or
function is undefined.
package pgsrv
import (
	"fmt"
)
const fatalSeverity = "FATAL"
type Err error
type err struct {
	S string  
	C string  
	M string  
	D string  
	H string  
	P int     
}
func (e *err) Severity() string { return e.S }
func (e *err) Code() string     { return e.C }
func (e *err) Error() string    { return e.M }
func (e *err) Detail() string   { return e.D }
func (e *err) Hint() string     { return e.H }
func (e *err) Position() int    { return e.P }
func WithSeverity(err error, severity string) Err {
	if err == nil {
		return nil
	}
	e := fromErr(err)
	e.S = severity
	return e
}
func WithDetail(err error, detail string, args ...interface{}) Err {
	if err == nil {
		return nil
	}
	e := fromErr(err)
	e.D = fmt.Sprintf(detail, args...)
	return e
}
func WithHint(err error, hint string, args ...interface{}) Err {
	if err == nil {
		return nil
	}
	e := fromErr(err)
	e.H = fmt.Sprintf(hint, args...)
	return e
}
func WithPosition(err error, position int) Err {
	if err == nil {
		return nil
	}
	e := fromErr(err)
	if e.P < 0 {
		e.P = position
	}
	return e
}
func Unrecognized(msg string, args ...interface{}) Err {
	msg = fmt.Sprintf("unrecognized "+msg, args...)
	return &err{M: msg, C: "42000", P: -1}
}