Re: Strict-typing benefits/costs
От | Tom Lane |
---|---|
Тема | Re: Strict-typing benefits/costs |
Дата | |
Msg-id | 20588.1203180440@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Strict-typing benefits/costs (Ken Johanson <pg-user@kensystem.com>) |
Ответы |
Re: Strict-typing benefits/costs
|
Список | pgsql-general |
Ken Johanson <pg-user@kensystem.com> writes: > select 5<'6' -> true > select 5>'6' -> false > select 15<'60' -> true > select 15>'60' -> false These examples miss the point, because they'd give the same answer whether you think the values are text or integer. Consider instead these cases: regression=# select 7 > '60'; -- int > int ?column? ---------- f (1 row) regression=# select '7' > '60'; -- text > text ?column? ---------- t (1 row) regression=# select 7 > '08'; -- int > int ?column? ---------- f (1 row) regression=# select '7' > '08'; -- text > text ?column? ---------- t (1 row) All of a sudden it seems much more important to be clear about what data type is involved, no? > Numbers and datetime in sql have exactly prescribed standard char > representations (even if others dbs don't use them for datetimes). See the datestyle parameter before you maintain that Postgres should assume that. regards, tom lane
В списке pgsql-general по дате отправления: