how does postgresql handle LOB/CLOB/BLOB column data that dies before the query ends

From: Noel Grandin <noelgrandin(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: how does postgresql handle LOB/CLOB/BLOB column data that dies before the query ends
Date: 2023-02-24 13:31:39
Message-ID: CAFYHVnXRLrkohn8TYrkLqUkpEc9kj8ELUNqK+9Zdakt31AYZJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

Hacker from another open-source DB here (h2database.com).

How does postgresql handle the following situation?

(1) a table containing a LOB column
(2) a query that does
ResultSet rs = query("select lob_column from table_foo");
while (rs.next())
{
retrieve_lob_data(rs.getLob(1));
.... very long running stuff here......
}

In the face of concurrent updates that might overwrite the existing LOB
data, how does PostgresQL handle this?

Does it keep the LOB data around until the ResultSet/Connection is closed?
Or does it impose some extra constraint on the client side? e.g..
explicitly opening and closing a transaction, and only wipe the "old" LOB
data when the transaction is closed?

I ask because I have implemented two of the four LOB implementations that
H2 has used, and we are still having trouble :-(

Regards, Noel.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-02-24 15:03:29 Re: pgindent vs. git whitespace check
Previous Message Andrew Dunstan 2023-02-24 13:22:43 Re: buildfarm + meson