Re: postgres_fdw has insufficient support for large object

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Saladin <jiaoshuntian(at)highgo(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: postgres_fdw has insufficient support for large object
Date: 2022-05-23 05:35:33
Message-ID: CAFiTN-su2ia22jQC-Bd5_17w=XqLDKJd2wrx2ajhzH1GOvx-rg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 23, 2022 at 10:54 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Dilip Kumar <dilipbalaut(at)gmail(dot)com> writes:
> > I don't think that the local pg_largeobject should maintain the
> > foreign server's data, instead that the export should fetch the data
> > from the remote's pg_largeobject table. Then I just checked inserting
> > into the foriegn from your test as shown below[1] and I noticed that
> > the insert is also importing the large object into the local
> > pg_largeobject instead of the remote server's pg_large object, which
> > clearly seems broken to me. Basically, the actual row is inserted on
> > the remote server and the large object w.r.t. the same row is imported
> > in local pg_largeobject.
>
> > insert into oid_table_ft values(1,lo_import('/home/highgo/pictures/bird.jpg'));
>
> For this example to "work", lo_import() would have to somehow know
> that its result would get inserted into some foreign table and
> then go create the large object on that table's server instead
> of locally.

Yeah that makes sense. The lo_import() is just running as an
independent function to import the object into pg_largeobject and
return the Oid so definitely it has no business to know where that Oid
will be stored :)

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-05-23 05:38:32 Re: Convert macros to static inline functions
Previous Message Tom Lane 2022-05-23 05:24:53 Re: postgres_fdw has insufficient support for large object