You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by Laurent ROCHE <la...@yahoo.com> on 2007/09/17 18:49:32 UTC
Re: schema mix up !
Tom,
I have tryed to get this working (exporting data using schemas) with no joy.
Here is the extract of biuld.xml defining the ant task
<target name="export-xfrt-data" description="Dumps db structure and data">
<taskdef name="databaseToDdl"
classname="org.apache.ddlutils.task.DatabaseToDdlTask">
<classpath refid="classpath"/>
</taskdef>
<databaseToDdl modelName="fims_testsmall_land" sortforeignkeys="false" verbosity="DEBUG" schemapattern="xfrt%">
<database url="jdbc:postgresql://my_server/my_db"
driverClassName="org.postgresql.Driver"
username="postgres"
password="XXXX"/>
<writeSchemaToFile outputFile="schema_xfrt.xml" />
<writeDataToFile outputFile="data_xfrt.xml" determineschema="true"/>
</databaseToDdl>
</target>
I get the following messages:
>ant export-xfrt-data
Buildfile: build.xml
export-xfrt-data:
[databaseToDdl] Borrowed connection org.apache.commons.dbcp.PoolableConnection@a761fe from data source
[databaseToDdl] Returning connection org.apache.commons.dbcp.PoolableConnection@a761fe to data source.
[databaseToDdl] Remaining connections: None
BUILD FAILED
C:\apps\Ddlutils-test\build.xml:130: Could not read the schema from the specified database: There are multiple column wi
th the name role_id in the table app_roles
Total time: 7 seconds
>
I must do something wrong ... but I can not find out what ? ! ?
I have 2 schemas on my database (containing tables with identical names): xfrt_synch and public !
Cheers,
L@u
PS: I am following up an old thread !
----- Message d'origine ----
De : Thomas Dudziak <to...@gmail.com>
� : ddlutils-user@db.apache.org
Envoy� le : Mardi, 2 Janvier 2007, 4h24mn 00s
Objet : Re: schema mix up !
On 12/26/06, Laurent ROCHE <la...@yahoo.com> wrote:
> There is a little problem when doing an export of a PostgreSQL database where there is
two schema (say public and queries).
>
> The generation of schema.xml is OK.
>
> But when generating data.xml DDL Utils will fail as it will try to read the content of
tab1 in QUERIES with the SQL:
> select * from tab1
> instead of
> select * from queries.tab1
Please update DdlUtils and use both the schemapattern parameter
(http://db.apache.org/ddlutils/ant/org.apache.ddlutils.task.DatabaseToDdlTask.html#parameter-schemapattern)
and also set the new determineschema parameter to true
(http://db.apache.org/ddlutils/ant/org.apache.ddlutils.task.WriteDataToFileCommand.html#parameter-determineschema)
Tom
Have fun,
L@u
The Computing Froggy
______________________________________________________________________________
Stockage illimité de vos mails avec Yahoo! Mail. Changez aujourd'hui de mail !