60
// rejected. Encoding time.Duration as int8 (bigint in PostgreSQL) instead
61
// results in the integer nanosecond count
62
>
func registerCustomTypes(_ context.Context, conn *pgx.Conn) error {
pgx.go
63
>
// pgx tracks the value type and the pointer type separately, so
64
>
// both must be remapped.
65
>
conn.TypeMap().RegisterDefaultPgType(time.Duration(0), "int8")
66
>
conn.TypeMap().RegisterDefaultPgType((*time.Duration)(nil), "int8")
67
>
return nil
68
>
}
69
70
func (p *PGXDriver) IsDupEntryError(err error) bool {