pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Andrus <kobruleht2@hot.ee>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general@postgresql.org
Subject: Re: permission denied for large object 200936761
Date: Tue, 2 Feb 2021 08:32:22 -0800
Message-ID: <67a7abbc-6039-fee3-23e1-02bccc02376c@aklaver.com> (raw)
In-Reply-To: <b140314e-c4c5-8ba6-69b7-969f9e160391@hot.ee>
References: <47c92baa-949b-92d1-c162-1f0d8348fb50@hot.ee>
	<2eee8862-ea29-3e9c-30ff-82ec7ad4d99f@aklaver.com>
	<08f90e7b-8d08-d46e-abb7-85dd68bc3078@hot.ee>
	<ed44153c97970e36d7f4266370fcb1d5110f2d91.camel@cybertec.at>
	<6f141378-2651-3c71-1bab-8b5700e45fbd@hot.ee>
	<6611d34f7f5ab443a6dbac4a188ba4a1f0ecf196.camel@cybertec.at>
	<ddd26ebf-b653-e6d1-c30c-f4b385031832@hot.ee>
	<f1b313941d768ae1c19ed0a5629af845050b4c4a.camel@cybertec.at>
	<b140314e-c4c5-8ba6-69b7-969f9e160391@hot.ee>

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.klaver@aklaver.com





view thread (27+ messages)  latest in thread

Message-ID: <67a7abbc-6039-fee3-23e1-02bccc02376c@aklaver.com>
Permalink:  ../67a7abbc-6039-fee3-23e1-02bccc02376c@aklaver.com/
Also on:    postgresql.org/message-id/67a7abbc-6039-fee3-23e1-02bccc02376c@aklaver.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, kobruleht2@hot.ee, laurenz.albe@cybertec.at
  Subject: Re: permission denied for large object 200936761
  In-Reply-To: <67a7abbc-6039-fee3-23e1-02bccc02376c@aklaver.com>
  References: <47c92baa-949b-92d1-c162-1f0d8348fb50@hot.ee> <2eee8862-ea29-3e9c-30ff-82ec7ad4d99f@aklaver.com> <08f90e7b-8d08-d46e-abb7-85dd68bc3078@hot.ee> <ed44153c97970e36d7f4266370fcb1d5110f2d91.camel@cybertec.at> <6f141378-2651-3c71-1bab-8b5700e45fbd@hot.ee> <6611d34f7f5ab443a6dbac4a188ba4a1f0ecf196.camel@cybertec.at> <ddd26ebf-b653-e6d1-c30c-f4b385031832@hot.ee> <f1b313941d768ae1c19ed0a5629af845050b4c4a.camel@cybertec.at> <b140314e-c4c5-8ba6-69b7-969f9e160391@hot.ee> <67a7abbc-6039-fee3-23e1-02bccc02376c@aklaver.com>

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

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