Comments (6)
Hi,
Yes this is right, system auto-generated constraint are not exported, just because they are also auto-generated with PostgreSQL. Is there's any constraint that you think must be exported and that are not?
Best regards,
from ora2pg.
Well, problem is that those CHECKS where created by the user in Oracle, but as they assigned no name, Oracle created a name. For example, creating a table in Oracle this way
create table myTable (
record_id number(10) not null,
is_active char(1) check (is_active in ('Y', 'N'))
);
with or2pg I get
CREATE TABLE mytable (
record_id numeric(10) NOT NULL,
is_active char(1)
);
and the CHECK constraint does not show up :(
Best regards.
from ora2pg.
That's right this kind constraint was not exported, it is not fixed in commit c4df0c4. There's still some work to do to export those constraints into the create statement instead of ALTER command.
Thanks for your report.
from ora2pg.
Thanks to you for your attention to this one, and glad to being helping :)
Regards.
from ora2pg.
If it is of any help, I've used this SQL to get all the CHECK constraints, even the ones with SYS_ on the name:
drop table const_check;
create table const_check as
select constraint_name, table_name, to_lob(search_condition) as condition
from user_constraints
where constraint_type = 'C';
select * from const_check where condition not like '%NULL';
select 'alter table ' || table_name ||' add constraint '||
constraint_name ||' CHECK('||condition||');'
from const_check
where table_name not like 'BIN%'
and condition not like '%NULL' and constraint_name like 'SYS_%';
from ora2pg.
Ora2Pg use this one:
SELECT CONSTRAINT_NAME, R_CONSTRAINT_NAME, SEARCH_CONDITION, DELETE_RULE, DEFERRABLE, DEFERRED, R_OWNER, TABLE_NAME ,OWNER
FROM ALL_CONSTRAINTS WHERE CONSTRAINT_TYPE='C' AND STATUS='ENABLED'
the previous bug comes from the additional condition: AND GENERATED != 'GENERATED NAME', this is what I'd removed from the SQL query.
from ora2pg.
Related Issues (20)
- Enhance DATA_EXPORT_ORDER with custom order of Tables.
- Unwanted NOT NULL constraint
- Data validation through FDW
- Error in tempfile() using /tmp/tmp_ora2pgXXXXXX: Could not create temp file /tmp/tmp_ora2pg4CEPen: Too many open files at /usr/share/perl5/vendor_perl/Ora2Pg.pm line 8711
- Assessment report via ora2pg HOT 1
- Schema for Default partition is not dumped while using the RENAME_PARTITION
- Clarification HOT 4
- [BUG] Procedure not converting properly using Ora2pg 24.1 (MSSQL Server - Postgresql) HOT 1
- [NICE2HAVE] line-continuation character for config-file HOT 1
- CREATE TABLE DDL in schema dump of Oracle for List Partitions is not correct HOT 1
- not sure if this is an issue \N HOT 1
- psql:./schema/tables/table.sql:625: ERROR: syntax error at or near what -- missing comma HOT 2
- Ora2Pg migration Speed reducing after 20-30 mins of migration start time. HOT 1
- Error while running DBD::Oracle > make: *** [Makefile:524: blib/arch/auto/DBD/Oracle/Oracle.so] Error 1 HOT 1
- Ora2pg scanner HOT 1
- while doing INSERT, ST_GEOMETRY() is applied to non-spatial columns, resulting in syntax error, since SRID parameter is empty
- [Urgent Question] NON DBA Account to generate report and export HOT 1
- Option for ALTER TABLE ADD CONSTRAINT being in a separate file HOT 2
- ERROR: out of memory DETAIL: Cannot enlarge string buffer containing 1073741808 bytes by 8191 more bytes. CONTEXT: COPY TABL, line 95ERROR: out of memory DETAIL: Cannot enlarge string buffer containing 1073741808 bytes by 8191 more bytes. CONTEXT: HOT 10
- Include validation count for public procedural code within Packages - Oracle_PostgreSQL.
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.