[wp-hackers] PostgreSQL port status?

usleepless at gmail.com usleepless at gmail.com
Tue Oct 2 20:11:33 GMT 2007

On 10/2/07, Matt Mullenweg <m at mullenweg.com> wrote:
> usleepless at gmail.com wrote:
> > why are there `'s in that query?
> >
> > what are they good for?

I appreciate your respone, but actually it was a rethoric question. I
know where it is good for: absolutely nothing!

> Because if a field name or table name conflicts with a MySQL reserved
> keyword the query will fail with a cryptic error messages, so it's good
> practice to put the `` quotes around them all.

Sure, most DBMS's tend to have an escape character to allow for
cornercases ( for example, schemas you don't have control over ).

But as Tom pointed out, (reserverd) keywords are ... well ... kind of
reserved. Don't use them as identifiers. In fact, the WP schema is
"clean": to run in on PostgreSQL, i just replace the backticks with
nothing/empty strings.

And: the backticks only appear in upgrade.php.

Ryan suggested patches to abstract the schema are welcome. Is a patch
to remove the unnecessary use of backticks welcome as well? Will
patches to write "LIMIT x OFFSET y" instead of "LIMT y,x" be welcome?

I would like to to get this straight because I am willing to put my
energy and skills into abstracting WP's DBMS access. But if patches
will be rejected on these kind of grounds, I see no point in starting
on it at all.

To be clear
  - The changes i have in mind are not as big as you guys think:
Schema abstraction, change a handfull of queries.
  - There will be no performance hits.
  - You can reap the perceived benefits of MySQL all you want.
  - Having 2 DBMS's to choose from might provide interesting debug
opportunities ( it might have better error messages for example ).

Responses, corrections and comments are highly appreciated,



More information about the wp-hackers mailing list