-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export_sequence should recognize create_schema config #1813
Comments
Sequences need sometimes to be created before the tables because they are used. Actually the schema creation use |
|
Right, but I normally the user importing sequences or other objects migrated by Ora2Pg might be the database owner or have enough privileges to create a schema. What is your use of Ora2Pg? |
We would like to migrate various databases from Oracle to Postgres. In our organization, only DBAs can create schemas (for compliance reasons; we work with sensitive data and there are many separations of power). So the DBA creates the schema and a user account, and then someone else (me in this case) has access to create tables and other objects, insert data, etc. within that schema, as that user. |
When
CREATE_SCHEMA
config is disabled, the sequence export still tries to create the schema, resulting in a permission failure if the Postgres user can't create the schema. This is an issue in environments where the person using Ora2Pg has rights to create tables etc. and insert data, but not create schemas (schema creation is done by a DBA, for example).This should be an easy fix by changing lib/Ora2Pg.pm:5472 from:
if ($self->{export_schema} && ($self->{pg_schema} || $self->{schema})) {
to
if ($self->{export_schema} && $self->{create_schema} && ($self->{pg_schema} || $self->{schema})) {
The text was updated successfully, but these errors were encountered: