Postgresql – Why does database not read from newly inserted data when a single query is doing both write and read?
DROP TABLE IF EXISTS A; CREATE TABLE a (id int); CREATE or replace FUNCTION insert_and_return(int) RETURNS int AS $$ BEGIN INSERT INTO a VALUES ($1); RETURN $1; END; $$ LANGUAGE plpgsql; SELECT * FROM insert_and_return(10),A AS y; Above code has…