1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Add a new DestReceiver for printing tuples without catalog access.

If you create a DestReciver of type DestRemote and try to use it from
a replication connection that is not bound to a specific daabase, or
any other hypothetical type of backend that is not bound to a specific
database, it will fail because it doesn't have a pg_proc catalog to
look up properties of the types being printed.  In general, that's
an unavoidable problem, but we can hardwire the properties of a few
builtin types in order to support utility commands.  This new
DestReceiver of type DestRemoteSimple does just that.

Patch by me, reviewed by Michael Paquier.

Discussion: http://postgr.es/m/CA+TgmobNo4qz06wHEmy9DszAre3dYx-WNhHSCbU9SAwf+9Ft6g@mail.gmail.com
This commit is contained in:
Robert Haas
2017-01-24 16:53:56 -05:00
parent 7b4ac19982
commit a84069d935
5 changed files with 148 additions and 2 deletions

View File

@ -0,0 +1,23 @@
/*-------------------------------------------------------------------------
*
* printsimple.h
* print simple tuples without catalog access
*
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/printsimple.h
*
*-------------------------------------------------------------------------
*/
#ifndef PRINTSIMPLE_H
#define PRINTSIMPLE_H
#include "tcop/dest.h"
extern bool printsimple(TupleTableSlot *slot, DestReceiver *self);
extern void printsimple_startup(DestReceiver *self, int operation,
TupleDesc tupdesc);
#endif /* PRINTSIMPLE_H */