[mythtv] State of play Re. DB support (MySQL versions, Postgresql etc.)

Fernando Vilas fvilas at iname.com
Fri May 12 18:43:06 UTC 2006

On Monday May 8 2006 11:25, Ed W wrote:
> Hi
> >Or is this preferred?
> >INSERT INTO mytable(column,othercolumn) VALUES(value,value);
> >  
> >
> This is the syntax I have seen most commonly on other databases.  I was 
> under the impression this was the correct "SQL" standard?
> Mysql also has the very useful "UPDATE INTO" which does a replace - 
> often a very fast and handy function

Yes, the INSERT...SET syntax is non-standard and will cause problems if/when other databases are supported.

> >LAST_INSERT_ID()/MSqlQuery::lastInsertId()
> >Is the above OK to use? I've seen various workarounds in code to get the 
> >ID back out, but not sure if this is just older techniques or not.
> >  
> This is always a bug bear....  I don't know of any reasonably generic 
> way to do it short of using cursors and re-reading the data....

Getting the last insert id is also not portable, however it is easier to code for than the syntax in the first question.

As far as support, I have been trying to keep up with patches on ticket #240, but occassionally I get a little behind.  I have some changes I'm working on for the next version, but that's another thread (I don't want to hijack this one).   But the patch there has a function for getting the last insert id.

I have not extended Postgres support to plugins yet, mostly due to time constraints, but I have been running MythTV (no plugins) with a PostgreSQL backend for about a year now, fixing problems as I find them.

Fernando Vilas
fvilas at iname.com

More information about the mythtv-dev mailing list