Menu

Error in postgres database example

Anonymous
2022-03-07
2022-03-25
  • Anonymous

    Anonymous - 2022-03-07

    Dear, I made the example of a database with postgres, but it is giving this error below:
    How to solve this?

    Celso

     
    • Brian Tiffin

      Brian Tiffin - 2022-03-13

      With your current setup, Celso, can you get a connection with the PostgreSQL command line client? Something like

      prompt$ psql -U postgres

      -402 is a connection issue. Something somewhere. I usually start by going over the pg_hba.conf file and ensuring the server is allowing connectivity from the client node to the server side.

      Make sure you can use the psql command from the client node. If you can, then we can discuss the ESQL layer part and see if that is the issue,

      Cheers,
      Blue

       
      • Anonymous

        Anonymous - 2022-03-14

        Dear Cheers.

        I'm terrible at installing and configuring anything. but after a lot of discussion about the reason for the error, I found out that the USER of postgreSQL did not have permission to use it, it was just a matter of giving the permission to use it, which worked again. Taking advantage of this, I would like to ask another question: Does this example Database for postgreSQL only work with the "GnuCOBOL-3.1-rc1-BDB-M64" version? Or it works with the latest version "GnuCOBOL-3.1.2-M64-BDB".

        Celso

         
        • Brian Tiffin

          Brian Tiffin - 2022-03-17

          Won't matter, Celso. The outputs from the PostgreSQL ESQL preprocessor should work in pretty much any GnuCOBOL release.

          Have good,
          Blue

           
          • Simon Sobisch

            Simon Sobisch - 2022-03-17

            Note as Celso had linked the FAQ entry which lists ocesql from japan first - I'd highly recommend to not use it for any new setup and go with its successor instead: GixSQL.

            Reasoning:
            * GixSQL is maintained, OCESQL isn't
            * OCESQL has severe memory issues for COMP-3 (the SIGSEGV kind...)
            * OCESQL does a lot of not necessary memory allocations/deallocations
            * OCESQL needs partially syntax that no one other uses while not being able to parse EXEC SQL code from other precompilers
            * OCESQL has very bad error handling (like "I don't know how to do with that so I just don't copy it over" and "SYNTAX ERROR" [figure out what's wrong yourself...])
            * GixSQL has the possibility to not only use a direct PostgreSQL binding but also supports direct MySQL/MariaDB and ODBC calls
            * GixSQL also ships binaries (I'm not interested in this, but others likely are)

            There's only one downside: it is using "modern" C++2017 code, so you need a compiler that supports this "well enough", which in its current form without patches means GCC 8+ (not available "out of the box" on some systems).

             
  • celsofigueiredo

    celsofigueiredo - 2022-03-17

    Dear.
    I use GNUcobol, in linux Ubuntu and windows 11, I tested the Database example in postgreSQL, both in linux and in windows with the GNUcobol version "GnuCOBOL-3.1-rc1-BDB-M64", with this version everything worked correctly , both on linux and windows.
    But when I went to test the GNUcobol version "GnuCOBOL-3.1.2-M64-BDB", on linux everything went right, but when I went to test on windows11, it gave the following error:

    This error appeared when I pressed F1, to connect to the Database.

     
    • Brian Tiffin

      Brian Tiffin - 2022-03-17

      Sorry, too many variables in play, and not enough context on what the error is here, Celso.

      It's handy to try the psql client to see if there are issues with environments, and what not.

      Have good,
      Blue

       
  • celsofigueiredo

    celsofigueiredo - 2022-03-17

    Brian,
    I tested psql, and no errors. The interesting thing about all this is that this error only happens with windows. I could not understand why in version 3.0.1.rc, there is no error and GNUcobol in version 3.1.2, this type of error occurs. This only happens with windows 11.

     
  • celsofigueiredo

    celsofigueiredo - 2022-03-24

    Brian,
    I found out why the error above, the problem occurred because of setting the variables wrongly, I confused between "cobenv.cmd and set_env.cmd". After I changed and corrected the example above, it worked. That's why I say, "I'M A LEFT ZERO REGARDING CONFIGURING ANYTHING."

     
    • Brian Tiffin

      Brian Tiffin - 2022-03-25

      Nice to hear about the win. And I'll re-iterate, you are likely being too hard on your self, Celso. ;-) You got it to work. That's win.

      Cheers,
      Blue

       

Anonymous
Anonymous

Add attachments
Cancel