Takahiro Itagaki wrote:
> KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com> wrote:
>> The attached patch fixes these matters.
> I'll start to check it.
>> We have to reference pg_largeobject_metadata to check whether a certain
>> large objct exists, or not.
> What is the situation where there is a row in pg_largeobject_metadata
> and no corresponding rows in pg_largeobject? Do we have a method to
> delete all rows in pg_largeobject but leave some metadata?
It is a case when we create a new large object, but write nothing.
postgres=# SELECT lo_create(1234);
postgres=# SELECT * FROM pg_largeobject_metadata WHERE oid = 1234;
lomowner | lomacl
postgres=# SELECT * FROM pg_largeobject WHERE loid = 1234;
loid | pageno | data
In this case, the following two queries are not equivalent.
* SELECT oid FROM pg_largeobject_metadata
* SELECT DISTINCT loid FROM pg_largeobject
The second query does not return the loid of empty large objects.
The prior implementation inserted a zero-length page to show here is
a large object with this loid, but it got unnecessary with this
If we need compatibility in this level, we can insert a zero-length
page into pg_largeobject on LargeObjectCreate().
It is harmless, but its worth is uncertain.
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
In response to
pgsql-hackers by date
|Next:||From: Fujii Masao||Date: 2009-12-11 08:01:15|
|Subject: Re: Streaming replication, some small issues|
|Previous:||From: Takahiro Itagaki||Date: 2009-12-11 07:35:22|
|Subject: Re: Largeobject Access Controls (r2460)|