[PyGreSQL] SELECTing arrays
Glen W. Mabey
Glen.Mabey at swri.org
Tue Sep 26 16:30:26 EDT 2006
On Tue, Sep 26, 2006 at 11:17:00AM -0500, Glen W. Mabey wrote:
> On Mon, Sep 25, 2006 at 04:37:35PM -0500, Glen W. Mabey wrote:
> > Hello,
> >
> > I have used the ARRAY type in the design of my DB, or more precisely,
> > in the CREATE call, I use:
> > "fileNames" VARCHAR(255)[] UNIQUE NOT NULL
> >
> > To my surprise, when fetching any combination of fields or rows from
> > that table, all of the fields for each row are returned as a single
> > string. That is, a fetchall() operation returns a list of strings,
> > instead of a list of lists as is returned on any other table I've tried
> > it with.
>
> Okay, I've learned a bit more about what I've observed; perhaps I posted
> too hastily to this list.
>
> It turns out that the difference between the structure of results that
> I'm getting is that when I execute SELECTs in scripts that are run by
> Apache, then the results are returned as a list of strings, but from the
> command prompt, they are a list of lists.
>
> I have uninstalled mod_python which (probably) was using a different
> python for execution of such a script, but that didn't change anything.
Okay, one more interesting piece of information: I get returned a list
of lists when running 7.4, and I get a list of strings when running 8.1.
Is 8.1 fully supported?
Thanks,
Glen
More information about the PyGreSQL
mailing list