X-Original-To: pgsql-advocacy-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 088C9D1CCCA; Fri, 2 Apr 2004 07:03:48 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 79318-09; Fri, 2 Apr 2004 03:03:47 -0400 (AST) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 2C0C0D1CC8D; Fri, 2 Apr 2004 03:03:45 -0400 (AST) Received: from [192.168.4.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 1224347; Thu, 01 Apr 2004 22:58:24 -0800 Message-ID: <406D1031.7010603@joeconway.com> Date: Thu, 01 Apr 2004 23:03:13 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: josh@agliodbs.com Cc: pgsql-advocacy@postgresql.org, pgsql-sql@postgresql.org Subject: Re: SQL Spec Compliance Questions References: <200403302050.12415.josh@agliodbs.com> In-Reply-To: <200403302050.12415.josh@agliodbs.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/12 X-Sequence-Number: 3984 Josh Berkus wrote: > 6) SQL-99 Distinct Types > 7) SQL-99 Structured Types > 9) SQL-99 Collection Types > 10) SQL-99 Typed tables and views > My answers: > > 6), 7) Not sure what these are. Here's the section in SQL99: 4.8 User-defined types A user-defined type is a schema object, identified by a . The definition of a user-defined type specifies a number of components, including in particular a list of attribute definitions. Although the attribute definitions are said to define the representation of the userdefined type, in fact they implicitly define certain functions (observers and mutators) that are part of the interface of the user-defined type; physical representations of user-defined type values are implementation-dependent. The representation of a user-defined type is expressed either as a single data type (some predefined data type, called the source type), in which case the user-defined type is said to be a distinct type, or as a list of attribute definitions, in which case it is said to be a structured type. So if I read that correctly, they are user defined types, that are either scalar (distinct) or composite (structured) -- so I'd say yes. > 9) ??? From SQL99: 4.11 Collection types A collection is a composite value comprising zero or more elements each a value of some data type DT. If the elements of some collection C are values of DT, then C is said to be a collection of DT. The number of elements in C is the cardinality of C. The term ‘‘element’’ is not further defined in this part of ISO/IEC 9075. The term ‘‘collection’’ is generic, encompassing various types (of collection) in connection with each of which, individually, this part of ISO/IEC 9075 defines primitive type constructors and operators. This part of ISO/IEC 9075 supports one collection type, arrays. We are not yet fully compliant with SQL99 arrays, but not too far off either, I think. We have some extensions to SQL99 behavior, that would require breaking backward compatibility in order to do away with them. For example, SQL99 arrays *always* start with a lower bound of 1, if I read the spec correctly. Also multidimensional arrays in SQL99 are "arrays of arrays", which is not quite the same as our multidimensional arrays. > 10) Also not sure SQL99: 4.16.2 Referenceable tables, subtables, and supertables A table BT whose row type is derived from a structured type ST is called a typed table. Only a base table or a view can be a typed table. A typed table has columns corresponding, in name and declared type, to every attribute of ST and one other column REFC that is the self-referencing column of BT; let REFCN be the of REFC. The declared type of REFC is necessarily REF(ST) and the nullability characteristic of REFC is known not nullable. If BT is a base table, then the table constraint ‘‘UNIQUE(REFCN)’’ is implicit in the definition of BT. A typed table is called a referenceable table. A self-referencing column cannot be updated. Its value is determined during the insertion of a row into the referenceable table. The value of a system-generated selfreferencing column and a derived self-referencing column is automatically generated when the row is inserted into the referenceable table. The value of a user-generated self-referencing column is supplied as part of the candidate row to be inserted into the referenceable table. I really don't quite understand this, but I don't think we have it ;-) HTH, Joe