1

I am new in developing Cobol programs in Linux environment.

My problem is that I create a table in PostgreSql and I am trying to connect to that table. The connection was sucessful and the sqlcode = 0. But, when I try to make a selection i receive the sqlcode = -0000000007 and the message:

SQLERRMC: ERROR: permission denied for relation minha;

Minha is my table. My connection string is:

01 dsn pic x(300) value "Driver={PostgreSQL}; - "Server=127.0.0.1;Port=5432;Database=orlandodb; - "Uid=postgres;"

Can anyone suggest how I can query the table?

Robin Mackenzie
  • 18,801
  • 7
  • 38
  • 56
orlando
  • 61
  • 3
  • Possible duplicate of [ERROR: permission denied for relation tablename on Postgres while trying a SELECT as a readonly user](http://stackoverflow.com/questions/13497352/error-permission-denied-for-relation-tablename-on-postgres-while-trying-a-selec). You need to GRANT read privileges (USAGE, SELECT, etc) to the table and schema. – paulsm4 Dec 30 '16 at 16:28
  • thanks for the response, however my table was created with the postgres user and the schema is public. it is a simple test to see how it works. the select stament is:EXEC SQL SELECT cliente, numseq INTO :R-CODCLI-TCTIT, :R-NUMSEQ-TCTIT FROM minha WHERE cliente = '12345678' AND numseq = '000001' END-EXEC. – orlando Dec 30 '16 at 17:35

1 Answers1

0

Check your credentials, does your user have access to the db and table?

You may do it in another application like PgAdmin or alike.

Eugene Lisitsky
  • 12,113
  • 5
  • 38
  • 59