-1

I am migrating this Oracle command to PostgreSQL:

GRANT CREATE SESSION  TO user;

Please suggest to me how I can migrate the above command.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
rashmi
  • 47
  • 1
  • 3
  • 8

1 Answers1

0

There are three steps:

  1. It has to be a login role

    ALTER ROLE theuser LOGIN;
    
  2. There has to be an entry in pg_hba.conf that matches the incoming connection by that user.

  3. The user has to have the CONNECT privilege on the database.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • CREATE USER username IDENTIFIED BY password; GRANT CREATE SESSION TO username; – rashmi Feb 22 '19 at 16:13
  • This is my oracle script.There is no database here to grant connect privilege in postgresql – rashmi Feb 22 '19 at 16:15
  • 1
    Different software works differently. Just because Oracle doesn't have database permissions (you don't need them in that architecture) doesn't mean it is the same in PostgreSQL. You cannot translate your script line by line. I showed you the hurdles you have to overcome to connect to PostgreSQL. The next one would be authentication. – Laurenz Albe Feb 22 '19 at 16:20
  • alter ROLE username WITH LOGIN; GRANT CONNECT ON DATABASE database_name TO user_name; – rashmi Feb 22 '19 at 16:34
  • do we have any grant for creating the table ,SEQUENCE,view ? – rashmi Feb 22 '19 at 17:27
  • Yes, we do. It is all described under `GRANT` in the documentation. – Laurenz Albe Feb 22 '19 at 17:41