Installation on PostgreSQL

From XBRLWiki
Jump to: navigation, search


  • PostgreSQL database engine installed either on the local computer or in a server that can be reach over the network.
  • PostgreSQL version must be 8.2 or greater.
  • User with enough privileges to create tables and create indexes in the tablespace designated for the XBRL Database.
  • We recommend all users to have password protection.


  1. Connect to the PostgreSQL database using the pgAdmin tool and create a login role for a new user called XBRLUSER with password XBRL make sure the user has the Create Databases privilege check box marked. Disconnect from the current user and connect to the database using the new user. Then, create a new database called TBXBRL. The user name, password and database name on this example are not hard coded on the tool. You can use your own policy for creating user names, passwords and database names. Even more, we don't recommend you to use the example names provided here in a production installation.
  2. Annotate the assigned user name and password for connecting to the PostgreSQL Database. In our example the user name will be XBRLUSER and the password will be XBRL. The user XBRLUSER must have privileges to create tables at least the first time the user connect to the database. The XBRL Data model is unique and stable. No tables are created for new taxonomies stored. The same data model (star data model) applies to all taxonomies and reports stored into the XBRL Database.
  3. Open XBRLizer or XBRLviewer and do File -> XBRL Database -> DB Settings
    The following dialog appears
  4. Click on the PostgreSQL button on the right. This will change the value of the Diver class text field and the value of the Dialect field. A dialog box would tell you more information related with settings for the PostgreSQL database. The information in that dialog is also on this walkthrough.
  5. Change the value of the User and Password fields. The user will be XBRLUSER and the password will be XBRL in this walkthrough.
  6. Change the value of the URL text box according to the following format:
    • Substitute {server} with the server name or IP address of the computer where the PostgreSQL database is installed. If this is the same computer where Reporting Standard tools are installed you can use the name localhost or the IP address
    • Substitute {tablespace} with the tablespace name created on the first step TBXBRL.
    Contact you PostgreSQL Administrator for more information about the connection URL. Read documentation about PostgreSQL JDBC driver for more information about additional parameters on the URL.
  7. Click on (Test connection) button. If the connection can be established with the database, then all parameters are OK. In case of any errors you will be informed about the error condition. Please check the error message and correct the content of the User, Password or URL fields. Contact our support department in case of technical problems you don't know how to solve.
  8. At this time, the button (Drop & Create DB) changed from disabled status to enabled status. Click on that button in order to create the table model on the database.
  9. (Optional) if you made changes to the data model on your own, there is a chance the changes are not compatible with the XBRL storage procedure. In order to guarantee the compatibility of the data model we provide a button that validates if the data model is compatible with the XBRL data model. At this stage most users don't need to validate the data model, but clicking on the Validate DB Structure will not hurt.
  10. Click on Exit. The database model has been created and it is ready for storing XBRL reports, taxonomies and linkbases.

Congratulations, you have the XBRL Database installed on PostgreSQL Database!

Server configuration for PostgreSQL 9.0 or greater

Some of the fields from the data model make use of the bytea data type. The bytea type supports two external formats for input and output: PostgreSQL's historical "escape" format, and "hex" format. Both of these are always accepted on input.
The output format depends on the configuration parameter bytea_output; the default is hex. In order to get the server properly set the parameter bytea_output must be changed to "escape".
One way to set this parameter is to edit the file postgresql.conf, which is normally kept in the data directory. Open the postgresql.conf with your text editor, find the bytea_output parameter and assign the 'escape' value to it:

bytea_output = 'escape'


Main Page | Installing the XBRL Database