W
W
wideShift2022-01-14 21:47:04
PostgreSQL
wideShift, 2022-01-14 21:47:04

How does comparison of different types work in PostgreSQL?

I didn't find it in the documentation, I can only guess.

Here both values ​​are converted to timestamp type and compared?

select '2021-01-01'::date = '2021-01-01 12:00'::timestamp;


And here both are cast to type integer or numeric for comparison?
select 5::numeric = 5::integer;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2022-01-14
@ky0

Well, how did you not find it? Here is https://postgrespro.ru/docs/postgresql/14/typeconv

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question