mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Include the backend ID in the relpath of temporary relations.
This allows us to reliably remove all leftover temporary relation files on cluster startup without reference to system catalogs or WAL; therefore, we no longer include temporary relations in XLOG_XACT_COMMIT and XLOG_XACT_ABORT WAL records. Since these changes require including a backend ID in each SharedInvalSmgrMsg, the size of the SharedInvalidationMessage.id field has been reduced from two bytes to one, and the maximum number of connections has been reduced from INT_MAX / 4 to 2^23-1. It would be possible to remove these restrictions by increasing the size of SharedInvalidationMessage by 4 bytes, but right now that doesn't seem like a good trade-off. Review by Jaime Casanova and Tom Lane.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.328 2010/07/22 00:47:52 rhaas Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.329 2010/08/13 20:10:50 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1019,7 +1019,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
|
||||
ExecCheckRTPerms(list_make1(rte), true);
|
||||
|
||||
/* check read-only transaction */
|
||||
if (XactReadOnly && is_from && !cstate->rel->rd_islocaltemp)
|
||||
if (XactReadOnly && is_from && cstate->rel->rd_backend != MyBackendId)
|
||||
PreventCommandIfReadOnly("COPY FROM");
|
||||
|
||||
/* Don't allow COPY w/ OIDs to or from a table without them */
|
||||
|
Reference in New Issue
Block a user