Re: quote_literal(integer) does not exist

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: quote_literal(integer) does not exist
Date: 2007-11-25 13:19:17
Message-ID: 37ed240d0711250519u3eaf9e8dt848b7d650b6f81ec@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Nov 25, 2007 11:51 PM, Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Guillaume Smet 2007-11-25 13:30:29 Re: 8.3devel slower than 8.2 under read-only load
Previous Message Guillaume Smet 2007-11-25 13:07:11 Re: 8.3devel slower than 8.2 under read-only load