jackc/pgx · error

Record incomplete

Error message

Record incomplete %v

What it means

NewCompositeTextScanner rejected the composite text input because it is shorter than the mandatory two enclosing parentheses '()' — i.e. the record literal is empty or truncated. The src bytes (shown via %v) are the faulting input.

Solutions

  1. Fix the source data to a valid composite literal like '(1,2)'
  2. Verify the value actually comes from a composite-typed column
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pgtype/composite.go:372 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: /api/errors/a78e5bc682cfddfd. Report an issue: GitHub.

Appendix: source

Thrown at pgtype/composite.go:372

// Err returns any error encountered by the scanner.
func (cfs *CompositeBinaryScanner) Err() error {
	return cfs.err
}

type CompositeTextScanner struct {
	m   *Map
	rp  int
	src []byte

	fieldBytes []byte
	err        error
}

// NewCompositeTextScanner a scanner over a text encoded composite value.
func NewCompositeTextScanner(m *Map, src []byte) *CompositeTextScanner {
	if len(src) < 2 {
		return &CompositeTextScanner{err: fmt.Errorf("Record incomplete %v", src)}
	}

	if src[0] != '(' {
		return &CompositeTextScanner{err: fmt.Errorf("composite text format must start with '('")}
	}

	if src[len(src)-1] != ')' {
		return &CompositeTextScanner{err: fmt.Errorf("composite text format must end with ')'")}
	}

	return &CompositeTextScanner{
		m:   m,
		rp:  1,
		src: src,
	}
}

// Next advances the scanner to the next field. It returns false after the last field is read or an error occurs. After

View on GitHub (pinned to ec1a0befd2)