Menu

#3 Process 'Synchronize Column' failed

open-accepted
PostgreSQL (7)
5
2005-07-15
2005-07-06
|gun|th|er|
No

Hi,

if i try to create a new column in a existing table,
using the 'Table and Column' window, i reached an error
(see error log). The error occurs when i start the
process 'Synchronize Column' (at the column tab). The
sql statement 'CREATE TABLE ...' seems to be incorrect
to me at this place, because the table already exists.
I would expect something like 'ALTER TABLE ...' here.

Regards
Gunther Hoppe

Error log:
===========> DB.executeUpdate: Update=CREATE TABLE
C_Project (AD_Client_ID NUMERIC(10) DEFAULT
@#AD_Client_ID@ NOT NULL, AD_Org_ID NUMERIC(10) DEFAULT
@#AD_Org_ID@ NOT NU
LL, AD_User_ID NUMERIC(10) DEFAULT -1, C_BPartner_ID
NUMERIC(10), C_BPartner_Location_ID NUMERIC(10),
C_Campaign_ID NUMERIC(10), C_Currency_ID NUMERIC(10)
NOT NULL, C_Pay
mentTerm_ID NUMERIC(10), C_Phase_ID NUMERIC(10),
C_ProjectType_ID VARCHAR(22), C_Project_ID NUMERIC(10)
NOT NULL, CommittedAmt NUMERIC NOT NULL, CommittedQty
NUMERIC NOT
NULL, CopyFrom VARCHAR(1), Created TIMESTAMP NOT NULL,
CreatedBy NUMERIC(10) NOT NULL, DateContract TIMESTAMP,
DateFinish TIMESTAMP, Description VARCHAR(255), GenerateTo
VARCHAR(1), InvoicedAmt NUMERIC NOT NULL, InvoicedQty
NUMERIC NOT NULL, IsActive CHAR(1) DEFAULT Y CHECK
(IsActive IN ('Y','N')) NOT NULL, IsCommitCeiling
CHAR(1) CHECK (
IsCommitCeiling IN ('Y','N')) NOT NULL, IsCommitment
CHAR(1) CHECK (IsCommitment IN ('Y','N')) NOT NULL,
IsSummary CHAR(1) CHECK (IsSummary IN ('Y','N')) NOT
NULL, M_Pric
eList_Version_ID NUMERIC(10), M_Warehouse_ID
NUMERIC(10), Name VARCHAR(60) NOT NULL, Note
VARCHAR(2000), POReference VARCHAR(20), PlannedAmt
NUMERIC NOT NULL, PlannedMarg
inAmt NUMERIC NOT NULL, PlannedQty NUMERIC NOT NULL,
Processed CHAR(1) CHECK (Processed IN ('Y','N')) NOT
NULL, Processing VARCHAR(1), ProjectBalanceAmt NUMERIC
NOT NULL,
ProjectCategory CHAR(1) DEFAULT N, SalesRep_ID
NUMERIC(10), Test CHAR(1), Updated TIMESTAMP NOT NULL,
UpdatedBy NUMERIC(10) NOT NULL, Value VARCHAR(40) NOT
NULL, CONSTRA
INT C_Project_Key PRIMARY KEY (C_Project_ID)) [null] [63]
java.sql.SQLException: ERROR: relation "c_project"
already exists; State=42P07; ErrorCode=0
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:282)
at
sun.reflect.GeneratedMethodAccessor28.invoke(Unknown
Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.postgresql.ds.common.PooledConnectionImpl$StatementHandler.invoke(PooledConnectionImpl.java:467)
at $Proxy1.executeUpdate(Unknown Source)
at
org.compiere.util.CPreparedStatement.executeUpdate(CPreparedStatement.java:157)
at org.compiere.util.DB.executeUpdate(DB.java:691)
at
org.compiere.process.ColumnSync.doIt(ColumnSync.java:101)
at
org.compiere.process.SvrProcess.process(SvrProcess.java:93)
at
org.compiere.process.SvrProcess.startProcess(SvrProcess.java:77)
at
org.compiere.apps.ProcessCtl.startProcess(ProcessCtl.java:442)
at
org.compiere.apps.ProcessCtl.run(ProcessCtl.java:225)

Discussion

  • Victor Perez Juarez

    Logged In: YES
    user_id=332830

    error replicated, we are reviewing if this happens with
    Oracle too, at a first sight this problem is in a class of
    Compiere org.compiere.process.ColumnSync

    Cheers
    Victor

     
  • Victor Perez Juarez

    • labels: --> PostgreSQL
    • assigned_to: nobody --> vpj-cd
    • status: open --> open-accepted
     
  • Carlos Ruiz

    Carlos Ruiz - 2005-10-25

    Logged In: YES
    user_id=1180760

    Solved:
    In org.compiere.process.ColumnSync
    Added convert tablename to lowercase for use in postgres

    After:

    if (DB.isOracle())
    tableName = tableName.toUpperCase();

    Added:
    // globalqss 2005-10-24
    if (DB.isPostgreSQL())
    tableName = tableName.toLowerCase();
    // end globalqss 2005-10-24

     
MongoDB Logo MongoDB