public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: [email protected]
To: psycopg <[email protected]>
Subject: Re: TypeError: dict is not a sequence
Date: Fri, 1 Nov 2024 09:12:13 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <20241101161113.Horde.0Bgt_EQ0glbsBmc_1YpZj90@webmail.gelassene-pferde.biz>
References: <20241101111747.Horde.GgVaeCJ_Ig6HsmcfjbNwguM@webmail.gelassene-pferde.biz>
	<CAG18HBwZ6piGnEY6D_2Dv3F=6kujhmL_X2aJo=baOf7kMD9Axw@mail.gmail.com>
	<20241101161113.Horde.0Bgt_EQ0glbsBmc_1YpZj90@webmail.gelassene-pferde.biz>

On 11/1/24 08:11, [email protected] wrote:
> Hi Jim
> 
>> I suspect the source of the problem is the commented-out line
>>
>>  -- ST_FromGDALRaster(pg_read_binary_file(%s)),
>>
>> in the statement.
> 
> You are right. I was not expecting the comment to be relevant for the 
> parameter replacement. Many thanks for the hint.

That is an SQL(---) comment and I am guessing the parser sees the 
parameter before it gets to the comment.
> 
> I now have an error, not related to psycopg, as far as I can tell.
> 
> psycopg2.errors.InternalError_: RASTER_fromGDALRaster: Could not open 
> bytea with GDAL. Check that the bytea is of a GDAL supported format

This looks to be on the PostGIS end related to the ST_FromGDALRaster() 
function. Does:

select ST_FromGDALRaster(the_field);

work in psql?

> 
>> Maybe the difference in the errors is due to a different version of
>> psycopg? This is what I am using:
>>
>>>>> sys.version
>>> '3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0]'
>>> >>> psycopg.__version__
>>> '3.2.3'
> 
> Probably.
>>>> sys.version
> '3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0]'
>>>> psycopg.__version__
> '3.1.7'
> 
> 
> Many thanks for your support.
> 
> 
> 

-- 
Adrian Klaver
[email protected]






view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: TypeError: dict is not a sequence
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox