Expected result The column synchronizes with a successful message like:
Process completed successfully
INSERT INTO t_alter_column values('C_Order','PaymentRule','CHAR(1)',null,'B'); UPDATE C_Order SET PaymentRule='B' WHERE PaymentRule IS NULL
0 INSERT INTO t_alter_column values('C_Order','PaymentRule','CHAR(1)',null,'B')
0 UPDATE C_Order SET PaymentRule='B' WHERE PaymentRule IS NULL
Actual result An error message is shown: Error: org.postgresql.util.PSQLException: ERROR: column "b" does not exist Position: 32 0 ALTER TABLE C_Order MODIFY PaymentRule CHAR(1) DEFAULT B
After debugging the generated SQL is "PaymentRule CHAR(1) DEFAULT B NOT NULL" without single quotes around the B, which causes the issue.
This can also be reproduced by copying a table with a String default logic and running Synchronize column
Environment
None
Activity
Carlos Ruiz
November 20, 2020 at 11:06 PM
After analyzed the case - the problem seems to be related just to columns with reference Payment
I tested this locally or in https://test.idempiere.org/webui/ with the same result.
Steps to reproduce:
Login as System
Open the Table and Column Window
Open to the C_Order record
Navigate to Columns > Payment Rule
Click the Synchronize Column Window
Expected result
The column synchronizes with a successful message like:
Process completed successfully INSERT INTO t_alter_column values('C_Order','PaymentRule','CHAR(1)',null,'B'); UPDATE C_Order SET PaymentRule='B' WHERE PaymentRule IS NULL 0 INSERT INTO t_alter_column values('C_Order','PaymentRule','CHAR(1)',null,'B') 0 UPDATE C_Order SET PaymentRule='B' WHERE PaymentRule IS NULL
Actual result
An error message is shown:
Error:
org.postgresql.util.PSQLException: ERROR: column "b" does not exist Position: 32
0 ALTER TABLE C_Order MODIFY PaymentRule CHAR(1) DEFAULT B
After debugging the generated SQL is "PaymentRule CHAR(1) DEFAULT B NOT NULL" without single quotes around the B, which causes the issue.
This can also be reproduced by copying a table with a String default logic and running Synchronize column