On 08/09/2013 12:39 AM, Kodamasimham Pridhvi (MT2012066) wrote: > > Objective: To Add XML Schema validation and xmlvalidate functions (SQL:2008) > > Description: > We’ve gone through current support of xml in postgreSQL and found that there > is a check for well-formedness of xml document while inserting and updating. > We want to extend this feature by adding xml schema validation. > We will be providing user with DDL commands for creating and deleting > XML Schema, also provision of associating xml schema with table while > creation of new table or while altering table structure, we are planning to > use libxml2 library. Proposed syntax is given below.
The first thing that comes to mind here is "what if the user wants to update/replace the schema" ? How would you handle re-validating the fields? Sure, updating XML schemas is not a great idea, but it doesn't stop people doing it. It might be reasonable to say "if you want to do this you have to drop the dependent constraints, drop the schema, re-create the schema and re-create the schema constraints" though. Why extend the create table / alter table syntax with "USE_SCHEMA"? Is there a compatibility/standards reason to do this? If not, what advantage does this provide over using a suitable CHECK constraint? IIRC there were some memory management issues with libxml2 in Pg. Anyone remember anything about that? -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers