[pgsqlclient-checkins] SF.net SVN: pgsqlclient: [89] trunk/PostgreSqlClient/source/PostgreSql/Data/S
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2006-04-11 12:43:49
|
Revision: 89 Author: carlosga_fb Date: 2006-04-11 05:43:34 -0700 (Tue, 11 Apr 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=89&view=rev Log Message: ----------- ?\194?\183 Added new schema for PostgreSQL tablespaces Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/MetaData.xml trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgSchemaFactory.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgTables.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/MetaData.xml =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/MetaData.xml 2006-04-11 12:05:45 UTC (rev 88) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/MetaData.xml 2006-04-11 12:43:34 UTC (rev 89) @@ -229,7 +229,7 @@ </MetaDataCollections> <MetaDataCollections> <CollectionName>Tables</CollectionName> - <NumberOfRestrictions>4</NumberOfRestrictions> + <NumberOfRestrictions>5</NumberOfRestrictions> <NumberOfIdentifierParts>0</NumberOfIdentifierParts> <PopulationMechanism>PrepareCollection</PopulationMechanism> </MetaDataCollections> @@ -241,9 +241,10 @@ </MetaDataCollections> <MetaDataCollections> <CollectionName>TableSpaces</CollectionName> - <NumberOfRestrictions>2</NumberOfRestrictions> + <NumberOfRestrictions>0</NumberOfRestrictions> <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> + <PopulationMechanism>SQLCommand</PopulationMechanism> + <PopulationString>SELECT spcname as TABLESPACE_NAME from pg_tablespace</PopulationString> </MetaDataCollections> <MetaDataCollections> <CollectionName>Triggers</CollectionName> @@ -505,6 +506,12 @@ <RestrictionNumber>4</RestrictionNumber> </Restrictions> <Restrictions> + <CollectionName>Tables</CollectionName> + <RestrictionName>Tablespace</RestrictionName> + <RestrictionDefault>tablespace</RestrictionDefault> + <RestrictionNumber>5</RestrictionNumber> + </Restrictions> + <Restrictions> <CollectionName>Triggers</CollectionName> <RestrictionName>TableCatalog</RestrictionName> <RestrictionDefault>table_catalog</RestrictionDefault> Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgSchemaFactory.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgSchemaFactory.cs 2006-04-11 12:05:45 UTC (rev 88) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgSchemaFactory.cs 2006-04-11 12:43:34 UTC (rev 89) @@ -126,6 +126,10 @@ schema = new PgPrimaryKeys(); break; + case "sequences": + schema = new PgSequences(); + break; + case "tables": schema = new PgTables(); break; Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgTables.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgTables.cs 2006-04-11 12:05:45 UTC (rev 88) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgTables.cs 2006-04-11 12:43:34 UTC (rev 89) @@ -34,6 +34,7 @@ "when 'r' THEN 'TABLE' " + "when 'v' THEN 'VIEW' " + "END AS TABLE_TYPE, " + + "pg_tablespace.spcname AS TABLESPACE, " + "pg_class.relhasindex AS HAS_INDEXES, " + "pg_class.relisshared AS IS_SHARED, " + "pg_class.relchecks AS CONSTRAINT_COUNT, " + @@ -44,6 +45,7 @@ "pg_description.description AS DESCRIPTION " + "FROM pg_class " + "left join pg_namespace ON pg_class.relnamespace = pg_namespace.oid " + + "left join pg_tablespace ON pg_class.reltablespace = pg_tablespace.oid " + "left join pg_description ON pg_class.oid = pg_description.objoid "; if (restrictions != null && restrictions.Length > 0) @@ -70,9 +72,15 @@ { sql += String.Format(" and pg_class.relkind = '{0}'", restrictions[3]); } - } - if (restrictions.Length < 4 || restrictions[3] == null) + // TABLESPACE + if (restrictions.Length > 4 && restrictions[4] != null) + { + sql += String.Format(" and pg_tablespace.spcname = '{0}'", restrictions[4]); + } + } + + if (restrictions != null && (restrictions.Length < 4 || restrictions[3] == null)) { sql += "WHERE pg_class.relkind = 'r' "; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |