Received: from issv0170.isis.de (issv0170.isis.de [195.158.131.222]) by postgresql.org (Postfix) with SMTP id 6FA134759EE for ; Mon, 4 Mar 2002 08:54:46 -0500 (EST) Received: (qmail 25870 invoked by uid 1010); 4 Mar 2002 13:54:48 -0000 Received: from unknown (HELO janning.planwerk6.local) ([195.158.146.183]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 4 Mar 2002 13:54:48 -0000 Received: from there (localhost [127.0.0.1]) by janning.planwerk6.local (8.11.6/8.11.6/SuSE Linux 0.5) with SMTP id g24Dnaj10826; Mon, 4 Mar 2002 14:49:36 +0100 Message-Id: <200203041349.g24Dnaj10826@janning.planwerk6.local> Content-Type: text/plain; charset="iso-8859-1" From: Janning Vygen Organization: Planwerk 6 /websolutions To: Roberto Mello Subject: Re: thinking about versioning my database schema Date: Mon, 4 Mar 2002 14:49:35 +0100 X-Mailer: KMail [version 1.3.1] Cc: pgsql-sql@postgresql.org References: <200203040710.g247AOj05681@janning.planwerk6.local> <20020304130903.GA24076@cc.usu.edu> In-Reply-To: <20020304130903.GA24076@cc.usu.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archive-Number: 200203/35 X-Sequence-Number: 6917 Am Montag, 4. März 2002 14:09 schrieb Roberto Mello: > On Mon, Mar 04, 2002 at 08:10:24AM +0100, Janning Vygen wrote: > > So i am saving the schema version inside the databse. Is it a > > good idea? or is it nonsens and there is a much better way how to > > do it? > > Yeah, but then you'd have to change your queries to be able to > query the new tables. > > > I dont want to recreate the database every time because i want to > > keep my testdata present. > > How about a script that dumps your data, dumps your db, reloads the > table definitions, then reloads your data? You could have a table > with rows for every table that would keep track of the current > version you have, that could be updated when this script ran. i cant reload my dumped data if the table definition changed. maybe i have renamed a column or something like this. how should my dumped data know this? So i have to write an update script. But then i have to write the new schema AND have to write update scripts and still hve trouble with other developers who should easily get a corresponding schema for alle the queries they just fetched via cvs janning > -Roberto -- Planwerk 6 /websolutions Herzogstraße 86 40215 Düsseldorf fon 0211-6015919 fax 0211-6015917 http://www.planwerk6.de