Fwd: Row description Metadata information

Started by Aleksei Ivanovalmost 5 years ago2 messages
#1Aleksei Ivanov
iv.alekseii@gmail.com

Not sure that previous email was sent correctly. If it was duplicated,
sorry for the inconvenience.

Hi, hackers,

I have one question related to returned information in the row description
for prepared statement.

For example Select $1 * 2 and then Bind 1.6 to it.
The returned result is correct and equal to 3.2, but type modifier in the
row description is equal to -1, which is not correct.

Does someone know where this modifier is calculated? Is this a bug or
intention behavior?

Best regards,
Aleksei Ivanov

#2Bruce Momjian
bruce@momjian.us
In reply to: Aleksei Ivanov (#1)
Re: Fwd: Row description Metadata information

On Mon, Feb 15, 2021 at 05:25:55PM -0800, Aleksei Ivanov wrote:

Not sure that previous email was sent correctly. If it was duplicated, sorry
for the inconvenience.

Hi, hackers,

I have one question related to returned information in the row description for
prepared statement.

For example Select $1 * 2 and then Bind 1.6 to it.
The returned result is correct and equal to 3.2, but type modifier in the row
description is equal to -1, which is not correct.

Does someone know where this modifier is calculated? Is this a bug or intention
behavior?

Postgres can't always propogate the type modifier for all expresions, so
it basically doesn't even try. For example, the modifier for || would
be very complex.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

The usefulness of a cup is in its emptiness, Bruce Lee