db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomislav Nakic-Alfirevic (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (DDLUTILS-151) Can not export data if multiple schemas from PostgreSQL
Date Sun, 31 May 2009 16:02:07 GMT

    [ https://issues.apache.org/jira/browse/DDLUTILS-151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681844#action_12681844
] 

Tomislav Nakic-Alfirevic edited comment on DDLUTILS-151 at 5/31/09 9:00 AM:
----------------------------------------------------------------------------

I ran into the issue as well, but found out it was a problem of an incomplete build.xml (although
I would argue that the default behaviour should be schemapattern="%", not "null").

My build.xml was as follows (similar to the introductory ddlutils example):

<?xml version="1.0"?>
<project name="MigrateToDerby" basedir=".">
	<path id="classpath">
		<fileset dir="./lib">
			<include name="**/*.jar"/>
		</fileset>
	</path>
	<target name="export-source-db" description="Dumps db structure and data">
		<taskdef name="databaseToDdl" classname="org.apache.ddlutils.task.DatabaseToDdlTask">
		<classpath refid="classpath"/>
	</taskdef>
	<databaseToDdl modelName="MigrateTest">
		<database url="jdbc:postgresql://localhost/acta" driverClassName="org.postgresql.Driver"
username="snip!" password="snip!"/>
		<writeSchemaToFile outputFile="db-schema.xml"/>
		<writeDataToFile outputFile="data.xml"/>
	</databaseToDdl>
	</target>
</project> 

Changing the following 2 elements like so

<databaseToDdl modelName="MigrateTest" schemapattern="%" databasetype="postgresql">
<writeDataToFile outputFile="data.xml" determineschema="true"/>

made it work (not sure if all 3 changes were necessary, but I'm quite sure setting the schemapattern
was).

Btw, I've tried modifying ddlutils code to output things which would help me understand what's
going on, but I don't know how I have to set up logging so that I get any kind of output from
statements like _log.debug(sql) and the like. Can you give me a hint? Is there any documentation
for ddlutils developers (tools to use, environment setup etc.)?

The following change helped me to understand better what was going on:

Index: main/java/org/apache/ddlutils/platform/PlatformImplBase.java
===================================================================
--- main/java/org/apache/ddlutils/platform/PlatformImplBase.java	(revision 753277)
+++ main/java/org/apache/ddlutils/platform/PlatformImplBase.java	(working copy)
@@ -1562,7 +1562,8 @@
         }
         catch (SQLException ex)
         {
-            throw new DatabaseOperationException("Error while performing a query", ex);
+            //throw new DatabaseOperationException("Error while performing a query", ex);
+            throw new DatabaseOperationException("Error while performing a query [" + sql
+ "]", ex);
         }
         finally
         {


      was (Author: tna):
    I ran into the issue as well, but found out it was a problem of an incomplete build.xml
(although I would argue that the default behaviour should be schemapattern="%", not "null").

My build.xml was as follows (similar to the introductory ddlutils example):

<?xml version="1.0"?>
<project name="MigrateToDerby" basedir=".">
	<path id="classpath">
		<fileset dir="./lib">
			<include name="**/*.jar"/>
		</fileset>
	</path>
	<target name="export-source-db" description="Dumps db structure and data">
		<taskdef name="databaseToDdl" classname="org.apache.ddlutils.task.DatabaseToDdlTask">
		<classpath refid="classpath"/>
	</taskdef>
	<databaseToDdl modelName="MigrateTest">
		<database url="jdbc:postgresql://localhost/acta" driverClassName="org.postgresql.Driver"
username="snip!" password="snip!"/>
		<writeSchemaToFile outputFile="db-schema.xml"/>
		<writeDataToFile outputFile="data.xml"/>
	</databaseToDdl>
	</target>
</project> 

Changing the following 2 elements like so

<databaseToDdl modelName="MigrateTest" schemapattern="%" databasetype="postgresql">
<writeDataToFile outputFile="data.xml" determineschema="true"/>

made it work (not sure if all 3 changes were necessary, but I'm quite sure setting the schemapattern
was).

Btw, I've tried modifying ddlutils code to output things which would help me understand what's
going on, but I don't know how I have to set up logging so that I get any kind of output from
statements like _log.debug(sql) and the like. Can you give me a hint? Is there any documentation
for ddlutils developers (tools to use, environment setup etc.)?

  
> Can not export data if multiple schemas from PostgreSQL
> -------------------------------------------------------
>
>                 Key: DDLUTILS-151
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-151
>             Project: DdlUtils
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: PostgreSQL 8.1.4 on i486-pc-linux-gnu, compiled by GCC gcc-4.0.gcc-opt
(GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
> Ant tasks
>            Reporter: Laurent ROCHE
>            Assignee: Thomas Dudziak
>             Fix For: 1.2
>
>
> When running an Ant Task, databaseToDdl with writeDataToFile on a PosgreSQL database
with more than the public database, DDL-Utils fails !
> The error message is:
>  org.apache.ddlutils.DatabaseOperationException: Error while performing a query
> and adding the option verbosity="DEBUG" does not add more information.
> Cheers,
> L@u

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


Mime
View raw message