Re: So what's an "empty" array anyway?
От | David E. Wheeler |
---|---|
Тема | Re: So what's an "empty" array anyway? |
Дата | |
Msg-id | D88BBA3D-5FF0-4AE6-A6A5-236E72935A3B@kineticode.com обсуждение исходный текст |
Ответ на | Re: So what's an "empty" array anyway? (Andrew Chernow <ac@esilo.com>) |
Список | pgsql-hackers |
On Oct 21, 2008, at 13:00, Andrew Chernow wrote: >> On Oct 21, 2008, at 12:08, Simon Riggs wrote: >> If we got rid of zero dimension arrays, how would I declare a new >> empty array in a PL/pgSQL function? > > Why would you want to do that? Is there a use case for that? Perhaps not. In older versions of PostgreSQL, I *had* to initialize an empty array in a DECLARE block or else I couldn't use it with array_append() to collect things in an array in a loop. I don't have to do so 8.3, but I keep it that way in some modules for compatibility reasons. But since that was perhaps an issue with older versions of PostgreSQL that has since been addressed, I guess I just think too much like a Perl hacker, where I can add things to an array as I need to. That's different from SQL arrays, where you can't add a value to an existing array, create a new array from an old one plus a new value. So I guess I don't *have* to have it, but for compatibility with older versions of PostgreSQL, I think they should be kept. Best, David
В списке pgsql-hackers по дате отправления: