Views referencing JSON fields in PostgreSQL JSON(B) columns don't show values for them
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start with the SQL reproduction in the issue using the DuckDB CLI and PostgreSQL 16.4, comparing the direct SELECT with the view query. Investigate how the JSONPath projection behaves when the view is created and queried; done means the view returns the same some_field values as the direct SELECT.
Written by the indexing model from the issue text.
Description
What happens?
When I execute a SELECT statement on a PostgreSQL table with a JSONB-type column that includes an output column for a field in that column (extracted via a JSONPath expression), that column yields data as expected. If I create a view for the same statement, the column remains empty.
To Reproduce
SELECT id, json_col->'$.some_field' some_field FROM my_psql_table;
-- result contains values in some_field column ✓
CREATE VIEW my_view AS SELECT id, json_col->'$.some_field' some_field FROM my_psql_table;
FROM my_view;
-- result DOES NOT contain values in some_field column
OS:
Linux
PostgreSQL Version:
16.4
DuckDB Version:
1.1.0
DuckDB Client:
CLI
Full Name:
Marco Götze
Affiliation:
(none)
Have you tried this on the latest main branch?
- I agree
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
- I agree
- Dominant language
- C++
- Stars
- 372
- Forks
- 107
- Avg merge
- 13h 28m
- Merged PRs (30d)
- 18
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from duckdb/duckdb-postgres
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
duckdb/duckdb-postgres#604 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 43/100
duckdb/duckdb-postgres#598 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
duckdb/duckdb-postgres#597 · 1 comment ·
Maintainers usually reply within 1 day
-
ORDER BY pushdown + CTID queries result in out of order resultsPossibly taken @staticlibs claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
duckdb/duckdb-postgres#596 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
duckdb/duckdb-postgres#594 · 4 comments ·
Maintainers usually reply within 1 day
All issues in duckdb/duckdb-postgres
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
scanaislop/aislop#482 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
EchoTools/nevr-runtime#547 ·
Maintainers usually reply within 1 day
-
1 type: problem 2 scope: firmware 3 good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
SpaceTeam/STS1_COBC_SW#511 ·