PostgreSQL Support

From MythTV

Jump to: navigation, search

Cleanup: This article or section may require cleanup. Discuss the issue on the talk page

There has been some discussion on the mythtv-users mailing list concerning the use of alternate database software, notably PostgreSQL. The common reason for making this request is that many users feel that MySQL is not a robust database. I am not here to debate the merits of PostgreSQL over MySQL, nor am I here to comment on MySQL stability.

Previously this Wiki page mentioned that official support for PostgreSQL support is officially stated for MythTV 0.20 - this is not the case. It was propsed as Trac ticket 240, however, Isaac (in the ticket) has gone on record as saying that alternate database software will not be supported, and that "Any change away from mysql will likely be to an embedded db with a server speaking the myth protocol & abstracting many of the more complex queries so simple clients wouldn't have speak SQL." [1].

So, to recap, if you're looking to use PostgreSQL, the "official" answer is, "Use MySQL".

That said, there has been some unofficial work done to make MythTV (0.20 SVN) work with PostgreSQL. This is not official, possibly not stable, possibly untested, and most probably unsupported by any MythTV developer. For archival purposes (below this horizontal line), here is the information that was previously here, on setting this up.

Joevulture 05:04, 11 July 2006 (UTC)

I wonder if the developers have heard of QOF (Query Object Framework)?

--KarlHeg 21:34, 2 April 2007 (UTC)


If you want to use it in MythTV 0.19, you'll have to install directly from the Subversion source tree by following these steps (thanks to Fernando Vilas for answering questions as I tried to document this process): Go look at mythtv ticket #240: http://svn.mythtv.org/trac/ticket/240

The latest code is also here: http://webpages.charter.net/fvilas/

Find the latest version of mythTV that a patch is available for. Don't bother trying the patch on the latest code. Even if it's a week or two newer, the patch probably won't work on it :-P

For the rest of this document, the latest version I tried this on is 9869.

Download the patch and unzip it using gunzip:
gunzip pgsql_support.patch-9869.gz

Create a mythtv directory in your home directory and run this in it (always start in a clean directory or the patches may fail if you use subversion to update the source code):
svn co -r 9869 http://cvs.mythtv.org/svn/trunk/mythtv
This will create libs and mythtv directories where you run it. You need to go into the mythtv directory to build it.

Run the patch against the mythtv directory that was downloaded (this assumes the patch is in the same directory):
patch -p0 < pgsql_support.patch-9869

run ./configure to let it create a makefile for your system.
If it complains it can't find qmake, you have to install TrollTech's Qt development tools. It's in the package qt3-dev-tools on Debian.

run make (you'll find out if you're missing any libraries when you do this):
make

Grab any libraries it complains about:
If it wants -lqt-mt, you need the libqt3-mt-dev package.
If it wants -lXv, you need the libxv-dev package.
If it wants -lXxf86vm, you need the libxxf86vm-dev package.
missing ftheader.h: install libfreetype6-dev (or you may need to do a ./configure).
If it wants -lfreemheg-0.19, remove the reference to it in programs/mythuitest/mythuitest.pro in the 2nd LIBS line.
If it wants "av_crc" while linking, it wants ???

When you can run make cleanly, you can install it with:
make install

Then you have to run psql to create the postgres database:
psql -d mythconverg -U mythtv < database/pg.sql
Note that you have to run this as the postgres user (su to the user) or a user with high enough privileges to create databases and users.

If you can an error of:
connect: FATAL: Ident authentication failed for user "mythtv"
it means you need to rerun the script as the mythtv user.

And finally, you can run mythtv-setup (be sure to set the database to PostgreSQL instead of MySQL).

If you have problems finding packages, update your /etc/apt/sources.list. You'll need various other libraries that may not be public domain and you can get them here:
www.debian-multimedia.org

Personal tools