On Tue, Dec 17, 2002 at 02:25:27PM -0500, Casey Duncan wrote:
> The semantics of Zope's database functionality is such that duplicate column
> names are not (and probably never will be) possible in the same result set.
> This is because Zope expects to access columns by name rather than position.
> Therefore each one must have a distinct name.
Oh, I understand the problem: just reporting that PostgreSQL isn't the
only one doing it.
> The only workaround I can see would be some sort of automatic renaming of
> columns, but that sounds like a bad idea since it introduces some serious bug
> potential if the columns are renamed differently then the application
Yeah, that'd suck.
> Just for curiousity, what is the use case for returning multiple columns with
> the same name? Sounds dubious to me.
I'm not aware of a use case, per se. It comes about from implementing this
bit of the SQL92 standard:
7.9.9.b) If the i-th <derived column> in the <select list>
does not specify an <as clause> and the <value
expression> of that <derived column> is a single <column
reference>, then the <column name> of the i-th column
of the result is C.
Note that that says 'C', not 'CR'. i.e. is _must_ be the undecorated
column name, not the column reference (schema.table.column)
The next subclause (7.9.9.c) handles the case of it not being a single
column reference (like a function, or somthing), and says it's then
'implementation dependent' and only needs to be unique in the set of
tables referenced by the SQL. It's not clear whether that's supposed
to include the 'derived table' that is the output of this 'query
Ross Reedstrom, Ph.D. [EMAIL PROTECTED]
Research Scientist phone: 713-348-6166
The Connexions Project http://cnx./rice.edu fax: 713-348-6182
Rice University MS-39
Houston, TX 77005
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -