-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> How about just doing what is asked for?
...
> Since SCS is not the default, there is probably a good reason why user
> of the driver or the DBA turned SCS on.

I don't think providing such a foot-gun is a good idea when we can simply
return something (E'') which is fully compatible with both SCS on and
SCS off. This nicely gets us out of the whole "check the SCS setting every
single time before we quote something" mess as well.

...

> That is the fault of the application -- A bug, as it were. I don't think
> the driver should be second guessing the user -- It is almost as if the
> driver is telling the user, maybe not not screaming at the top of its
> lungs, but whispering quietly into the users ear, 'I know you turned SCS
> on but you are probably too stupid to use it correctly, so I will do what
> is best for you'.

I think it's not a matter of second guessing the user or app, it's just a
best practice. I can't imagine an argument where an app would need true SCSs,
and even if they did, it's easy enough to do so in your app (indeed, the leading
E makes it quite easy for the app to know when to do convert. As I mentioned,
the E-as-needed is how Postgres itself does it, so it's at least as guilty
as us of such whispering.

The end goal is to implement a $dbh->quote() that emulates the behavior
of PG's quote_literal while still sticking to the DBI API, and I think the
current solution (e.g. what I committed last night) is probably the
best solution.

- --
Greg Sabino Mullane [EMAIL PROTECTED]
End Point Corporation
PGP Key: 0x14964AC8 200805090943
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkgkVgUACgkQvJuQZxSWSshI3ACghx2tSgBb2Q4euxLWth+BtIBF
LFwAoNybDxNcl19l77J2VpM224yKzNJh
=vPxL
-----END PGP SIGNATURE-----


Reply via email to