Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4b0b8dad
Commit
4b0b8dad
authored
Mar 27, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new files.
parent
54f7338f
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
545 additions
and
0 deletions
+545
-0
src/backend/executor/tstoreReceiver.c
src/backend/executor/tstoreReceiver.c
+89
-0
src/backend/utils/mb/conversion_procs/conversion_create.sql
src/backend/utils/mb/conversion_procs/conversion_create.sql
+456
-0
No files found.
src/backend/executor/tstoreReceiver.c
0 → 100644
View file @
4b0b8dad
/*-------------------------------------------------------------------------
*
* tstore_receiver.c
* an implementation of DestReceiver that stores the result tuples in
* a Tuplestore
*
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.1 2003/03/27 16:53:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "executor/tstoreReceiver.h"
#include "utils/memutils.h"
#include "utils/portal.h"
typedef
struct
{
DestReceiver
pub
;
Tuplestorestate
*
tstore
;
MemoryContext
cxt
;
}
TStoreState
;
/*
* Receive a tuple from the executor and store it in the tuplestore.
*
* XXX: As currently implemented, this routine is a hack: there should
* be no tie between this code and the portal system. Instead, the
* receiver function that is part of DestFunction should be passed a
* QueryDesc, so that the call site of ExecutorRun can "sub-class"
* QueryDesc and pass in any necessary addition information (in this
* case, the Tuplestore to use).
*/
static
void
tstoreSetupReceiver
(
DestReceiver
*
self
,
int
operation
,
const
char
*
portalname
,
TupleDesc
typeinfo
)
{
TStoreState
*
myState
=
(
TStoreState
*
)
self
;
Portal
portal
;
if
(
operation
!=
CMD_SELECT
)
elog
(
ERROR
,
"Unexpected operation type: %d"
,
operation
);
portal
=
GetPortalByName
(
portalname
);
if
(
portal
==
NULL
)
elog
(
ERROR
,
"Specified portal does not exist: %s"
,
portalname
);
myState
->
tstore
=
portal
->
holdStore
;
myState
->
cxt
=
portal
->
holdContext
;
}
static
void
tstoreReceiveTuple
(
HeapTuple
tuple
,
TupleDesc
typeinfo
,
DestReceiver
*
self
)
{
TStoreState
*
myState
=
(
TStoreState
*
)
self
;
MemoryContext
oldcxt
=
MemoryContextSwitchTo
(
myState
->
cxt
);
tuplestore_puttuple
(
myState
->
tstore
,
tuple
);
MemoryContextSwitchTo
(
oldcxt
);
}
static
void
tstoreCleanupReceiver
(
DestReceiver
*
self
)
{
;
/* do nothing */
}
DestReceiver
*
tstoreReceiverCreateDR
(
void
)
{
TStoreState
*
self
=
(
TStoreState
*
)
palloc
(
sizeof
(
TStoreState
));
self
->
pub
.
receiveTuple
=
tstoreReceiveTuple
;
self
->
pub
.
setup
=
tstoreSetupReceiver
;
self
->
pub
.
cleanup
=
tstoreCleanupReceiver
;
self
->
tstore
=
NULL
;
self
->
cxt
=
NULL
;
return
(
DestReceiver
*
)
self
;
}
src/backend/utils/mb/conversion_procs/conversion_create.sql
0 → 100644
View file @
4b0b8dad
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment