• Tom Lane's avatar
    Clean up handling of XactReadOnly and RecoveryInProgress checks. · 05d8a561
    Tom Lane authored
    Add some checks that seem logically necessary, in particular let's make
    real sure that HS slave sessions cannot create temp tables.  (If they did
    they would think that temp tables belonging to the master's session with
    the same BackendId were theirs.  We *must* not allow myTempNamespace to
    become set in a slave session.)
    
    Change setval() and nextval() so that they are only allowed on temp sequences
    in a read-only transaction.  This seems consistent with what we allow for
    table modifications in read-only transactions.  Since an HS slave can't have a
    temp sequence, this also provides a nicer cure for the setval PANIC reported
    by Erik Rijkers.
    
    Make the error messages more uniform, and have them mention the specific
    command being complained of.  This seems worth the trifling amount of extra
    code, since people are likely to see such messages a lot more than before.
    05d8a561
execMain.c 65 KB