Skip to content

server/functions: Report the type of a null value from pg_typeof. - #3374

Open
reltuk wants to merge 1 commit into
mainfrom
aaron/plpgsql-pg_typeof-null-support
Open

reltuk wants to merge 1 commit into
mainfrom
aaron/plpgsql-pg_typeof-null-support

Conversation

@reltuk

@reltuk reltuk commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

The function was declared strict, so it returned null for a null argument. Its type is known regardless of its value, which is what PostgreSQL reports.

The function was declared strict, so it returned null for a null
argument. Its type is known regardless of its value, which is what
PostgreSQL reports.
@reltuk
reltuk requested a review from Hydrocharged September 15, 2026 13:56
@github-actions

Copy link
Copy Markdown
Contributor
Main PR
Total 42090 42090
Successful 19854 19856
Failures 22236 22234
Partial Successes1 5440 5440
Main PR
Successful 47.1703% 47.1751%
Failures 52.8297% 52.8249%

${\color{lightgreen}Progressions (2)}$

polymorphism

QUERY: select pg_typeof(null);

subselect

QUERY: select count(*) from tenk1 t
where (exists(select 1 from tenk1 k where k.unique1 = t.unique2) or ten < 0);

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

@itoqa

itoqa Bot commented Sep 15, 2026

Copy link
Copy Markdown

Ito QA test results
Commit: 812534d: 7 test cases ran, 7 passed ✅.

Summary

The run covers database type reporting across ordinary scalar and array values, typed and untyped NULLs, conditional and empty aggregate results, schema changes, and concurrent requests. These are primarily correctness and edge-case checks, including concurrency behavior, and the exercised behaviors remain healthy.

Safe to merge — no PR-attributable regressions, new failures, or previously flagged failures were found, so there is no merge blocker indicated by this run.

Tests run by Ito

View full run

Result Severity Type Description
General Scalar, array, column, conditional, and aggregate expressions kept the same type labels when their values were NULL.
General After the column changed to integer, both the value and the NULL row reported integer metadata, and the derived value also reported integer.
General Concurrent SQL calls returned the type for the expression sent by each session. All 400 NULL-path calls and 600 non-NULL calls completed without a wrong type or NULL result.
Null The database returned integer and text[] for typed NULL values, and unknown for an untyped NULL. None of the results was NULL.
Rev The query returned one row with bigint and numeric for the two type checks.
Rev An empty integer aggregate returned the type name integer and a blank value for SQL NULL.
Type The database reported integer, text, and text[] for the tested expressions.

Tip

Reply with @itoqa to send us feedback on this test run.

@coffeegoddd

Copy link
Copy Markdown
Contributor

@reltuk DOLT

read_tests from_latency to_latency percent_change
covering_index_scan_postgres 2.43 2.43 0.0
groupby_scan_postgres 78.6 78.6 0.0
index_join_postgres 2.26 2.22 -1.77
index_join_scan_postgres 1.61 1.61 0.0
index_scan_postgres 467.3 467.3 0.0
oltp_point_select 0.37 0.37 0.0
oltp_read_only 6.43 6.43 0.0
select_random_points 0.73 0.72 -1.37
select_random_ranges 1.04 1.04 0.0
table_scan_postgres 467.3 467.3 0.0
types_table_scan_postgres 1191.92 1191.92 0.0
write_tests from_latency to_latency percent_change
oltp_delete_insert_postgres 6.67 6.67 0.0
oltp_insert 3.36 3.36 0.0
oltp_read_write 13.46 13.46 0.0
oltp_update_index 3.62 3.62 0.0
oltp_update_non_index 3.3 3.25 -1.52
oltp_write_only 7.04 7.04 0.0
types_delete_insert_postgres 7.17 7.3 1.81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants