Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
От | Joe Conway |
---|---|
Тема | Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] |
Дата | |
Msg-id | 44CC0A66.6070903@joeconway.com обсуждение исходный текст |
Ответ на | 8.2 features? (Andrew Dunstan <andrew@dunslane.net>) |
Ответы |
Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) |
Список | pgsql-hackers |
Tom Lane wrote: > If I'm reading the spec correctly, VALUES is exactly parallel to SELECT > in the grammar, which means that to use it in FROM you would need > parentheses and an alias: > > SELECT ... FROM (SELECT ...) AS foo > > SELECT ... FROM (VALUES ...) AS foo One of the things I'm struggling with is lack of column aliases. Would it be reasonable to require something like this? SELECT ... FROM (VALUES ...) AS foo(col1, col2, ...) The other issue is how to determine column type. Even better would be to require (similar to SRF returning record): SELECT ... FROM (VALUES ...) AS foo(col1 type1, col2 type2, ...) This would unambiguously identify the column aliases and types. Assuming we stick with the spec:SELECT ... FROM (VALUES ...) AS foo 1. How should we assign column names? values1, values2, ...? or col1, col2, ...? or ??? 2. How should we assign datatypes? Use the first "row" and try to coerce the rest to that type? Joe
В списке pgsql-hackers по дате отправления: