PostgreSQL Source Code  git master
scripts_parallel.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * scripts_parallel.h
4  * Parallel support for bin/scripts/
5  *
6  * Copyright (c) 2003-2020, PostgreSQL Global Development Group
7  *
8  * src/bin/scripts/scripts_parallel.h
9  *
10  *-------------------------------------------------------------------------
11  */
12 #ifndef SCRIPTS_PARALLEL_H
13 #define SCRIPTS_PARALLEL_H
14 
15 #include "libpq-fe.h"
16 
17 
18 typedef struct ParallelSlot
19 {
20  PGconn *connection; /* One connection */
21  bool isFree; /* Is it known to be idle? */
22 } ParallelSlot;
23 
24 extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlot *slots, int numslots);
25 
26 extern ParallelSlot *ParallelSlotsSetup(const char *dbname, const char *host,
27  const char *port,
28  const char *username,
29  bool prompt_password,
30  const char *progname, bool echo,
31  PGconn *conn, int numslots);
32 
33 extern void ParallelSlotsTerminate(ParallelSlot *slots, int numslots);
34 
35 extern bool ParallelSlotsWaitCompletion(ParallelSlot *slots, int numslots);
36 
37 
38 #endif /* SCRIPTS_PARALLEL_H */
bool ParallelSlotsWaitCompletion(ParallelSlot *slots, int numslots)
ParallelSlot * ParallelSlotsSetup(const char *dbname, const char *host, const char *port, const char *username, bool prompt_password, const char *progname, bool echo, PGconn *conn, int numslots)
const char * progname
Definition: pg_standby.c:36
void ParallelSlotsTerminate(ParallelSlot *slots, int numslots)
PGconn * conn
Definition: streamutil.c:54
PGconn * connection
static int port
Definition: pg_regress.c:91
static char * username
Definition: initdb.c:133
char * dbname
Definition: streamutil.c:50
ParallelSlot * ParallelSlotsGetIdle(ParallelSlot *slots, int numslots)
struct ParallelSlot ParallelSlot