Re: recovery_target_time format explanation should be clarified when using UTC zone

2025-10-31 Thread Jaime Silvela
Actually, I had not realized there was a “Submit Correction” link on each 
documentation page.
Sorry, hope I haven’t made this confusing.

The documentation page that requires clarification is
https://www.postgresql.org/docs/current/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET
19.5. Write Ahead Log
postgresql.org



> On 29 Oct 2025, at 14:58, PG Doc comments form  wrote:
> 
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/18/index.html
> Description:
> 
> We've been hitting a bug with PITR when specifying a recovery_target_time
> with an ISO 8601 format and UTC zone indicated with a trailing `Z`.
> 
> We get an error like this
> 
> ```
> "msg":"waiting for server to start2025-10-28 16:40:20.324 UTC [38]
>  LOG:  invalid value for parameter \"recovery_target_time\": \"2025-10-28
> 16:34:15.00Z\"",
> ```
> 
> The documentation states
> 
>> The value of this parameter is a time stamp in the same format accepted by
> the timestamp with time zone data type, except that you cannot use a time
> zone abbreviation
>> [-snip-]
>> Preferred style is to use a numeric offset from UTC, or you can write a
> full time zone name, e.g., Europe/Helsinki not EEST.
> 
> That `Z`, if it's an abbreviation, would be an abbreviation for Zulu, I
> presume? I tried to use `Zulu` and not just `z` but still had the same
> `invalid value` error.
> 
> For timestamps in UTC zone, I think the only supported format would be
> numeric offset, right? With `+00` instead of `Z`.
> I think that the documentation should clarify this explicitly.
> Unless there is a full name for the UTC zone which I'm unaware of...
> 
> Thanks



Implicit type conversion for json/jsonb

2025-10-31 Thread PG Doc comments form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/typeconv-overview.html
Description:

Hello, I'm trying to understand how json/jsonb is implicitly converted in
INSERT and UPDATE queries.

In section "10.1. Overview" there is the following:

If a type is not specified for a string literal, then the placeholder type
unknown is assigned initially, to be resolved in later stages as described
below.

Value Storage

SQL INSERT and UPDATE statements place the results of expressions into a
table. The expressions in the statement must be matched up with, and perhaps
converted to, the types of the target columns.
---

In section "10.4. Value Storage" there is:

Value Storage Type Conversion

1. Check for an exact match with the target.

2. Otherwise, try to convert the expression to the target type. This is
possible if an assignment cast between the two types is registered in the
pg_cast catalog (see CREATE CAST). Alternatively, if the expression is an
unknown-type literal, the contents of the literal string will be fed to the
input conversion routine for the target type.

3. Check to see if there is a sizing cast for the target type. A sizing cast
is a cast from that type to itself. If one is found in the pg_cast catalog,
apply it to the expression before storing into the destination column. The
implementation function for such a cast always takes an extra parameter of
type integer, which receives the destination column's atttypmod value
(typically its declared length, although the interpretation of atttypmod
varies for different data types), and it may take a third boolean parameter
that says whether the cast is explicit or implicit. The cast function is
responsible for applying any length-dependent semantics such as size
checking or truncation.


I used the following sql to test out jsonb through pg admin

DROP TABLE IF EXISTS jsonb_test;

CREATE TABLE jsonb_test
(
data jsonb
);

INSERT INTO jsonb_test VALUES ('{ "a": "1", "b": "2" }');

INSERT INTO jsonb_test VALUES ('{ "a": "1", "b": "2" }'::unknown);

-- This fails to insert with "column "data" is of type jsonb but expression
is of type text"
-- INSERT INTO jsonb_test VALUES ('{ "a": "1", "' || 'b": "2" }');

-- This failed to insert with "failed to find conversion function from
unknown to jsonb"
-- INSERT INTO jsonb_test VALUES (('{ "a": "1",' || '"b": "2" }')::unknown);

So based on the docs, my understanding is that the first INSERT is assigned
as "unknown", and there is an implicit conversion from "unknown" to "jsonb".
I can see that casting to "unknown" works as well in the second INSERT. The
third INSERT fails because there is no implicit cast from text to jsonb. But
if explicitly cast text to "unknown" as in the last INSERT, I get an error.
Is my understanding correct? If so, how do the conversion rules explain the
last INSERT?


doc: Clarify ANALYZE VERBOSE output

2025-10-31 Thread Shinya Kato
Hi,

ANALYZE VERBOSE emits a detailed per-table INFO level report, like
VACUUM VERBOSE. Update the parameter description to use the same
wording.

-- 
Best regards,
Shinya Kato
NTT OSS Center


v1-0001-doc-Clarify-ANALYZE-VERBOSE-output.patch
Description: Binary data