You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Stefan Huber (JIRA)" <ji...@apache.org> on 2007/03/20 15:47:32 UTC

[jira] Created: (DDLUTILS-165) Data type mismatch in PostgreSQL with TEXT columns

Data type mismatch in PostgreSQL with TEXT columns
--------------------------------------------------

                 Key: DDLUTILS-165
                 URL: https://issues.apache.org/jira/browse/DDLUTILS-165
             Project: DdlUtils
          Issue Type: Bug
          Components: Core - PostgreSql
         Environment: PostgreSQL v2.8.3 on Windows with JDBC driver 'postgresql-8.2-504.jdbc3.jar'
            Reporter: Stefan Huber
         Assigned To: Thomas Dudziak


The PostgreSql jdbc driver returns VARCHAR(2147483647) for columns defined as TEXT. The ModelReader expects VARCHAR(-1) for these data type. 
Maybe the behaviour of the jdbc driver changed lately, because there is a comment in the PostgreSqlModelReader.readColumn method which says that PostgreSQL returns VARCHAR(-1), but in my environment i get VARCHAR(2147483647).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DDLUTILS-165) Data type mismatch in PostgreSQL with TEXT columns

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DDLUTILS-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Dudziak updated DDLUTILS-165:
------------------------------------

    Fix Version/s: 1.0

> Data type mismatch in PostgreSQL with TEXT columns
> --------------------------------------------------
>
>                 Key: DDLUTILS-165
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-165
>             Project: DdlUtils
>          Issue Type: Bug
>          Components: Core - PostgreSql
>         Environment: PostgreSQL v2.8.3 on Windows with JDBC driver 'postgresql-8.2-504.jdbc3.jar'
>            Reporter: Stefan Huber
>         Assigned To: Thomas Dudziak
>             Fix For: 1.0
>
>
> The PostgreSql jdbc driver returns VARCHAR(2147483647) for columns defined as TEXT. The ModelReader expects VARCHAR(-1) for these data type. 
> Maybe the behaviour of the jdbc driver changed lately, because there is a comment in the PostgreSqlModelReader.readColumn method which says that PostgreSQL returns VARCHAR(-1), but in my environment i get VARCHAR(2147483647).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DDLUTILS-165) Data type mismatch in PostgreSQL with TEXT columns

Posted by "Martin van den Bemt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DDLUTILS-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin van den Bemt updated DDLUTILS-165:
-----------------------------------------

    Attachment: patch.txt

> Data type mismatch in PostgreSQL with TEXT columns
> --------------------------------------------------
>
>                 Key: DDLUTILS-165
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-165
>             Project: DdlUtils
>          Issue Type: Bug
>          Components: Core - PostgreSql
>         Environment: PostgreSQL v2.8.3 on Windows with JDBC driver 'postgresql-8.2-504.jdbc3.jar'
>            Reporter: Stefan Huber
>         Assigned To: Thomas Dudziak
>             Fix For: 1.0
>
>         Attachments: patch.txt
>
>
> The PostgreSql jdbc driver returns VARCHAR(2147483647) for columns defined as TEXT. The ModelReader expects VARCHAR(-1) for these data type. 
> Maybe the behaviour of the jdbc driver changed lately, because there is a comment in the PostgreSqlModelReader.readColumn method which says that PostgreSQL returns VARCHAR(-1), but in my environment i get VARCHAR(2147483647).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DDLUTILS-165) Data type mismatch in PostgreSQL with TEXT columns

Posted by "Martin van den Bemt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DDLUTILS-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin van den Bemt resolved DDLUTILS-165.
------------------------------------------

    Resolution: Fixed

commit -m "Fix issue DDLUTILS-165. Thanx to Stefan Huber for spotting and testing this." D:/projects/mvdb.com/DdlUtils/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
    Sending        D:/projects/mvdb.com/DdlUtils/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
    Transmitting file data ...
    Committed revision 523790.

> Data type mismatch in PostgreSQL with TEXT columns
> --------------------------------------------------
>
>                 Key: DDLUTILS-165
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-165
>             Project: DdlUtils
>          Issue Type: Bug
>          Components: Core - PostgreSql
>         Environment: PostgreSQL v2.8.3 on Windows with JDBC driver 'postgresql-8.2-504.jdbc3.jar'
>            Reporter: Stefan Huber
>         Assigned To: Thomas Dudziak
>             Fix For: 1.0
>
>         Attachments: patch.txt
>
>
> The PostgreSql jdbc driver returns VARCHAR(2147483647) for columns defined as TEXT. The ModelReader expects VARCHAR(-1) for these data type. 
> Maybe the behaviour of the jdbc driver changed lately, because there is a comment in the PostgreSqlModelReader.readColumn method which says that PostgreSQL returns VARCHAR(-1), but in my environment i get VARCHAR(2147483647).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DDLUTILS-165) Data type mismatch in PostgreSQL with TEXT columns

Posted by "Martin van den Bemt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DDLUTILS-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483859 ] 

Martin van den Bemt commented on DDLUTILS-165:
----------------------------------------------

I have a patch for this I think. Since I don't have a means to test this atm, instead of committing, I attach the patch here. If someone could check it solves the problem, I will commit it.

> Data type mismatch in PostgreSQL with TEXT columns
> --------------------------------------------------
>
>                 Key: DDLUTILS-165
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-165
>             Project: DdlUtils
>          Issue Type: Bug
>          Components: Core - PostgreSql
>         Environment: PostgreSQL v2.8.3 on Windows with JDBC driver 'postgresql-8.2-504.jdbc3.jar'
>            Reporter: Stefan Huber
>         Assigned To: Thomas Dudziak
>             Fix For: 1.0
>
>
> The PostgreSql jdbc driver returns VARCHAR(2147483647) for columns defined as TEXT. The ModelReader expects VARCHAR(-1) for these data type. 
> Maybe the behaviour of the jdbc driver changed lately, because there is a comment in the PostgreSqlModelReader.readColumn method which says that PostgreSQL returns VARCHAR(-1), but in my environment i get VARCHAR(2147483647).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DDLUTILS-165) Data type mismatch in PostgreSQL with TEXT columns

Posted by "Stefan Huber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DDLUTILS-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484047 ] 

Stefan Huber commented on DDLUTILS-165:
---------------------------------------

The patch works fine with LONGVARCHAR values.

But with LONGVARBINARY fields i have the same effect. So if you add a type conversion for LONGVARBINARY fields (analog to LONGVARCHAR fields) i would classify this bug as resolved.

            // fix issue DDLUTILS-165 as postgresql-8.2-504-jdbc3.jar seems to return Integer.MAX_VALUE
            // on columns defined as TEXT.
            else if (column.getSizeAsInt() == Integer.MAX_VALUE)
            {
                column.setSize(null);
                if (column.getTypeCode() == Types.VARCHAR)
                {
                    column.setTypeCode(Types.LONGVARCHAR);
                }
+                else if (column.getTypeCode() == Types.BINARY)
+                {
+                    column.setTypeCode(Types.LONGVARBINARY);
+                }
            }

> Data type mismatch in PostgreSQL with TEXT columns
> --------------------------------------------------
>
>                 Key: DDLUTILS-165
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-165
>             Project: DdlUtils
>          Issue Type: Bug
>          Components: Core - PostgreSql
>         Environment: PostgreSQL v2.8.3 on Windows with JDBC driver 'postgresql-8.2-504.jdbc3.jar'
>            Reporter: Stefan Huber
>         Assigned To: Thomas Dudziak
>             Fix For: 1.0
>
>         Attachments: patch.txt
>
>
> The PostgreSql jdbc driver returns VARCHAR(2147483647) for columns defined as TEXT. The ModelReader expects VARCHAR(-1) for these data type. 
> Maybe the behaviour of the jdbc driver changed lately, because there is a comment in the PostgreSqlModelReader.readColumn method which says that PostgreSQL returns VARCHAR(-1), but in my environment i get VARCHAR(2147483647).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.