/* ---------------- * CreateDestReceiver - return appropriate receiver function set for dest * ---------------- */ DestReceiver * CreateDestReceiver(CommandDest dest) { switch (dest) { case DestRemote: case DestRemoteExecute: return printtup_create_DR(dest); case DestNone: return &donothingDR; case DestDebug: return &debugtupDR; case DestSPI: return &spi_printtupDR; case DestTuplestore: return CreateTuplestoreDestReceiver(); case DestIntoRel: return CreateIntoRelDestReceiver(); case DestCopyOut: return CreateCopyDestReceiver(); case DestSQLFunction: return CreateSQLFunctionDestReceiver(); } /* should never get here */ return &donothingDR; }
/* ---------------- * CreateDestReceiver - return appropriate receiver function set for dest * ---------------- */ DestReceiver * CreateDestReceiver(CommandDest dest) { /* * It's ok to cast the constness away as any modification of the none receiver * would be a bug (which gets easier to catch this way). */ switch (dest) { case DestRemote: case DestRemoteExecute: return printtup_create_DR(dest); case DestRemoteSimple: return unconstify(DestReceiver *, &printsimpleDR); case DestNone: return unconstify(DestReceiver *, &donothingDR); case DestDebug: return unconstify(DestReceiver *, &debugtupDR); case DestSPI: return unconstify(DestReceiver *, &spi_printtupDR); case DestTuplestore: return CreateTuplestoreDestReceiver(); case DestIntoRel: return CreateIntoRelDestReceiver(NULL); case DestCopyOut: return CreateCopyDestReceiver(); case DestSQLFunction: return CreateSQLFunctionDestReceiver(); case DestTransientRel: return CreateTransientRelDestReceiver(InvalidOid); case DestTupleQueue: return CreateTupleQueueDestReceiver(NULL); } /* should never get here */ pg_unreachable(); }