$1 IS NULL with iso-8859-1 type

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема $1 IS NULL with iso-8859-1 type
Дата
Msg-id CA+mi_8ZYoZGXsEBkENULryqbXZ7Cd6kxQiPGtn8GVXxhU_UOCA@mail.gmail.com
обсуждение исходный текст
Ответы Re: $1 IS NULL with iso-8859-1 type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello,

The operator `IS NULL` doesn't work if the argument has unknown type.
In psycopg 3:

    >>> conn.execute("select %s is null", ['foo']).fetchone()
    IndeterminateDatatype: could not determine data type of parameter $1

This can get in the way of using the unknown type for strings (but
specifying the text oid for strings is worse, because there is no
implicit cast from string to most types).

It doesn't seem necessary to specify a type for an argument if it only
has to be compared with null: nullness is independent from the type
and is even specified, in the query parameters, in a separate array
from the parameter values.

Maybe this behaviour can be relaxed?

Cheers

-- Daniele



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Add 64-bit XIDs into PostgreSQL 15
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pgsql: Prevent instability in contrib/pageinspect's regression test.