Re: quote_literal with NULL
От | Tom Lane |
---|---|
Тема | Re: quote_literal with NULL |
Дата | |
Msg-id | 18985.1192035095@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: quote_literal with NULL ("Greg Sabino Mullane" <greg@turnstep.com>) |
Ответы |
Re: quote_literal with NULL
|
Список | pgsql-hackers |
"Greg Sabino Mullane" <greg@turnstep.com> writes: >> Perhaps have quote_nullable() then as well? >> >> You then use quote_nullable() in INSERT and UPDATE SET clauses and >> quote_literal() in SELECT WHERE clauses. > I still don't see the use case. Wouldn't your app still need to check > for nullability anyway, to avoid " = NULL"? Well, it's clearly useful in INSERT and UPDATE. For WHERE cases, you might or might not be able to use it, but I note that quote_nullable() would work much more like what happens if you use a parameter symbol and then bind NULL as the actual parameter value ... In hindsight we should probably have done quote_literal the way the OP suggests, but I concur that it's too late to change it. An additional function seems a reasonable compromise. regards, tom lane
В списке pgsql-hackers по дате отправления: