Not sure if this has been posted before. I'm getting an exception when
calling createSchema() :

    public static void main(String[] args) throws Exception
    {   
        Map params = new HashMap();
        params.put("dbtype", "postgis");        //must be postgis
        params.put("host", "localhost");        //the name or ip address of
the machine running PostGIS
        params.put("port", new Integer(5432));  //the port that PostGIS is
running on (generally 5432)
        params.put("database", "postgres");      //the name of the database
to connect to.
        params.put("user", "postgres");         //the user to connect with
        params.put("passwd", "pass");               //the password of the
user.
                                                                                
                                     
DataStore pgDatastore = DataStoreFinder.getDataStore(params);                   
                             
pgDatastore.createSchema(someSchema);

    }

Got this exception :

Exception in thread "main" java.io.IOException: ERROR: length for type
varchar cannot exceed 10485760
        at
org.geotools.data.postgis.PostgisDataStore.createSchema(PostgisDataStore.java:1399)
        at PostGis.main(PostGis.java:23)
Caused by: org.postgresql.util.PSQLException: ERROR: length for type varchar
cannot exceed 10485760
        at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
        at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
        at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:340)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:332)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.postgresql.ds.common.PooledConnectionImpl$StatementHandler.invoke(PooledConnectionImpl.java:474)
        at $Proxy1.execute(Unknown Source)
        at
org.geotools.data.postgis.PostgisDataStore.createSchema(PostgisDataStore.java:1196)


It seems like any attribute of type string uses VARCHAR(2147483647). Am I
doing something wrong here ?

Regards,
Enam

-- 
View this message in context: 
http://www.nabble.com/Postgis-DataStore-tf3944630.html#a11189499
Sent from the geotools-gt2-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to