Table structure needed to save report in db

  • saphire

    saphire - 2005-04-30


    I want to save prepared OpenRPT report into PostgreSQL database but OpenRPT needs "relation". What tables do I need to create and with what structure?

    • Chris Ryan

      Chris Ryan - 2005-05-01

      At a minumum you need a table called report with with the following information:

      create table report (
        report_id serial primary key, -- unique id (must be auto assigned)
        report_name text, -- the name of the report on the database
        report_descript text, -- a description of the report on db.
        report_grade integer not null, -- a positive integer (rank with higher number equals better)
        report_source text -- the xml text of the document

      The report renderer will take a name and try to load a report from the database with that name that has the highest grade. This allows multiple versions of a report to be on a database at a given time with the same. For software vendors it can be used as a means for customers to customize database reports while allowing the vendor to be able to upgrade reports without overwritting a customers changes.

  • Rickey Rollins

    Rickey Rollins - 2016-02-10

    What tables are needed to store the metasql queries tot the database?

  • Gil

    Gil - 2016-02-12


    You need the MetaSQL table:

    CREATE TABLE metasql (
        metasql_id serial primary key,
        metasql_group text,
        metasql_name text,
        metasql_notes text,
        metasql_query text,
        metasql_lastuser text,
        metasql_lastupdate date,
        metasql_grade integer DEFAULT 0 NOT NULL
    ALTER TABLE ONLY metasql
        ADD CONSTRAINT metasql_metasql_group_name_grade_key UNIQUE (metasql_group, metasql_name, metasql_grade);
    Last edit: Gil 2016-02-12

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks