Re: permission denied for large object 200936761

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Andrus <kobruleht2(at)hot(dot)ee>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-general(at)postgresql(dot)org
Subject: Re: permission denied for large object 200936761
Date: 2021-02-02 16:32:22
Message-ID: 67a7abbc-6039-fee3-23e1-02bccc02376c@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/2/21 4:12 AM, Andrus wrote:
> Hi!
>
>
>> So? What is your point?
>> Somebody created a large object of size 0.
>
> report table has bytea column. It looks like  psqlodbc driver adds ::lo
> cast  when inserting binary data:
>
> https://github.com/hlinnaka/psqlodbc/blob/master/convert.c#L4564
>
> and this adds row to pg_largeobject_metadata table. >
> Why it adds cast to lo type ? This type does not exist in Postgres
> server and causes server error.

The comment for the code snippet you linked to is:

"/*
* the oid of the large object -- just put that in for the
* parameter marker -- the data has already been sent to
* the large object
*/"

So at that point the deed has been done.

The questions to ask:

1) Why the driver thinks it is being passed a large object in the first
place?

2) Have there been any recent changes to code that passes through the
ODBC driver that would account for 1)?

3) To help with 2), where is 'INSERT INTO report ( ... ) values (.. ,
'200936767'::lo, ... )" coming from?

My suspicion is that it is user initiated change. If it is not and you
suspect the ODBC driver then I would suggest bringing it up on the -odbc
list:

https://www.postgresql.org/list/pgsql-odbc/

>
> Andrus.
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joao Miguel Ferreira 2021-02-02 16:43:47 pg_dumpall and tablespaces
Previous Message Tom Lane 2021-02-02 15:28:32 Re: libpq and mysterious "invalid byte sequence for encoding UTF8".