[wp-hackers] PostgreSQL port status?

Ryan Boren ryan at boren.nu
Mon Oct 1 21:06:40 GMT 2007


On 9/30/07, usleepless at gmail.com <usleepless at gmail.com> wrote:
> Ryan,
>
> On 9/29/07, Ryan Boren <ryan at boren.nu> wrote:
> > Making our SQL more portable and making bits of the schema pluggable
> > is cool.
>
> thank you for chiming in on this. but:
>
> what exactly does this mean? you indicate that you are fine with
> abstracting the schema ( up to the point it runs on pgsql as well ? )
>
> is this correct?

Someone suggested assigning types to variables so that different DBs
can set them as desired.  That's cool.  We could also make the entire
schema definition replaceable.  The whole thing is defined in one
variable that can be easily overridden.  Doing so would mean
maintainers of other DBs would have to stay up-to-date on schema
changes, however.

> > We have some tickets in trac about eliminating enums,
> > sanitizing ints, and such.  Patches welcome.  Tested patches that
> > upgrade cleanly from previous releases are even more welcome. :-)
>
> i am willing and able to reform the schema up to the point that it
> still runs on mysql ( without performance degration at all ) and works
> for postgresql as well.
>
> but, for me this will only have value if other patches are welcome too:
>   fix some queries which use "`" character
>   remove "IGNORE" keyword from certain INSERT-stmts
>   fix some GROUP BY-stmts
>   fix limit stmts from LIMIT x,y to LIMIT y OFFSET x
>   fix use of C-style operator "!=" to "<>"
>   fix writing '' to fields which you want to be filled with the
> default-value from the schema ( writing posts and pages )
>   abstract FOUND_ROWS
>
> mysql specific functions do not need to be touched at all: these can
> be defined in pgsql and there is a mysql-function-library for pgsql
> available.

Making our SQL more portable while not affecting MySQL performance is
fine by me.  WP will still target MySQL, but avoiding MySQLisms where
they are unnecessary seems a harmless way to be more portable and cut
down on the work of those trying to support other DBs.

Ryan


More information about the wp-hackers mailing list