Nonempty icollection values cannot be read back from text or restored from a dump

Đang mở
#48 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@Vonng đang làm issue này rồi.

Từ ngày 27/11/2026.

  • #49 của @Vonng — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c, postgresql
Lĩnh vực
databases

Hướng nghiên cứu

Start with the integer-key output and input functions described in the issue, then inspect test/sql/subscript.sql around test 18. Reproduce the text round-trip failure and check the existing test coverage. Done means a nonempty icollection value can be read back from its text output and restored from a dump; linked pull request #49 indicates work is already underway.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi! I found a text round-trip failure for nonempty integer-key collections in pgcollection 2.1.3. It also prevents restoring a table containing one of these values.

CREATE EXTENSION collection;
CREATE TABLE sample (c icollection);
INSERT INTO sample VALUES ('{"value_type":"bigint","entries":{"2":"2"}}');
SELECT c::text FROM sample;              -- {2: 2}
SELECT c::text::icollection FROM sample;  -- ERROR: Invalid format

On PostgreSQL 19.0, dumping this database with pg_dump -Fc succeeds, but pg_restore --exit-on-error fails during COPY sample on the same value. I expected to read back key 2 with its original bigint value.

The integer-key output function omits the value type and writes unquoted keys; the input function expects a JSON object with value_type and entries. Subscript test 18 already exercises this case. Issue #7 concerned the string-key collection.

Ngôn ngữ chính
C
Star
24
Fork
6
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/pgcollection

Tất cả issue của aws/pgcollection

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.