func NewPgError(message string) ([]byte, error) {
	output := make([]byte, 5+7+7+len(message)+2)
	output[0] = 'E'
	output = output[:5]
	output = append(output, []byte{'S', 'E', 'R', 'R', 'O', 'R', 0}...)
	output = append(output, []byte("C42000")...)
	output = append(output, 0)
	output = append(output, append([]byte{'M'}, []byte(message)...)...)
	output = append(output, 0, 0)
	binary.BigEndian.PutUint32(output[1:5], uint32(len(output)-1))
	return output, nil
}
NewPgError returns packed error
package postgresql
import (
	"bufio"
	"bytes"
	"context"
	"encoding/binary"
	"errors"
	"io"
	"net"
	"time"
	acracensor "github.com/cossacklabs/acra/acra-censor"
	"github.com/cossacklabs/acra/acra-censor/common"
	"github.com/cossacklabs/acra/decryptor/base"
	"github.com/cossacklabs/acra/logging"
	"github.com/cossacklabs/acra/network"
	"github.com/cossacklabs/acra/sqlparser"
	"github.com/cossacklabs/acra/utils"
	"github.com/prometheus/client_golang/prometheus"
	log "github.com/sirupsen/logrus"
	"go.opencensus.io/trace"
)
var ReadyForQueryPacket = []byte{'Z', 0, 0, 0, 5, 'I'}
var TerminatePacket = []byte{'X', 0, 0, 0, 4}