Re: quote_literal(integer) does not exist
От | Brendan Jurd |
---|---|
Тема | Re: quote_literal(integer) does not exist |
Дата | |
Msg-id | 37ed240d0711250519u3eaf9e8dt848b7d650b6f81ec@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: quote_literal(integer) does not exist (Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>) |
Ответы |
Re: quote_literal(integer) does not exist
Re: quote_literal(integer) does not exist Re: quote_literal(integer) does not exist |
Список | pgsql-hackers |
On Nov 25, 2007 11:51 PM, Andreas 'ads' Scherbaum <adsmail@wars-nicht.de> wrote: > But that's not the point: more people will run into this problem and > this looks like a showstopper for updating to 8.3. > > By the way, the function is named quote_literal(), not quote_text(). > From my point of view i expect to get everything correctly quoted, > what's feeded as input into this function. Given the fact, that > previous versions accepted every input without notice about the > implicit cast, i don't see not so much blame in the application. I had a similar experience to Andreas when I first migrated my app to 8.3b1 for testing. It wasn't hard to fix, but did seem like an unnecessary barrier to upgrading. I agree that the name of the function (and its behavior up till now) encourage users to think of it as a "quote whatever I throw at you" function, which is indeed what you would want/expect in the context of building a dynamic query. Having quote_literal take its argument as text was fine whilst we were automatically casting arguments, but in 8.3 it seems that quote_literal(anyelement) makes a lot more sense than quote_literal(text). So, I wonder why we don't just adapt the internal function to take anyelement? It would save a lot of apps from being broken by the move to 8.3, and make the function more convenient. Regards, BJ
В списке pgsql-hackers по дате отправления: