jackc/pgx · error

expected sync, got %T

Error message

expected sync, got %T

What it means

Error "expected sync, got %T" thrown in jackc/pgx.

Source

Thrown at conn.go:1222

				resultSD, ok := results.(*pgconn.StatementDescription)
				if !ok {
					return fmt.Errorf("expected statement description, got %T", results)
				}

				// Fill in the previously empty / pending statement descriptions.
				sd.ParamOIDs = resultSD.ParamOIDs
				sd.Fields = resultSD.Fields
			}

			results, err := pipeline.GetResults()
			if err != nil {
				return err
			}

			_, ok := results.(*pgconn.PipelineSync)
			if !ok {
				return fmt.Errorf("expected sync, got %T", results)
			}

			return nil
		}()
		if err != nil {
			return &pipelineBatchResults{ctx: ctx, conn: c, err: err, closed: true}
		}
	}

	// Queue the queries.
	for _, bi := range b.QueuedQueries {
		err := c.eqb.Build(c.typeMap, bi.sd, bi.Arguments)
		if err != nil {
			err = newErrPreprocessingBatch("build", bi.SQL, err)
			return &pipelineBatchResults{ctx: ctx, conn: c, err: err, closed: true}
		}

		if bi.sd.Name == "" {

View on GitHub (pinned to ec1a0befd2)

When it happens

Trigger: Thrown at conn.go:1222 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jackc/pgx@ec1a0befd2 (2026-08-04). Data as JSON: /data/errors/b7bd3b393669e4a8.json. Report an issue: GitHub.