db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vignesh Swaminathan" <vswam...@cordys.com>
Subject RE: Two errors with create/alter database SQL in PostgreSQL 8.1
Date Wed, 15 Feb 2006 09:11:21 GMT
> Second,
>
> When alter table is used with alter column switched on, a series of 
> syntax error messages pop from PostgreSQL 8.1. However the alter is 
> executed fine as the continue on error flag was on. The details are,

Please post the stacktraces.

Tom

-----

As replied earlier the alterations in the PostgreSQLBuilder is a
solution, following is the code snippet from PostgreSQLBuilder.java
which provides the fix.

public void writeColumnAlterStmt(Table table, Column column, boolean
isNewColumn) throws IOException
    {
        writeTableAlterStmt(table);
        print(isNewColumn ? "ADD " : "ALTER ");
        if(isNewColumn) 
        		writeColumn(table, column); 
		else
			writeAlterColumn(table, column);
        printEndOfStatement();
    }

protected void writeAlterColumn(Table table, Column column) throws
IOException
    {
        //see comments in columnsDiffer about null/"" defaults
        printIdentifier(getColumnName(column));
        print(" TYPE ");
        print(getSqlType(column));

	  ... Rest of the code similar to writeColumn method of
SQLBuilder
    }

<vignesh/>

***************************************************************************************************
The information in this message is confidential and may be legally  privileged. 
It is intended solely for the addressee. Access to this message by anyone else is 
unauthorized. If you are not the intended recipient, any disclosure, copying, or 
distribution of the message, or any action or omission taken by you in reliance 
on it is prohibited and may be unlawful. Please immediately contact the sender if 
you have received this message in error. This email does not constitute any 
commitment  from Cordys Holding BV or any of its subsidiaries except when 
expressly agreed in a written agreement between the intended recipient and 
Cordys Holding BV or its subsidiaries.
 ***************************************************************************************************


Mime
View raw message