Re: Array with a lower bound>1, PostgreSQL 8.3.6
Tim Roberts <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Organization | Providenza & Boekelheide, Inc. |
| Message-ID | <[email protected]> |
Clodoaldo Pinto Neto wrote: > 2009/2/24 Tim Roberts <[email protected]>: > > Yes they look and feel hacky but I have used them a couple of times > before. Now that they can contain nulls and composite types they are a > bit better. Very far from python lists but usable. > > >> If you have found the ideal application for Postgres arrays >> > > I have. I have just built a function that returns multiple result sets > as arrays. It seems like the best solution for the case where the > result sets are not that big. I would prefer if pgsql functions > supported returning multiple result sets but while they don't the > array solution is good enough although a bit too much coding. > It's great that you found something that works for you. I will just point out that I have had two clients change between MySQL and Postgres deep in the middle of a project. My lesson from those experiences was to be generic, and aim for the least common denominator. Put the intelligence in the app, and let the back end just be a data store. UNIONs provide one way to return multiple result sets from a single query. They are a bit ugly to write, but at least they are standard SQL. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc.