From: Ricardo B. <rb...@gm...> - 2006-01-10 17:29:26
|
Mike / Steve, We would like to know if you already had created the rules of the version tables. We believe that with these rules we will go to obtain the loads, using th= e ISF. In case that you have some position, you he could inform to me, please. thanks in advance, Ricardo 2006/1/3, bug...@pc... <bug...@pc...>: > > https://www.cbil.upenn.edu/tracker/show_bug.cgi?id=3D257 > > > msa...@pc... changed: > > What |Removed |Added > > -------------------------------------------------------------------------= --- > Status|RESOLVED |REOPENED > Resolution|INVALID | > > > > > ------- Comment #4 from msa...@pc... 2006-01-03 12:05 ------- > version table rules are indeed not being created. this should be > relatively > straight forward to fix. > > > -- > Configure bugmail: > https://www.cbil.upenn.edu/tracker/userprefs.cgi?tab=3Demail > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > |
From: Angel P. <an...@ma...> - 2006-01-17 16:24:54
Attachments:
DBAdmin.diff
|
Hi Ricardo, The error did not stem from my patch, but rather from another class that failed to add the none-default columns to the version view objects. I have edited a few files, so you will need to revert to current SVN version of the repository for this patch to work: <copy attached file to project home> cd $PROJECT_HOME svn revert GUS/DBAdmin patch -p0 <DBAdmin.diff Then you should be able to rebuild GUS/DBAdmin and run dbaDump schema as before. An example of the output view and rule follows -angel CREATE VIEW DoTSVer.AAFeatureVer AS SELECT AA_FEATURE_ID, AA_SEQUENCE_ID, FEATURE_NAME_ID, PARENT_ID, NA_FEATURE_ID, SUBCLASS_VIEW, SEQUENCE_ONTOLOGY_ID, DESCRIPTION, PFAM_ENTRY_ID, MOTIF_AA_SEQUENCE_ID, REPEAT_TYPE_ID, EXTERNAL_DATABASE_RELEASE_ID, SOURCE_ID, PREDICTION_ALGORITHM_ID, IS_PREDICTED, REVIEW_STATUS_ID , MODIFICATION_DATE, USER_READ, USER_WRITE, GROUP_READ, GROUP_WRITE, OTHER_READ, OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, VERSION_TRANSACTION_ID FROM DoTSVer.AAFeatureImpVer; CREATE RULE AAFeatureVer_32675 AS ON INSERT TO DoTSVer.AAFeatureVer DO INSTEAD INSERT INTO DoTSVer.AAFeatureImpVer ( AA_FEATURE_ID, AA_SEQUENCE_ID, FEATURE_NAME_ID, PARENT_ID, NA_FEATURE_ID, SUBCLASS_VIEW, SEQUENCE_ONTOLOGY_ID, DESCRIPTION, PFAM_ENTRY_ID, MOTIF_AA_SEQUENCE_ID, REPEAT_TYPE_ID, EXTERNAL_DATABASE_RELEASE_ID, SOURCE_ID, PREDICTION_ALGORITHM_ID, IS_PREDICTED, REVIEW_STATUS_ID, MODIFICATION_DATE, USER_READ, USER_WRITE, GROUP_READ, GROUP_WRITE, OTHER_READ, OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, VERSION_TRANSACTION_ID ) VALUES ( new.AA_FEATURE_ID, new.AA_SEQUENCE_ID, new.FEATURE_NAME_ID, new.PARENT_ID, new.NA_FEATURE_ID, new.SUBCLASS_VIEW, new.SEQUENCE_ONTOLOGY_ID, new.DESCRIPTION, new.PFAM_ENTRY_ID, new.MOTIF_AA_SEQUENCE_ID, new.REPEAT_TYPE_ID, new.EXTERNAL_DATABASE_RELEASE_ID, new.SOURCE_ID, new.PREDICTION_ALGORITHM_ID, new.IS_PREDICTED, new.REVIEW_STATUS_ID, new.MODIFICATION_DATE, new.USER_READ, new.USER_WRITE, new.GROUP_READ, new.GROUP_WRITE, new.OTHER_READ, new.OTHER_WRITE, new.ROW_USER_ID, new.ROW_GROUP_ID, new.ROW_PROJECT_ID, new.ROW_ALG_INVOCATION_ID, new.VERSION_ALG_INVOCATION_ID, new.VERSION_DATE, new.VERSION_TRANSACTION_ID ); Angel Pizarro wrote: > Yes, I have an idea of what is going on ... sloppy copy-paste coding > on my part :( > > I'll add the other columns to the method and get you another patch. > > -angel > |
From: Ricardo B. <rb...@gm...> - 2006-01-17 19:36:33
|
Hi Angel, It is all right now with versioning tables. Now I passed to a next error. It follows below the error that happened. I am using the revision 4422 Do you have any idea ? ERROR: In feature map XML file '/GUS/gus_home/config/genbank2gus.xml' <feature name=3D"mRNA"> does not have a <qualifier> for 'transcript_id', which is fo= und in the input at /GUS/gus_home/lib/perl/GUS/Supported/BioperlFeatMapper.pm line 106, <GEN30> line 569. STACK TRACE: at /GUS/gus_home/lib/perl/GUS/Supported/BioperlFeatMapper.pm line 106 GUS::Supported::BioperlFeatMapper::_checkTagExists('GUS::Supported::Bioperl= FeatMapper=3DHASH(0xa7d23cc)', 'transcript_id') called at /GUS/gus_home/lib/perl/GUS/Supported/BioperlFeatMapper.pm line 30 GUS::Supported::BioperlFeatMapper::sortTags('GUS::Supported::BioperlFeatMap= per=3DHASH(0xa7d23cc)', 'db_xref', 'locus_tag', 'product', 'transcript_id') called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 800 GUS::Supported::Plugin::InsertSequenceFeatures::makeImmediateFeature('GUS::= Supported::Plugin::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'Bio::SeqFeature::Generic=3DHASH(0xab16364)', 37, 177) called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 750 GUS::Supported::Plugin::InsertSequenceFeatures::makeFeature('GUS::Supported= ::Plugin::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'Bio::SeqFeature::Generic=3DHASH(0xab16364)', 37, 177) called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 758 GUS::Supported::Plugin::InsertSequenceFeatures::makeFeature('GUS::Supported= ::Plugin::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'Bio::SeqFeature::Generic=3DHASH(0xabaf3ac)', 37, 177) called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 727 GUS::Supported::Plugin::InsertSequenceFeatures::processFeatureTrees('GUS::S= upported::Plugin::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'Bio::Seq::RichSeq=3DHASH(0xa95e35c)', 37, 177) called at /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line 330 GUS::Supported::Plugin::InsertSequenceFeatures::run('GUS::Supported::Plugin= ::InsertSequenceFeatures=3DHASH(0x9756fdc)', 'HASH(0xa49ac04)') called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 549 eval {...} called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 541 GUS::PluginMgr::GusApplication::doMajorMode_RunOrReport('GUS::PluginMgr::Gu= sApplication=3DHASH(0x9538c20)', 'GUS::Supported::Plugin::InsertSequenceFeatures', 1) called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 459 GUS::PluginMgr::GusApplication::doMajorMode_Run('GUS::PluginMgr::GusApplica= tion=3DHASH(0x9538c20)', 'GUS::Supported::Plugin::InsertSequenceFeatures') called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 357 GUS::PluginMgr::GusApplication::doMajorMode('GUS::PluginMgr::GusApplication= =3DHASH(0x9538c20)', 'GUS::Supported::Plugin::InsertSequenceFeatures') called at /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 266 GUS::PluginMgr::GusApplication::parseAndRun('GUS::PluginMgr::GusApplication= =3DHASH(0x9538c20)', 'ARRAY(0x954c728)') called at /GUS/gus_home/bin/ga line 11 Ricardo 2006/1/17, Angel Pizarro <an...@ma...>: > > Hi Ricardo, > > The error did not stem from my patch, but rather from another class that > failed to add the none-default columns to the version view objects. I > have edited a few files, so you will need to revert to current SVN > version of the repository for this patch to work: > <copy attached file to project home> > cd $PROJECT_HOME > svn revert GUS/DBAdmin > patch -p0 <DBAdmin.diff > > Then you should be able to rebuild GUS/DBAdmin and run dbaDump schema as > before. > > An example of the output view and rule follows > -angel > > > CREATE VIEW DoTSVer.AAFeatureVer AS > SELECT AA_FEATURE_ID, AA_SEQUENCE_ID, FEATURE_NAME_ID, PARENT_ID, > NA_FEATURE_ID, SUBCLASS_VIEW, SEQUENCE_ONTOLOGY_ID, DESCRIPTION, > PFAM_ENTRY_ID, MOTIF_AA_SEQUENCE_ID, REPEAT_TYPE_ID, > EXTERNAL_DATABASE_RELEASE_ID, SOURCE_ID, PREDICTION_ALGORITHM_ID, > IS_PREDICTED, REVIEW_STATUS_ID , MODIFICATION_DATE, USER_READ, > USER_WRITE, GROUP_READ, GROUP_WRITE, OTHER_READ, OTHER_WRITE, > ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, ROW_ALG_INVOCATION_ID, > VERSION_ALG_INVOCATION_ID, VERSION_DATE, VERSION_TRANSACTION_ID FROM > DoTSVer.AAFeatureImpVer; > > CREATE RULE AAFeatureVer_32675 AS ON INSERT TO DoTSVer.AAFeatureVer DO > INSTEAD INSERT INTO DoTSVer.AAFeatureImpVer ( AA_FEATURE_ID, > AA_SEQUENCE_ID, FEATURE_NAME_ID, PARENT_ID, NA_FEATURE_ID, > SUBCLASS_VIEW, SEQUENCE_ONTOLOGY_ID, DESCRIPTION, PFAM_ENTRY_ID, > MOTIF_AA_SEQUENCE_ID, REPEAT_TYPE_ID, EXTERNAL_DATABASE_RELEASE_ID, > SOURCE_ID, PREDICTION_ALGORITHM_ID, IS_PREDICTED, REVIEW_STATUS_ID, > MODIFICATION_DATE, USER_READ, USER_WRITE, GROUP_READ, GROUP_WRITE, > OTHER_READ, OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, > ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, > VERSION_TRANSACTION_ID ) VALUES ( new.AA_FEATURE_ID, new.AA_SEQUENCE_ID, > new.FEATURE_NAME_ID, new.PARENT_ID, new.NA_FEATURE_ID, > new.SUBCLASS_VIEW, new.SEQUENCE_ONTOLOGY_ID, new.DESCRIPTION, > new.PFAM_ENTRY_ID, new.MOTIF_AA_SEQUENCE_ID, new.REPEAT_TYPE_ID, > new.EXTERNAL_DATABASE_RELEASE_ID, new.SOURCE_ID, > new.PREDICTION_ALGORITHM_ID, new.IS_PREDICTED, new.REVIEW_STATUS_ID, > new.MODIFICATION_DATE, new.USER_READ, new.USER_WRITE, new.GROUP_READ, > new.GROUP_WRITE, new.OTHER_READ, new.OTHER_WRITE, new.ROW_USER_ID, > new.ROW_GROUP_ID, new.ROW_PROJECT_ID, new.ROW_ALG_INVOCATION_ID, > new.VERSION_ALG_INVOCATION_ID, new.VERSION_DATE, > new.VERSION_TRANSACTION_ID ); > > Angel Pizarro wrote: > > > Yes, I have an idea of what is going on ... sloppy copy-paste coding > > on my part :( > > > > I'll add the other columns to the method and get you another patch. > > > > -angel > > > > > > Index: GUS/DBAdmin/src/java/org/gusdb/dbadmin/model/View.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- GUS/DBAdmin/src/java/org/gusdb/dbadmin/model/View.java (revision > 4068) > +++ GUS/DBAdmin/src/java/org/gusdb/dbadmin/model/View.java (working > copy) > @@ -48,6 +48,10 @@ > return column; > } > > + public void setColumns( ArrayList<ColumnPair> colpair) { > + column =3D colpair; > + } > + > public void addColumn( ColumnPair columnPair ) { > if ( !this.column.contains( columnPair ) ) { > this.column.add( columnPair ); > Index: GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > (revision 4068) > +++ GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > (working copy) > @@ -12,6 +12,7 @@ > import org.gusdb.dbadmin.model.GusSchema; > import org.gusdb.dbadmin.model.GusTable; > import org.gusdb.dbadmin.model.GusView; > +import org.gusdb.dbadmin.model.VersionView; > import org.gusdb.dbadmin.model.Schema; > import org.gusdb.dbadmin.model.Sequence; > import org.gusdb.dbadmin.model.Table; > @@ -105,6 +106,8 @@ > super.writeView( view ); > if ( view instanceof GusView ) { > writeViewRules( (GusView) view ); > + }else if ( view instanceof VersionView ) { > + writeVersionViewRules( (VersionView) view ); > } > } > > @@ -112,8 +115,6 @@ > * Since PostgreSQL doesn't support updatable views, this is a hack > that > * uses rules to mimick the updatable view functionality. > * > - * TODO: Note that this means version views are now not updatable > since they > - * don't have a PK. > * > * @param view DOCUMENT ME! > * @throws IOException DOCUMENT ME! > @@ -174,7 +175,47 @@ > oStream.flush( ); > } > > + > /** > + * Since PostgreSQL doesn't support updatable views, this is a hack > that > + * uses rules to mimick the updatable view functionality. > + * > + * Version views are now not updatable since they > + * don't have a PK, so we limit rules to insertion > + * > + * @param view DOCUMENT ME! > + * @throws IOException DOCUMENT ME! > + */ > + private void writeVersionViewRules( VersionView view ) throws > IOException { > + oStream.write( "CREATE RULE " + view.getName( ) + "_" + > random.nextInt( 100000 ) + " AS ON INSERT TO " > + + view.getSchema( ).getName( ) + "." + view.getName( ) + > " DO INSTEAD INSERT INTO " > + + view.getTable( ).getSchema( ).getName( ) + "." + > view.getTable( ).getName( ) + " ( " ); > + > + boolean first =3D true; > + for ( ColumnPair columnPair : view.getColumns() ) { > + if ( !first ) { > + oStream.write( ", " ); > + } > + oStream.write( columnPair.getTableName( ) ); > + first =3D false; > + } > + > + oStream.write( " ) VALUES ( " ); > + > + first =3D true; > + for ( ColumnPair columnPair : view.getColumns() ) { > + if ( !first ) { > + oStream.write( ", " ); > + } > + oStream.write( "new." + columnPair.getViewName( ) ); > + first =3D false; > + } > + > + oStream.write( " );\n\n" ); > + > + } > + > + /** > * DOCUMENT ME! > * > * @param type DOCUMENT ME! > Index: > GUS/DBAdmin/src/java/org/gusdb/dbadmin/util/GusClassHierarchyConverter.ja= va > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- > GUS/DBAdmin/src/java/org/gusdb/dbadmin/util/GusClassHierarchyConverter.ja= va > (revision 4068) > +++ > GUS/DBAdmin/src/java/org/gusdb/dbadmin/util/GusClassHierarchyConverter.ja= va > (working copy) > @@ -363,6 +363,9 @@ > superClassView.setVersioned( true ); > verSql =3D sql.concat( " " ); > > + // We need to add the superclass columns to the version view. > + superClassView.getVersionView( > ).setColumns((ArrayList<ColumnPair>) superClassView.getColumns().clone())= ; > + > for ( Column column : verHousekeepingColumns ) { > verSql =3D verSql.concat( ", " + column.getName( ) ); > superClassView.getVersionView( ).addColumn( new > ColumnPair( column.getName( ), column.getName( ) ) ); > @@ -448,7 +451,8 @@ > if ( impTable.isVersioned( ) ) { > subClass.setVersioned( true ); > verSql =3D sql.concat( " " ); > - > + // We need to add the subclass_view's columns > + subClass.getVersionView( ).setColumns((ArrayList<ColumnPair>) > subClass.getColumns().clone()); > for ( Column column : verHousekeepingColumns ) { > verSql =3D verSql.concat( ", " + column.getName( ) ); > subClass.getVersionView( ).addColumn( new ColumnPair( > column.getName( ), column.getName( ) ) ); > > > |
From: <jld...@pc...> - 2006-01-17 19:48:31
|
Ricardo, The error you received simply means that your mapping file is incomplete. So, in your mapping file, under the mRNA feature, you will need to add a qualifier with the name 'transcript_id' that tells the plugin what to do with transcript IDs. There should be examples of qualifiers for you to follow already in the mapping file. I hope this helps. Jennifer Quoting Ricardo Balbi <rb...@gm...>: > Hi Angel, > > It is all right now with versioning tables. > Now I passed to a next error. > It follows below the error that happened. > > I am using the revision 4422 > > Do you have any idea ? > > ERROR: > In feature map XML file '/GUS/gus_home/config/genbank2gus.xml' <feature > name="mRNA"> does not have a <qualifier> for 'transcript_id', which is found > in the input at /GUS/gus_home/lib/perl/GUS/Supported/BioperlFeatMapper.pm > line 106, <GEN30> line 569. > > STACK TRACE: > at /GUS/gus_home/lib/perl/GUS/Supported/BioperlFeatMapper.pm line 106 > > GUS::Supported::BioperlFeatMapper::_checkTagExists('GUS::Supported::BioperlFeatMapper=HASH(0xa7d23cc)', > 'transcript_id') called at > /GUS/gus_home/lib/perl/GUS/Supported/BioperlFeatMapper.pm line 30 > > GUS::Supported::BioperlFeatMapper::sortTags('GUS::Supported::BioperlFeatMapper=HASH(0xa7d23cc)', > 'db_xref', 'locus_tag', 'product', 'transcript_id') called at > /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line > 800 > > GUS::Supported::Plugin::InsertSequenceFeatures::makeImmediateFeature('GUS::Supported::Plugin::InsertSequenceFeatures=HASH(0x9756fdc)', > 'Bio::SeqFeature::Generic=HASH(0xab16364)', 37, 177) called at > /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line > 750 > > GUS::Supported::Plugin::InsertSequenceFeatures::makeFeature('GUS::Supported::Plugin::InsertSequenceFeatures=HASH(0x9756fdc)', > 'Bio::SeqFeature::Generic=HASH(0xab16364)', 37, 177) called at > /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line > 758 > > GUS::Supported::Plugin::InsertSequenceFeatures::makeFeature('GUS::Supported::Plugin::InsertSequenceFeatures=HASH(0x9756fdc)', > 'Bio::SeqFeature::Generic=HASH(0xabaf3ac)', 37, 177) called at > /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line > 727 > > GUS::Supported::Plugin::InsertSequenceFeatures::processFeatureTrees('GUS::Supported::Plugin::InsertSequenceFeatures=HASH(0x9756fdc)', > 'Bio::Seq::RichSeq=HASH(0xa95e35c)', 37, 177) called at > /GUS/gus_home/lib/perl/GUS/Supported/Plugin/InsertSequenceFeatures.pm line > 330 > > GUS::Supported::Plugin::InsertSequenceFeatures::run('GUS::Supported::Plugin::InsertSequenceFeatures=HASH(0x9756fdc)', > 'HASH(0xa49ac04)') called at > /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 549 > eval {...} called at > /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 541 > > GUS::PluginMgr::GusApplication::doMajorMode_RunOrReport('GUS::PluginMgr::GusApplication=HASH(0x9538c20)', > 'GUS::Supported::Plugin::InsertSequenceFeatures', 1) called at > /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 459 > > GUS::PluginMgr::GusApplication::doMajorMode_Run('GUS::PluginMgr::GusApplication=HASH(0x9538c20)', > 'GUS::Supported::Plugin::InsertSequenceFeatures') called at > /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 357 > > GUS::PluginMgr::GusApplication::doMajorMode('GUS::PluginMgr::GusApplication=HASH(0x9538c20)', > 'GUS::Supported::Plugin::InsertSequenceFeatures') called at > /GUS/gus_home/lib/perl/GUS/PluginMgr/GusApplication.pm line 266 > > GUS::PluginMgr::GusApplication::parseAndRun('GUS::PluginMgr::GusApplication=HASH(0x9538c20)', > 'ARRAY(0x954c728)') called at /GUS/gus_home/bin/ga line 11 > > > Ricardo > > 2006/1/17, Angel Pizarro <an...@ma...>: >> >> Hi Ricardo, >> >> The error did not stem from my patch, but rather from another class that >> failed to add the none-default columns to the version view objects. I >> have edited a few files, so you will need to revert to current SVN >> version of the repository for this patch to work: >> <copy attached file to project home> >> cd $PROJECT_HOME >> svn revert GUS/DBAdmin >> patch -p0 <DBAdmin.diff >> >> Then you should be able to rebuild GUS/DBAdmin and run dbaDump schema as >> before. >> >> An example of the output view and rule follows >> -angel >> >> >> CREATE VIEW DoTSVer.AAFeatureVer AS >> SELECT AA_FEATURE_ID, AA_SEQUENCE_ID, FEATURE_NAME_ID, PARENT_ID, >> NA_FEATURE_ID, SUBCLASS_VIEW, SEQUENCE_ONTOLOGY_ID, DESCRIPTION, >> PFAM_ENTRY_ID, MOTIF_AA_SEQUENCE_ID, REPEAT_TYPE_ID, >> EXTERNAL_DATABASE_RELEASE_ID, SOURCE_ID, PREDICTION_ALGORITHM_ID, >> IS_PREDICTED, REVIEW_STATUS_ID , MODIFICATION_DATE, USER_READ, >> USER_WRITE, GROUP_READ, GROUP_WRITE, OTHER_READ, OTHER_WRITE, >> ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, ROW_ALG_INVOCATION_ID, >> VERSION_ALG_INVOCATION_ID, VERSION_DATE, VERSION_TRANSACTION_ID FROM >> DoTSVer.AAFeatureImpVer; >> >> CREATE RULE AAFeatureVer_32675 AS ON INSERT TO DoTSVer.AAFeatureVer DO >> INSTEAD INSERT INTO DoTSVer.AAFeatureImpVer ( AA_FEATURE_ID, >> AA_SEQUENCE_ID, FEATURE_NAME_ID, PARENT_ID, NA_FEATURE_ID, >> SUBCLASS_VIEW, SEQUENCE_ONTOLOGY_ID, DESCRIPTION, PFAM_ENTRY_ID, >> MOTIF_AA_SEQUENCE_ID, REPEAT_TYPE_ID, EXTERNAL_DATABASE_RELEASE_ID, >> SOURCE_ID, PREDICTION_ALGORITHM_ID, IS_PREDICTED, REVIEW_STATUS_ID, >> MODIFICATION_DATE, USER_READ, USER_WRITE, GROUP_READ, GROUP_WRITE, >> OTHER_READ, OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, >> ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, >> VERSION_TRANSACTION_ID ) VALUES ( new.AA_FEATURE_ID, new.AA_SEQUENCE_ID, >> new.FEATURE_NAME_ID, new.PARENT_ID, new.NA_FEATURE_ID, >> new.SUBCLASS_VIEW, new.SEQUENCE_ONTOLOGY_ID, new.DESCRIPTION, >> new.PFAM_ENTRY_ID, new.MOTIF_AA_SEQUENCE_ID, new.REPEAT_TYPE_ID, >> new.EXTERNAL_DATABASE_RELEASE_ID, new.SOURCE_ID, >> new.PREDICTION_ALGORITHM_ID, new.IS_PREDICTED, new.REVIEW_STATUS_ID, >> new.MODIFICATION_DATE, new.USER_READ, new.USER_WRITE, new.GROUP_READ, >> new.GROUP_WRITE, new.OTHER_READ, new.OTHER_WRITE, new.ROW_USER_ID, >> new.ROW_GROUP_ID, new.ROW_PROJECT_ID, new.ROW_ALG_INVOCATION_ID, >> new.VERSION_ALG_INVOCATION_ID, new.VERSION_DATE, >> new.VERSION_TRANSACTION_ID ); >> >> Angel Pizarro wrote: >> >> > Yes, I have an idea of what is going on ... sloppy copy-paste coding >> > on my part :( >> > >> > I'll add the other columns to the method and get you another patch. >> > >> > -angel >> > >> >> >> >> Index: GUS/DBAdmin/src/java/org/gusdb/dbadmin/model/View.java >> =================================================================== >> --- GUS/DBAdmin/src/java/org/gusdb/dbadmin/model/View.java (revision >> 4068) >> +++ GUS/DBAdmin/src/java/org/gusdb/dbadmin/model/View.java (working >> copy) >> @@ -48,6 +48,10 @@ >> return column; >> } >> >> + public void setColumns( ArrayList<ColumnPair> colpair) { >> + column = colpair; >> + } >> + >> public void addColumn( ColumnPair columnPair ) { >> if ( !this.column.contains( columnPair ) ) { >> this.column.add( columnPair ); >> Index: GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java >> =================================================================== >> --- GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java >> (revision 4068) >> +++ GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java >> (working copy) >> @@ -12,6 +12,7 @@ >> import org.gusdb.dbadmin.model.GusSchema; >> import org.gusdb.dbadmin.model.GusTable; >> import org.gusdb.dbadmin.model.GusView; >> +import org.gusdb.dbadmin.model.VersionView; >> import org.gusdb.dbadmin.model.Schema; >> import org.gusdb.dbadmin.model.Sequence; >> import org.gusdb.dbadmin.model.Table; >> @@ -105,6 +106,8 @@ >> super.writeView( view ); >> if ( view instanceof GusView ) { >> writeViewRules( (GusView) view ); >> + }else if ( view instanceof VersionView ) { >> + writeVersionViewRules( (VersionView) view ); >> } >> } >> >> @@ -112,8 +115,6 @@ >> * Since PostgreSQL doesn't support updatable views, this is a hack >> that >> * uses rules to mimick the updatable view functionality. >> * >> - * TODO: Note that this means version views are now not updatable >> since they >> - * don't have a PK. >> * >> * @param view DOCUMENT ME! >> * @throws IOException DOCUMENT ME! >> @@ -174,7 +175,47 @@ >> oStream.flush( ); >> } >> >> + >> /** >> + * Since PostgreSQL doesn't support updatable views, this is a hack >> that >> + * uses rules to mimick the updatable view functionality. >> + * >> + * Version views are now not updatable since they >> + * don't have a PK, so we limit rules to insertion >> + * >> + * @param view DOCUMENT ME! >> + * @throws IOException DOCUMENT ME! >> + */ >> + private void writeVersionViewRules( VersionView view ) throws >> IOException { >> + oStream.write( "CREATE RULE " + view.getName( ) + "_" + >> random.nextInt( 100000 ) + " AS ON INSERT TO " >> + + view.getSchema( ).getName( ) + "." + view.getName( ) + >> " DO INSTEAD INSERT INTO " >> + + view.getTable( ).getSchema( ).getName( ) + "." + >> view.getTable( ).getName( ) + " ( " ); >> + >> + boolean first = true; >> + for ( ColumnPair columnPair : view.getColumns() ) { >> + if ( !first ) { >> + oStream.write( ", " ); >> + } >> + oStream.write( columnPair.getTableName( ) ); >> + first = false; >> + } >> + >> + oStream.write( " ) VALUES ( " ); >> + >> + first = true; >> + for ( ColumnPair columnPair : view.getColumns() ) { >> + if ( !first ) { >> + oStream.write( ", " ); >> + } >> + oStream.write( "new." + columnPair.getViewName( ) ); >> + first = false; >> + } >> + >> + oStream.write( " );\n\n" ); >> + >> + } >> + >> + /** >> * DOCUMENT ME! >> * >> * @param type DOCUMENT ME! >> Index: >> GUS/DBAdmin/src/java/org/gusdb/dbadmin/util/GusClassHierarchyConverter.java >> =================================================================== >> --- >> GUS/DBAdmin/src/java/org/gusdb/dbadmin/util/GusClassHierarchyConverter.java >> (revision 4068) >> +++ >> GUS/DBAdmin/src/java/org/gusdb/dbadmin/util/GusClassHierarchyConverter.java >> (working copy) >> @@ -363,6 +363,9 @@ >> superClassView.setVersioned( true ); >> verSql = sql.concat( " " ); >> >> + // We need to add the superclass columns to the version view. >> + superClassView.getVersionView( >> ).setColumns((ArrayList<ColumnPair>) superClassView.getColumns().clone()); >> + >> for ( Column column : verHousekeepingColumns ) { >> verSql = verSql.concat( ", " + column.getName( ) ); >> superClassView.getVersionView( ).addColumn( new >> ColumnPair( column.getName( ), column.getName( ) ) ); >> @@ -448,7 +451,8 @@ >> if ( impTable.isVersioned( ) ) { >> subClass.setVersioned( true ); >> verSql = sql.concat( " " ); >> - >> + // We need to add the subclass_view's columns >> + subClass.getVersionView( ).setColumns((ArrayList<ColumnPair>) >> subClass.getColumns().clone()); >> for ( Column column : verHousekeepingColumns ) { >> verSql = verSql.concat( ", " + column.getName( ) ); >> subClass.getVersionView( ).addColumn( new ColumnPair( >> column.getName( ), column.getName( ) ) ); >> >> >> > |
From: Angel P. <an...@ma...> - 2006-01-10 18:18:56
Attachments:
PostgresWriter.diff
|
Hi Ricardo, I imagine that Mike has not had a chance to get to this, so I took a stab at fixing this problem. Could you test out the attached patch? Copy the file to $PROJECT_HOME then: cd $PROJECT_HOME patch -p0 <PostgresWriter.diff Then rebuild the GUS/DBAdmin project and redump the schema from the XML schema file: build GUS/DBAdmin install -append dbaDumpSchema -sourceType xml -source GusSchema/Definition/config/gus_schema.xml -targetType postgres -target gus.pg.ddl That should produce the proper PostgreSQL ddl from which you can grep the version views and test the loads. If your tests are successful, I'll commit the file and post the patch on the bug. -angel Ricardo Balbi wrote: > Mike / Steve, > We would like to know if you already had created the rules of the > version tables. > We believe that with these rules we will go to obtain the loads, > using the ISF. > In case that you have some position, you he could inform to me, please. > > thanks in advance, > Ricardo > > 2006/1/3, bug...@pc... > <mailto:bug...@pc...> > <bug...@pc... <mailto:bug...@pc...>>: > > https://www.cbil.upenn.edu/tracker/show_bug.cgi?id=257 > <https://www.cbil.upenn.edu/tracker/show_bug.cgi?id=257> > > > msa...@pc... <mailto:msa...@pc...> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Status|RESOLVED |REOPENED > Resolution|INVALID | > > > > > ------- Comment #4 from msa...@pc... > <mailto:msa...@pc...> 2006-01-03 12:05 ------- > version table rules are indeed not being created. this should be > relatively > straight forward to fix. > > > -- > Configure bugmail: > https://www.cbil.upenn.edu/tracker/userprefs.cgi?tab=email > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > > -- Angel Pizarro Director, Bioinformatics Facility Institute for Translational Medicine and Therapeutics University of Pennsylvania 806 BRB II/III 421 Curie Blvd. Philadelphia, PA 19104-6160 P: 215-573-3736 F: 215-573-9004 |
From: Ricardo B. <rb...@gm...> - 2006-01-17 12:05:40
|
Angel, I followed all the steps that you indicated me. I saved the PostgresWriter.diff file that you sent in $PROJECT_HOME. I executed the commands 1. patch - p0 < PostgresWriter.diff 2. build GUS/DBAdmin install - append 3. dbaDumpSchema - sourceType xml - source GusSchema/Definition/config/gus_schema.xml - targetType postgres - target gus.pg.ddl, that generated the gus.pg.ddl file with all the creation of the database. However, the rules of table versioning had not been created correctly because only some common fields are involved in the rules (modification_date, user_read, user_write, group_read, group_write, other_read, other_write, row_user_id, row_group_id, row_project_id, row_alg_invocation_id, version_alg_invocation_id, version_date, version_transaction_id). If the other fields will no be created, errors in the execution of ISF plugin occur when trying to insert null fields. It follows the example of three bred rules: CREATE RULE AAFeatureVer_5159 AS ON INSERT TO DoTSVer.AAFeatureVer DO INSTEAD INSERT INTO DoTSVer.AAFeatureImpVer ( MODIFICATION_DATE, USER_READ= , USER_WRITE, GROUP_READ, GROUP_WRITE, OTHER_READ, OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, VERSION_TRANSACTION_ID ) VALUES ( new.MODIFICATION_DATE, new.USER_READ, new.USER_WRITE, new.GROUP_READ, new.GROUP_WRITE, new.OTHER_READ, new.OTHER_WRITE, new.ROW_USER_ID, new.ROW_GROUP_ID, new.ROW_PROJECT_ID, new.ROW_ALG_INVOCATION_ID, new.VERSION_ALG_INVOCATION_ID, new.VERSION_DATE, new.VERSION_TRANSACTION_ID= ); CREATE RULE AffymetrixCELVer_10403 AS ON INSERT TO RADVer.AffymetrixCELVerDO INSTEAD INSERT INTO RADVer.ElementResultImpVer ( MODIFICATION_DATE, USER_READ, USER_WRITE, GROUP_READ, GROUP_WRITE, OTHER_READ, OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID= , ROW_PROJECT_ID, ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, VERSION_TRANSACTION_ID ) VALUES ( new.MODIFICATION_DATE, new.USER_READ, new.USER_WRITE, new.GROUP_READ, new.GROUP_WRITE, new.OTHER_READ, new.OTHER_WRITE, new.ROW_USER_ID, new.ROW_GROUP_ID, new.ROW_PROJECT_ID, new.ROW_ALG_INVOCATION_ID, new.VERSION_ALG_INVOCATION_I= D, new.VERSION_DATE, new.VERSION_TRANSACTION_ID ); CREATE RULE BioSourceVer_45682 AS ON INSERT TO StudyVer.BioSourceVer DO INSTEAD INSERT INTO StudyVer.BioMaterialImpVer ( MODIFICATION_DATE, USER_READ, USER_WRITE, GROUP_READ, GROUP_WRITE, OTHER_READ, OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, VERSION_TRANSACTION_ID ) VALUES ( new.MODIFICATION_DATE, new.USER_READ, new.USER_WRITE, new.GROUP_READ, new.GROUP_WRITE, new.OTHER_READ, new.OTHER_WRITE, new.ROW_USER_ID, new.ROW_GROUP_ID, new.ROW_PROJECT_ID, new.ROW_ALG_INVOCATION_ID, new.VERSION_ALG_INVOCATION_ID, new.VERSION_DATE, new.VERSION_TRANSACTION_ID= ); Do you have any idea why this is happening ? Thanks in advance, Ricardo 2006/1/10, Angel Pizarro <an...@ma...>: > > Hi Ricardo, > I imagine that Mike has not had a chance to get to this, so I took a > stab at fixing this problem. Could you test out the attached patch? Copy > the file to $PROJECT_HOME then: > > cd $PROJECT_HOME > patch -p0 <PostgresWriter.diff > > Then rebuild the GUS/DBAdmin project and redump the schema from the XML > schema file: > > build GUS/DBAdmin install -append > dbaDumpSchema -sourceType xml -source > GusSchema/Definition/config/gus_schema.xml -targetType postgres -target > gus.pg.ddl > > That should produce the proper PostgreSQL ddl from which you can grep > the version views and test the loads. If your tests are successful, I'll > commit the file and post the patch on the bug. > > -angel > > Ricardo Balbi wrote: > > > Mike / Steve, > > We would like to know if you already had created the rules of the > > version tables. > > We believe that with these rules we will go to obtain the loads, > > using the ISF. > > In case that you have some position, you he could inform to me, > please. > > > > thanks in advance, > > Ricardo > > > > 2006/1/3, bug...@pc... > > <mailto:bug...@pc...> > > <bug...@pc... <mailto:bug...@pc... > >>: > > > > https://www.cbil.upenn.edu/tracker/show_bug.cgi?id=3D257 > > <https://www.cbil.upenn.edu/tracker/show_bug.cgi?id=3D257> > > > > > > msa...@pc... <mailto:msa...@pc...> changed: > > > > What |Removed |Added > > > -------------------------------------------------------------------------= --- > > Status|RESOLVED |REOPENED > > Resolution|INVALID | > > > > > > > > > > ------- Comment #4 from msa...@pc... > > <mailto:msa...@pc...> 2006-01-03 12:05 ------- > > version table rules are indeed not being created. this should be > > relatively > > straight forward to fix. > > > > > > -- > > Configure bugmail: > > https://www.cbil.upenn.edu/tracker/userprefs.cgi?tab=3Demail > > ------- You are receiving this mail because: ------- > > You reported the bug, or are watching the reporter. > > > > > > > -- > > Angel Pizarro > Director, Bioinformatics Facility > Institute for Translational Medicine and Therapeutics > University of Pennsylvania > 806 BRB II/III > 421 Curie Blvd. > Philadelphia, PA 19104-6160 > > P: 215-573-3736 > F: 215-573-9004 > > > > Index: GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > (revision 4068) > +++ GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > (working copy) > @@ -12,6 +12,7 @@ > import org.gusdb.dbadmin.model.GusSchema; > import org.gusdb.dbadmin.model.GusTable; > import org.gusdb.dbadmin.model.GusView; > +import org.gusdb.dbadmin.model.VersionView; > import org.gusdb.dbadmin.model.Schema; > import org.gusdb.dbadmin.model.Sequence; > import org.gusdb.dbadmin.model.Table; > @@ -105,6 +106,8 @@ > super.writeView( view ); > if ( view instanceof GusView ) { > writeViewRules( (GusView) view ); > + }else if ( view instanceof VersionView ) { > + writeVersionViewRules( (VersionView) view ); > } > } > > @@ -112,8 +115,6 @@ > * Since PostgreSQL doesn't support updatable views, this is a hack > that > * uses rules to mimick the updatable view functionality. > * > - * TODO: Note that this means version views are now not updatable > since they > - * don't have a PK. > * > * @param view DOCUMENT ME! > * @throws IOException DOCUMENT ME! > @@ -174,7 +175,47 @@ > oStream.flush( ); > } > > + > /** > + * Since PostgreSQL doesn't support updatable views, this is a hack > that > + * uses rules to mimick the updatable view functionality. > + * > + * Version views are now not updatable since they > + * don't have a PK, so we limit rules to insertion > + * > + * @param view DOCUMENT ME! > + * @throws IOException DOCUMENT ME! > + */ > + private void writeVersionViewRules( VersionView view ) throws > IOException { > + oStream.write( "CREATE RULE " + view.getName( ) + "_" + > random.nextInt( 100000 ) + " AS ON INSERT TO " > + + view.getSchema( ).getName( ) + "." + view.getName( ) + > " DO INSTEAD INSERT INTO " > + + view.getTable( ).getSchema( ).getName( ) + "." + > view.getTable( ).getName( ) + " ( " ); > + > + boolean first =3D true; > + for ( ColumnPair columnPair : view.getColumns() ) { > + if ( !first ) { > + oStream.write( ", " ); > + } > + oStream.write( columnPair.getTableName( ) ); > + first =3D false; > + } > + > + oStream.write( " ) VALUES ( " ); > + > + first =3D true; > + for ( ColumnPair columnPair : view.getColumns() ) { > + if ( !first ) { > + oStream.write( ", " ); > + } > + oStream.write( "new." + columnPair.getViewName( ) ); > + first =3D false; > + } > + > + oStream.write( " );\n\n" ); > + > + } > + > + /** > * DOCUMENT ME! > * > * @param type DOCUMENT ME! > > > |
From: Angel P. <an...@ma...> - 2006-01-17 14:26:59
|
Yes, I have an idea of what is going on ... sloppy copy-paste coding on my part :( I'll add the other columns to the method and get you another patch. -angel Ricardo Balbi wrote: > Angel, > I followed all the steps that you indicated me. > I saved the PostgresWriter.diff file that you sent in $PROJECT_HOME. > I executed the commands > 1. patch - p0 < PostgresWriter.diff > 2. build GUS/DBAdmin install - append > 3. dbaDumpSchema - sourceType xml - source > GusSchema/Definition/config/gus_schema.xml - targetType postgres - > target gus.pg.ddl, > that generated the gus.pg.ddl file with all the creation of the > database. > However, the rules of table versioning had not been created > correctly because only some common fields are involved in the rules > (modification_date, user_read, user_write, group_read, group_write, > other_read, other_write, row_user_id, row_group_id, row_project_id, > row_alg_invocation_id, version_alg_invocation_id, version_date, > version_transaction_id). > If the other fields will no be created, errors in the execution of > ISF plugin occur when trying to insert null fields. > > It follows the example of three bred rules: > > CREATE RULE AAFeatureVer_5159 AS ON INSERT TO DoTSVer.AAFeatureVer DO > INSTEAD INSERT INTO DoTSVer.AAFeatureImpVer ( MODIFICATION_DATE, > USER_READ, USER_WRITE, GROUP_READ, GROUP_WRITE, OTHER_READ, > OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, > ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, > VERSION_TRANSACTION_ID ) VALUES ( new.MODIFICATION_DATE, > new.USER_READ, new.USER_WRITE, new.GROUP_READ, new.GROUP_WRITE, > new.OTHER_READ, new.OTHER_WRITE, new.ROW_USER_ID, new.ROW_GROUP_ID, > new.ROW_PROJECT_ID, new.ROW_ALG_INVOCATION_ID, > new.VERSION_ALG_INVOCATION_ID, new.VERSION_DATE, > new.VERSION_TRANSACTION_ID ); > > CREATE RULE AffymetrixCELVer_10403 AS ON INSERT TO > RADVer.AffymetrixCELVer DO INSTEAD INSERT INTO > RADVer.ElementResultImpVer ( MODIFICATION_DATE, USER_READ, USER_WRITE, > GROUP_READ, GROUP_WRITE, OTHER_READ, OTHER_WRITE, ROW_USER_ID, > ROW_GROUP_ID, ROW_PROJECT_ID, ROW_ALG_INVOCATION_ID, > VERSION_ALG_INVOCATION_ID, VERSION_DATE, VERSION_TRANSACTION_ID ) > VALUES ( new.MODIFICATION_DATE, new.USER_READ, new.USER_WRITE, > new.GROUP_READ, new.GROUP_WRITE, new.OTHER_READ, new.OTHER_WRITE, > new.ROW_USER_ID, new.ROW_GROUP_ID, new.ROW_PROJECT_ID, > new.ROW_ALG_INVOCATION_ID, new.VERSION_ALG_INVOCATION_ID, > new.VERSION_DATE, new.VERSION_TRANSACTION_ID ); > > CREATE RULE BioSourceVer_45682 AS ON INSERT TO StudyVer.BioSourceVer > DO INSTEAD INSERT INTO StudyVer.BioMaterialImpVer ( > MODIFICATION_DATE, USER_READ, USER_WRITE, GROUP_READ, GROUP_WRITE, > OTHER_READ, OTHER_WRITE, ROW_USER_ID, ROW_GROUP_ID, ROW_PROJECT_ID, > ROW_ALG_INVOCATION_ID, VERSION_ALG_INVOCATION_ID, VERSION_DATE, > VERSION_TRANSACTION_ID ) VALUES ( new.MODIFICATION_DATE, > new.USER_READ, new.USER_WRITE, new.GROUP_READ, new.GROUP_WRITE, > new.OTHER_READ, new.OTHER_WRITE, new.ROW_USER_ID, new.ROW_GROUP_ID, > new.ROW_PROJECT_ID, new.ROW_ALG_INVOCATION_ID, > new.VERSION_ALG_INVOCATION_ID, new.VERSION_DATE, > new.VERSION_TRANSACTION_ID ); > > Do you have any idea why this is happening ? > > Thanks in advance, > Ricardo > > 2006/1/10, Angel Pizarro <an...@ma... > <mailto:an...@ma...>>: > > Hi Ricardo, > I imagine that Mike has not had a chance to get to this, so I took a > stab at fixing this problem. Could you test out the attached > patch? Copy > the file to $PROJECT_HOME then: > > cd $PROJECT_HOME > patch -p0 <PostgresWriter.diff > > Then rebuild the GUS/DBAdmin project and redump the schema from > the XML > schema file: > > build GUS/DBAdmin install -append > dbaDumpSchema -sourceType xml -source > GusSchema/Definition/config/gus_schema.xml -targetType postgres > -target > gus.pg.ddl > > That should produce the proper PostgreSQL ddl from which you can grep > the version views and test the loads. If your tests are > successful, I'll > commit the file and post the patch on the bug. > > -angel > > Ricardo Balbi wrote: > > > Mike / Steve, > > We would like to know if you already had created the rules of the > > version tables. > > We believe that with these rules we will go to obtain the loads, > > using the ISF. > > In case that you have some position, you he could inform to > me, please. > > > > thanks in advance, > > Ricardo > > > > 2006/1/3, bug...@pc... > <mailto:bug...@pc...> > > <mailto:bug...@pc... > <mailto:bug...@pc...>> > > <bug...@pc... > <mailto:bug...@pc...> > <mailto:bug...@pc... > <mailto:bug...@pc...>>>: > > > > https://www.cbil.upenn.edu/tracker/show_bug.cgi?id=257 > <https://www.cbil.upenn.edu/tracker/show_bug.cgi?id=257> > > <https://www.cbil.upenn.edu/tracker/show_bug.cgi?id=257> > > > > > > msa...@pc... <mailto:msa...@pc...> > <mailto:msa...@pc... <mailto:msa...@pc...>> > changed: > > > > What |Removed |Added > > > ---------------------------------------------------------------------------- > > Status|RESOLVED |REOPENED > > Resolution|INVALID | > > > > > > > > > > ------- Comment #4 from msa...@pc... > <mailto:msa...@pc...> > > <mailto:msa...@pc... > <mailto:msa...@pc...>> 2006-01-03 12:05 ------- > > version table rules are indeed not being created. this > should be > > relatively > > straight forward to fix. > > > > > > -- > > Configure bugmail: > > https://www.cbil.upenn.edu/tracker/userprefs.cgi?tab=email > > ------- You are receiving this mail because: ------- > > You reported the bug, or are watching the reporter. > > > > > > > -- > > Angel Pizarro > Director, Bioinformatics Facility > Institute for Translational Medicine and Therapeutics > University of Pennsylvania > 806 BRB II/III > 421 Curie Blvd. > Philadelphia, PA 19104-6160 > > P: 215-573-3736 > F: 215-573-9004 > > > > Index: > GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > =================================================================== > --- > GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > (revision 4068) > +++ > GUS/DBAdmin/src/java/org/gusdb/dbadmin/writer/PostgresWriter.java > (working copy) > @@ -12,6 +12,7 @@ > import org.gusdb.dbadmin.model.GusSchema; > import org.gusdb.dbadmin.model.GusTable; > import org.gusdb.dbadmin.model.GusView ; > +import org.gusdb.dbadmin.model.VersionView; > import org.gusdb.dbadmin.model.Schema; > import org.gusdb.dbadmin.model.Sequence; > import org.gusdb.dbadmin.model.Table; > @@ -105,6 +106,8 @@ > super.writeView ( view ); > if ( view instanceof GusView ) { > writeViewRules( (GusView) view ); > + }else if ( view instanceof VersionView ) { > + writeVersionViewRules( (VersionView) view ); > } > } > > @@ -112,8 +115,6 @@ > * Since PostgreSQL doesn't support updatable views, this is > a hack that > * uses rules to mimick the updatable view functionality. > * > - * TODO: Note that this means version views are now not > updatable since they > - * don't have a PK. > * > * @param view DOCUMENT ME! > * @throws IOException DOCUMENT ME! > @@ -174,7 +175,47 @@ > oStream.flush( ); > } > > + > /** > + * Since PostgreSQL doesn't support updatable views, this is > a hack that > + * uses rules to mimick the updatable view functionality. > + * > + * Version views are now not updatable since they > + * don't have a PK, so we limit rules to insertion > + * > + * @param view DOCUMENT ME! > + * @throws IOException DOCUMENT ME! > + */ > + private void writeVersionViewRules( VersionView view ) throws > IOException { > + oStream.write( "CREATE RULE " + view.getName( ) + "_" + > random.nextInt( 100000 ) + " AS ON INSERT TO " > + + view.getSchema( ).getName( ) + "." + > view.getName( ) + " DO INSTEAD INSERT INTO " > + + view.getTable( ).getSchema( ).getName( ) + "." > + view.getTable( ).getName( ) + " ( " ); > + > + boolean first = true; > + for ( ColumnPair columnPair : view.getColumns() ) { > + if ( !first ) { > + oStream.write( ", " ); > + } > + oStream.write( columnPair.getTableName( ) ); > + first = false; > + } > + > + oStream.write( " ) VALUES ( " ); > + > + first = true; > + for ( ColumnPair columnPair : view.getColumns() ) { > + if ( !first ) { > + oStream.write( ", " ); > + } > + oStream.write( "new." + columnPair.getViewName( ) ); > + first = false; > + } > + > + oStream.write( " );\n\n" ); > + > + } > + > + /** > * DOCUMENT ME! > * > * @param type DOCUMENT ME! > > > |