Byte strings in postgres aren't 0x... #1906

Merged
lunny merged 3 commits from zeripath/xorm:fix-bytea-representation-in-postgres into master 2021-05-09 07:10:00 +00:00
Showing only changes of commit 2d626529e5 - Show all commits

View File

@ -824,6 +824,11 @@ func (db *postgres) SetQuotePolicy(quotePolicy QuotePolicy) {
}
}
// FormatBytes formats bytes
func (db *postgres) FormatBytes(bs []byte) string {
return fmt.Sprintf("E'\\x%x'", bs)
}
func (db *postgres) SQLType(c *schemas.Column) string {
var res string
switch t := c.SQLType.Name; t {