Skip to content

Postgresql Datastores

Etienne Dublé edited this page Sep 29, 2017 · 4 revisions

This page describes how a postgresql datastore attached to a daemon (i.e. referenced in the daemon's configuration file) is managed in Sakura.

The code of the postgresql db driver and the hub code saving metadata in the central db follow these principles.

User and rights management

For security reasons, users and rights are configured right into the postgresql service. A sakura user with login <user> is mapped to a postgresql user sakura_<user>.

User rights are implemented as follows:

User right Implementation
datastore read access (i.e. connect there) sakura_<user> exists
datastore write access (i.e. create databases there) sakura_<user> has CREATEDB grant
database read access sakura_<user> has CONNECT privilege on this database
database write access sakura_<user> has CREATE grant on this database
database ownership sakura_<user> is OWNER of this database

Metadata management

Metadata not involved in data processing is stored in the Hub's central database.

Database-related Metadata

metadata type Implementation Default value
database name centraldb.Database.name field postgresql db name
database short description centraldb.Database.short_desc field none
database creation date centraldb.Database.created field none
database tags centraldb.DatabaseTags table none
database contacts centraldb.DatabaseContacts table The database owner

Table-related Metadata

metadata type Implementation Default value
table name centraldb.DBTable.name field postgresql table name
table short description centraldb.DBTable.short_desc field none
table creation date centraldb.DBTable.created field none

Column-related Metadata

metadata type Implementation Default value
column tags centraldb.DBColumnTags table none