#include <stddef.h>
#include "c_types/pgr_point_t.h"
Go to the source code of this file.
◆ pgr_point_input()
void pgr_point_input |
( |
char * |
points_sql, |
|
|
Pgr_point_t ** |
points, |
|
|
size_t * |
pointsTotal |
|
) |
| |
pgr_point_input
For queries of the type:
- Parameters
-
[in] | points_sql | |
[out] | points | |
[out] | pointsTotal | pgr_point_input |
Definition at line 48 of file pgr_point_input.c.
52 clock_t start_t = clock();
54 const int tuple_limit = 1000000;
56 size_t total_tuples = 0;
61 for (i = 0; i < 2; ++i) {
79 (*pointsTotal) = total_tuples;
81 while (moredata ==
true) {
82 SPI_cursor_fetch(SPIportal,
true, tuple_limit);
83 if (total_tuples == 0)
86 size_t ntuples = SPI_processed;
87 total_tuples += ntuples;
90 if ((*points) == NULL)
98 if ((*points) == NULL) {
99 elog(ERROR,
"Out of memory");
102 SPITupleTable *tuptable = SPI_tuptable;
103 TupleDesc tupdesc = SPI_tuptable->tupdesc;
106 for (t = 0; t < ntuples; t++) {
107 HeapTuple tuple = tuptable->vals[t];
109 &(*points)[total_tuples - ntuples + t]);
111 SPI_freetuptable(tuptable);
117 SPI_cursor_close(SPIportal);
120 if (total_tuples == 0) {
125 (*pointsTotal) = total_tuples;
126 time_msg(
" reading points:", start_t, clock());
References ANY_NUMERICAL, Column_info_t::colNumber, Column_info_t::eType, Column_info_t::name, pgr_fetch_column_info(), pgr_fetch_row(), pgr_SPI_cursor_open(), pgr_SPI_prepare(), Column_info_t::strict, time_msg(), and Column_info_t::type.