writePGMessage writes a PostgreSQL wire protocol message (type byte + int32 length + body) into w, matching the format wire.ReadMessage() expects.
(w io.Writer, msgType byte, body []byte)
| 3945 | // An org's full-power principal (nil QueryAccessPolicy) sees its own org's |
| 3946 | // connections in pg_stat_activity, never another org's. On the multitenant |
| 3947 | // control plane every org shares one process-wide connection registry. |
| 3948 | func TestPgStatActivityOrgRootSeesOnlyOwnOrg(t *testing.T) { |
| 3949 | srv := &Server{conns: make(map[int32]*clientConn)} |
| 3950 | root := &clientConn{server: srv, username: "root", orgID: "org-a", pid: 100} |
| 3951 | sameOrg := &clientConn{username: "svc-reporting", orgID: "org-a", pid: 101} |
| 3952 | otherOrg := &clientConn{username: "root", orgID: "org-b", pid: 102} |
| 3953 | for _, conn := range []*clientConn{root, sameOrg, otherOrg} { |
| 3954 | srv.registerConn(conn) |
no test coverage detected