-
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
Problems with boolean conversions - every record gets true value #38
Comments
This is not a misconfiguration or a bug, this is the PostgreSQL representation of boolean in COPY output. You will have t for true and f for false. In INSERT statement you will have 't' and 'f'. Regards |
Hi Darold, Thank you for your answer but we misunderstand each other.. I understand that the t represent a true but I don't understand why ALL the rows get a t while some of them should get a f... |
OK, sorry for the misunderstanding. If REPLACE_AS_BOOLEAN is a list of table_name:column_name there's no misconfiguration. The only things is that you don't need to add 1:0 to BOOLEAN_VALUES as it is defined per default. I don't see any bug in the code, what version of Ora2Pg are you using ? |
I'm using ora2pg-11.4 with an Oracle 10.2g I'm doing a oracle->file migration and then loading these to postgresql with psql. Could it make a difference if I copy directly to postgresql? Here is an example: Oracle DDL: Postgresql DDL: From ora2pg: REPLACE_AS_BOOLEAN am:br_ankomsttilladt am:br_afrejsetilladt am:lukket Data in oracle: "ENHED_ID" "ANTAL" "ANTALBOOKED" "DATO" "LUKKET" "BR_MINDAGE" "MANUELPRIS" "BR_ANKOMSTTILLADT" "BR_MAXDAGE" "BR_AFREJSETILLADT" Data in copy: COPY am (enhed_id,antal,antalbooked,dato,lukket,br_mindage,manuelpris,br_ankomsttilladt,br_maxdage,br_afrejsetilladt) FROM STDIN; As you can see "lukket" is false for all of the rows in oracle but has a t in copy. As stated earlier I get the same result for the text fields containing True:False and ja:nej. |
Thanks a lot Christian, your example helped a lot to find the bug. It is fixed now with commit 5edc4e5. Please download latest development code and give it a try. Best regards, |
That worked :) Thank you! |
I have a mixture of field types in oracle representing booleans:
I would like cleanup this mess during migrating and make them all into booleans.
I made a long list of fields like
REPLACE_AS_BOOLEAN periode:disabled kundeaftale:saetadressevedbooking billede:disabled virksomhedlink:disabled v_facilitetdef:gruppevisning ..................
and configured the value mapping as:
BOOLEAN_VALUES True:False 1:0 ja:nej
The fields are converted to boolean fields but in the generated copy file all the fields has a t for true.
Is this misconfiguration or a bug in ora2pg?
The text was updated successfully, but these errors were encountered: