I have following script, which initialize two clusters:
echo CREATE ROLE new_user WITH LOGIN;>init_cluster.sql
echo CREATE DATABASE new_database WITH OWNER = new_user;>>init_cluster.sql
initdb -D case1 -U postgres
pg_ctl start -D case1 -w
psql "host=localhost dbname=postgres user=postgres"OIDs ass
How pg_dump interact with not MVCC-safe commands?
As I understand, pg_dump first take snapshot and then lock all tables
it intended to dump. What happens if not MVCC-safe command committed
after snapshot but before lock? From comment to pg_dump.c I understand
that it may fail with 'cache lookup fa
My question:
What happens if not MVCC-safe command committed after snapshot but before lock?
On Mon, May 20, 2024 at 12:33 PM Guillaume Lelarge
wrote:
>
> Hi,
>
> Le lun. 20 mai 2024 à 11:27, PetSerAl a écrit :
>>
>> How pg_dump interact with not MVCC-safe command
> However, it would be the very same
> database state that any other query would see at that time.
Other queries can use different techniques to prevent this. For
example, lock tables before snapshot, as recommended in documentation.
I understand, that pg_dump can not use that, as it need snapshot
Your update expression does not handle empty ranges properly, but
convert them into complete ranges.
https://dbfiddle.uk/Ia6wESpL
On Thu, Jul 11, 2024 at 5:55 PM Han Tang wrote:
>
> Hi
>
> Hope you are doing well!
>
> I am using range_agg() function, it works fine with original table value
>
> Q
How to reliable get cursor name which cause invalid_cursor_name error?
postgres=# CREATE FUNCTION value_from_cursor_unsafe(cursor_name text)
RETURNS integer
postgres-# STRICT LANGUAGE plpgsql
postgres-# AS $$
postgres$# DECLARE
postgres$# cursor CONSTANT refcursor NOT NULL := cursor_name;
po
--setup
create table a(i int);
create table b(i int);
insert into a values (1);
insert into b values (1);
-- case 1
set synchronous_commit = off;
begin read write;
update a set i = i + 1;
commit;
set synchronous_commit = on;
begin read write;
update b set i = i + 1;
commit;
-- case 2
set synchro