Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgresql support #5

Closed
freeplant opened this issue Nov 15, 2012 · 10 comments
Closed

Postgresql support #5

freeplant opened this issue Nov 15, 2012 · 10 comments
Assignees
Milestone

Comments

@freeplant
Copy link
Member

No description provided.

@DavidJFelix
Copy link

Before anyone goes out of their way to add support for another SQL backend, I'd like to point out that there's a library that abstracts db interaction called "OpenDBX" that has support for the following databases:

PostgreSQL
MySQL/MariaDB
Sqlite
Sqlite3
Oracle
MS SQL

--Planned--
IBM DB2 (in development)
Informix
Ingres

So rather than managing support for 3 different database backends, perhaps the change should be to 1 abstraction library. This not only provides you with an easier means of maintaining the beloved open source DBs but it also accidentally provides the application with support for the evil closed source databases that may be forced upon good people who want to use seafile in their company.

@killing
Copy link
Member

killing commented Nov 21, 2012

Seafile uses libzdb to abstract DB access. libzdb supports sqlite3, postgresql, mysql, and oracle. Since Seafile server currently only supports Linux, MS SQL is not considered.

@DavidJFelix
Copy link

Awesome. It seems a bit more active than openDBX. I frankly don't care about MS SQL, but I know some people do, and since the DB could be on any server, it's not out of the realm of possibility. Thanks for introducing me to a new library though.

One question though... if Seafile uses libzdb, why is this issue open? Doesn't libzdb provide the interface to Postgres? Does Seafile not support Postgres or does it?

@killing
Copy link
Member

killing commented Nov 21, 2012

Yeah, but I don't know whether MS provides a client library for Linux or not...

We still need to add a few config options ;)

@DavidJFelix
Copy link

MSSQL should have an ODBC or JDBC interface which is the standard that OpenDBX uses to connect to its supported databases, I'm not sure about libzdb. Typically adding support for a new DB in these DB abstraction libraries entails creating a DB specific ODBC/JDBC interface that handles the database oddities, adding configuration to allow people to tell the library that this is the type of DB they're connecting to, then documenting the differences between that DB and other supported databases so that people know how to write SQL that is agnostic to the feature differences between the databases they wish to support. Again, the only real benefit to having MSSQL support is that your application can be used in corporations that have a strict MSSQL requirement. I don't honestly see much benefit in using MSSQL vs MySQL, but apparently there are business reasons to do so.

BTW, great project! I'm really enjoying using it so far - it runs pretty well on Amazon EC2.

@killing
Copy link
Member

killing commented Nov 22, 2012

If many people need to use MSSQL, we may consider switch to OpenDBX. But it's not an issue now.

Thank you for feedback! Let us know if you have any problem.

@hadret
Copy link

hadret commented Feb 4, 2013

Hi guys,

Getting back to PostgreSQL support, is it actually supported by Seafile v1.4.5? I was trying to play with it a little bit and here's my configuration:

# ccnet/ccnet.conf
[Database]
ENGINE=postgresql
HOST=localhost
USER=seafile
PASSWD=$password
DB=ccnet-db
UNIX_SOCKET=/var/run/postgresql/.s.PGSQL.5432

# data/seafile.conf
[database]
type=postgresql
host=localhost
user=seafile
password=$password
db_name=seafile-db
unix_socket=/var/run/postgresql/.s.PGSQL.5432

# seafile/seahub_settings.py
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'USER': 'seafile',
        'PASSWORD': '$password',
        'NAME': 'seahub-db',
        'HOST': '/var/run/postgresql/.s.PGSQL.5432',
    }
}

I checked, that all the configuration is properly set, database and user exists and password is correct. Socket file also does exist, so IMO there's absolutely no issue on database side. However, when trying to launch ./seafile.sh start I get following output:

Starting seafile server, please wait ...
Seafile server started

Starting seafile httpserver, please wait ...
Failed to start httpserver server

So Seafile pretty much fails to start. I tried to python manage.py syncdb for seahub and it worked, but this doesn't change a thing, cause seafile is required for seahub to work.

Have you got any idea/suggestions, what can be done, to solve the issue? I was searching for log files under seafile-server-1.4.5/runtime, but haven't found any...

@freeplant
Copy link
Member Author

Seafile server doesn't not recognize "type=postgresql" yet.

We only have MySQL support now. We can add Postgresql support in version 1.5 if we have time, otherwise we will delay it to version 1.6.

@hadret
Copy link

hadret commented Feb 4, 2013

Alright, thanks a lot for such fast response! (:

@emanfantastic
Copy link

Sweet! It looks like adding PostgreSQL support is moving forward based on the activity in the pgsql branch. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants