[wp-hackers] PostgreSQL port status?

usleepless at gmail.com usleepless at gmail.com
Thu Oct 4 07:51:56 GMT 2007


On 10/4/07, Peter Westwood <peter.westwood at ftwr.co.uk> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Tom Barta wrote:
> > On 10/2/07, Leonid Mamchenkov <leonid at mamchenkov.net> wrote:
> >> On 10/2/07, usleepless at gmail.com <usleepless at gmail.com> wrote:
> >>> But as Tom pointed out, (reserverd) keywords are ... well ... kind of
> >>> reserved. Don't use them as identifiers.
> >> I guess there is an added benefit of forward compatibility in escaping
> >> fields and table names.  Words which are not reserved now can become
> >> so in the future.
> >
> > Ok, so there's at least two options:
> >  1) Use backticks to escape tables and fields.  This future-proofs
> > against MySQL reserved keyword changes (how frequently does that
> > happen?).  It also makes it harder to  use /any other database/ with
> > Wordpress.
>
> Why does it make it harder.
>
> Replacing all the backticks in a mysql statement passed to
> $wpdb->prepare is surely just a simple search and replace.

except for the fact you can't use backticks in posts anymore. they
will be replaced into oblivion.

> >  2) Use non-reserved tables and fields.  If a new version of MySQL
> > comes out that adds an inconvenient reserved word, then the first
> > version of WP needs to add backticks or provide a DB upgrade path with
> > a field rename.
>
> Thats all well and good but we state that we work with at leat MySQL
> vx.x and so we should still work when MySQL y.y comes out and adds the
> "autoload" keyword (for example) we still work.

don't worry. new major versions of MySQL tend to be so unstable, they
have very slow adoption.

furthermore, this whole backtick argument is just smoke & mirrors:
 - all SQL in WP is backtick-free except for update.php
 - will a patch to add backticks to all other SQL be accepted?
 - if indeed it was good practice, the "good practice" would be ...
well practiced. it's strange i haven't seen it practiced in other
projects.

you might as well write
  (x + (2*y)) instead of x+2*y

because... well... you know... perhaps the precedence of * over +
might change. better be safe than sorry! you never know!

regards,

usleep


More information about the wp-hackers mailing list