How should empty collection values round-trip through text?

Open
#50 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
c, postgresql
Domain
databases

Research direction

Start with src/collection_io.c lines 94–112 and read the related discussions in #24 and #36 for context on the text format. Check how empty untyped and explicitly typed values are written and read, and how deleting the last entry affects value_type(). Done means tests preserve the agreed distinctions; the issue leaves the format decisions open.

Written by the indexing model from the issue text.

Description

Both key types can write {} for an empty value, but reading that output back fails. This matters for text COPY and restores of tables that contain empty collections. The existing tests also expect value_type() to return NULL after the last entry is deleted.

Would you accept {} for an untyped empty value and the existing type-and-entries envelope for an explicitly typed empty value? Should deleting the last entry clear the type as it does today? I’d like to preserve that distinction in tests before changing the format. Related discussions include #24 and #36. The nonempty integer-key case is tracked in #48.

Relevant upstream source

Dominant language
C
Stars
24
Forks
6
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/pgcollection

All issues in aws/pgcollection

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.