1. Matt Kluzak
  2. PowerBuilder
  3. Monday, 1 August 2022 14:34 PM UTC

In my 2019R3 development environment I have a database profile setup to an ODBC connection defined for a postgres database. The schema for the tables in this database is in postgres instead of public.

The connection works, but I get a message saying, "Catalog tables could not be created and are not available for use." I resolve that by going into the System tab of the profile and setting the owner to postgres. At this point if I expand the profile view to list the tables, none of the tables are prepended by a schema. If i try to expand a table I get the message, "Table "NAME" has no columns; possible invalid table format."

If I try to preview data in a datawindow, using this connection, I get an error saying:

"Select Error: SQLSTATE = 42P01

ERROR: relation "NAME" does not exist;

Error while preparing parameters"

 

I think I had previously resolved such an issue by specifying a parameter in the "Connect Settings" on the ODBC connection that told it which schema to use, but I am unable to get it figured out again.

Could someone please assist me in getting this working?

Thanks

Accepted Answer
Olan Knight Accepted Answer Pending Moderation
  1. Monday, 1 August 2022 16:44 PM UTC
  2. PowerBuilder
  3. # Permalink

Here's how I am set up using ODBC to connect to a PG database:

1. Install the PG driver onto your platform.
    - For us it was the EDB driver:  psqlodbc_12_02_0000-x86 - odbc driver.zip, downloaded from the EDB website.


2. Create a System DSN using the PG driver





3. Create a Profile in PB (both in 12.1 and in 2019R3)


For us, the PB Catalog Tables are located in the "chadba" schema.



UNcheck the "Enclose in quotes" and the "TRIM" options below.






Click TEST CONNECTION:

Comment
  1. Matt Kluzak
  2. Monday, 1 August 2022 18:09 PM UTC
Thanks Olan. You had a couple different options that I originally didn't - such as disable bind for transactions and to not enclose table and column names in quotes for syntax - but what ended up getting it to work was installing the driver you had. I must have had an outdated ODBC driver.



Thanks!
  1. Helpful
  1. Olan Knight
  2. Monday, 1 August 2022 19:12 PM UTC
Excellent! Glad you got it working!
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.