Comments (9)
There's already something like that, see MODIFY_STRUCT in configuration file.
For example if you have a table in Oracle named table1 with 3 columns named col1, col2 and col3 and you just want to export data from col1 and col3:
MODIFY_STRUCT TABLE1(col1,col3)
It doesn't matter if the col2 column exist or not in the destination table.
You can set a list of such modified tables separated by space.
Regards,
from ora2pg.
According to the documentation this only works for data export - not ddl export?
The unused columns might have an NOT NULL so I can't read the data into postgresql if a column i striped from the data but not ddl.
Another question: can this option be used to rearrange the order of columns in postgresql? I learned during migration that I get a more efficient storage if small columns (like boolean columns) are next to each other.
So can I rearrange an oracle table like mytable(number(19,0) c1, number(1,0) c2, varchar2(3) c3, number(1,0) c4) into a postgresql table like mytable(integer c1, varchar(3) c3, boolean c2, boolean c4) with MODIFY_STRUCT mytable(c1, c3, c2, c4)?
from ora2pg.
When I said "It doesn't matter if the col2 column exist or not in the destination table.", obviously, this require that the column doesn't have a NOT NULL constraint.
This directive is only used for data export because it is very simple to add an "alter table ... drop column ..." after your schema import. There's no need to include that into ora2pg.
No, there's no option to rearrange columns order in postgresql, but this can be a new feature. I will see if that can be done easily. Using MODIFY_STRUCT you can just specify the columns that will be used to export/import data.
from ora2pg.
Hi Christian,
The feature of reordering columns following alignment is now included in last release v12.0 that was just published today. It can be downloaded at https://sourceforge.net/projects/ora2pg/.
Thanks for the feature request.
Best regards,
from ora2pg.
So in total there is no way to exclude columns? I am using TABLE
migration type and when I deifned:
MODIFY_STRUCT my_table(col1, col3)
The col2
is still here after migration. So only reordering is supported?
P.S. ora2pg is v18.1
from ora2pg.
The MODIFY_STRUCT is only available with data export to adapt to any schema transformation. But I think that with some additional work it could be available for tables/indexes/constraints export.
from ora2pg.
So could I create new task for this or reopen current task?
from ora2pg.
I've reopen it, thanks.
from ora2pg.
Commit 2315983 allow use of MODIFY_STRUCT with TABLE export. Table creation DDL will respect the new list of columns and all indexes or foreign key pointing to or from a column removed will not be exported.
Another question: can this option be used to rearrange the order of columns in postgresql? I learned during migration that I get a more efficient storage if small columns (like boolean columns) are next to each other.
I've forgotten to answer to this question, for automatic reordering by ora2pg you just have to enable the REORDERING_COLUMNS configuration directive in ora2pg.conf. It must be a bit too late, but can be useful for later use and other users.
from ora2pg.
Related Issues (20)
- Views with "where" clause and comparators don't export properly in MYSQL HOT 1
- An option to unset "check_function_bodies = false;" when not using the .conf file? HOT 1
- Automatic updating for TIMESTAMP and DATETIME in MySQL HOT 1
- Altered triggers are migrated incorrectly HOT 4
- Unsigned decimal types in MYSQL don't export properly HOT 1
- Procedures only get exported when written in a particular format in MYSQL HOT 2
- Constraints with IS NOT NULL that are NOT VALIDATED are not correctly defined when using type TABLE HOT 2
- Parsing of INT type in MYSQL HOT 3
- Real row count with schema not working anymore on 23.2 HOT 2
- Variation of "trunc" function in Oracle and Postgres for "timestamp" columns HOT 1
- TEST_COUNT (and --count_rows) using default schema instead of PG_SCHEMA HOT 1
- X-Post: Extra DDL formations in PARTITION_INDEXES_partition.sql in MYSQL HOT 1
- Error converting %ROWCOUNT clause from oracle to pg HOT 1
- Errors that still persist after installing ora2pg version 23.2 HOT 1
- Text type columns with default value don't export properly in MYSQL HOT 2
- Wrong conversion of XMLCDATA function in ora2pg HOT 1
- Greater than 500MB and less than 1GB BLOB DATA Migration Issues HOT 1
- Problems converting UTL_RAW.CAST_TO_RAW from oracle to equivalent PG encode. HOT 1
- The converted code is issuing a syntax error when the original one owns '(+)', the Oracle native symbol. HOT 1
- UTF-8 encoding error HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ora2pg.