Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Reading Postgresql schemas and Omnis schemas

  • Reading Postgresql schemas and Omnis schemas

    Posted by Obonye on March 29, 2024 at 7:36 pm

    I have created schemas in my pg. database. The command below returns the columns if the schema I am reading is public:

    Do $schemas.[iSQLClassRef].$objs.$makelist($ref.$name,$ref.$primarykey) Returns lColsList

    But if the schema is not public, the columns are not returns. How do I read private pg. schema?

    Note:

    1. I have access to the private pg. schema

    2. The Omnis tableclass $sqlclassname property is defined pg_schemaname.pg_tablename

    3. pg. initial for PostgreSQL database

    • This discussion was modified 3 months, 2 weeks ago by  Obonye Mato.
    Andreas Pfeiffer replied 3 months, 2 weeks ago 2 Members · 5 Replies
  • 5 Replies
  • Andreas Pfeiffer

    Administrator
    April 1, 2024 at 12:02 pm

    Hi Martin,

    If using schema classes you would need to prefix the schema class name in the “server table or view” field of the schema class.

    The $sqlclassname property of the table class should take the name of the schema class.

    Hope this helps.

    Best,

    Andreas

    • Obonye

      Member
      April 1, 2024 at 4:39 pm

      How do I construct the sql select from statement? Will I need to prefix the table name with the schema name? and is the prefix name concrete in double quotes?

      • Andreas Pfeiffer

        Administrator
        April 1, 2024 at 5:05 pm

        Martin,

        it is probably easiest if you try the query build first to see how the correct syntax is and if it works from there.

        Then when using schema classes it is probably best if you use double quotes to describe schema and server table name within the schema class. For example something like “mySchema”.”myServerTable”

        These are double quotes not two single quotes.

        Hope this helps.

        Best,

        Andreas

        • Obonye

          Member
          April 1, 2024 at 7:20 pm

          Oh yes. It has loaded the data successfully after following your instructions double-qoutes. Very helpful @andreas-pfeiffer Thank you.

          • Andreas Pfeiffer

            Administrator
            April 2, 2024 at 6:53 am

            Great,

            Thank you for your feedback. I am glad it helped.

            Best,

            Andreas

Log in to reply.