Re: Is there way to detect uncommitted 'new table' in pg_class?

2018-11-01 Thread Hubert Zhang
Thanks On Thu, Nov 1, 2018 at 8:38 AM Michael Paquier wrote: > On Wed, Oct 31, 2018 at 01:30:52PM -0400, Robert Haas wrote: > > In theory, at least, you could write C code to scan the catalog tables > > with SnapshotDirty to find the catalog entries, but I don't think that > > helps a whole

Re: Is there way to detect uncommitted 'new table' in pg_class?

2018-10-31 Thread Michael Paquier
On Wed, Oct 31, 2018 at 01:30:52PM -0400, Robert Haas wrote: > In theory, at least, you could write C code to scan the catalog tables > with SnapshotDirty to find the catalog entries, but I don't think that > helps a whole lot. You couldn't necessarily rely on those catalog > entries to be in a

Re: Is there way to detect uncommitted 'new table' in pg_class?

2018-10-31 Thread Robert Haas
On Wed, Oct 31, 2018 at 6:05 AM Hubert Zhang wrote: > In PG READ UNCOMMITTED is treated as READ COMMITTED > But I have a requirement to read dirty table. Is there way to detect table > which is created in other uncommitted transaction? > > T1: > BEGIN; > create table a(i int); > > T2: > select *

Is there way to detect uncommitted 'new table' in pg_class?

2018-10-31 Thread Hubert Zhang
Hi all, In PG READ UNCOMMITTED is treated as READ COMMITTED But I have a requirement to read dirty table. Is there way to detect table which is created in other uncommitted transaction? T1: BEGIN; create table a(i int); T2: select * from pg_class where relname='a'; could return table a? --