/*
* $Header$
*
- * Copyright (c) 2006-2015, pgpool Global Development Group
+ * Copyright (c) 2006-2023, pgpool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
/* from include/postgresql_ext.h */
#define InvalidOid ((Oid) 0)
-/* from include/pg_config_manual.h */
-/*
- * NAMEDATALEN is the max length for system identifiers (e.g. table names,
- * attribute names, function names, etc). It must be a multiple of
- * sizeof(int) (typically 4).
- *
- * NOTE that databases with different NAMEDATALEN's cannot interoperate!
- */
-#define NAMEDATALEN 64
-
/* from include/c.h */
/*
* pgpool: a language independent connection pool server for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2003-2022 PgPool Global Development Group
+ * Copyright (c) 2003-2023 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
#include <signal.h>
#include <stdio.h>
+#include "pg_config_manual.h"
+
/*
* startup packet definitions (v2) stolen from PostgreSQL
*/
#define MAX_CONNECTION_SLOTS MAX_NUM_BACKENDS
#define MAX_DB_HOST_NAMELEN MAX_FDQN_HOSTNAME_LEN
#define MAX_PATH_LENGTH 256
-#define NAMEDATALEN 64
typedef enum
{
#define POOLKEYFILE ".pgpoolkey"
#define POOLKEYFILEENV "PGPOOLKEYFILE"
-/*
- * Brought from PostgreSQL's pg_config_manual.h.
- *
- * Maximum length for identifiers (e.g. table names, column names,
- * function names). Names actually are limited to one less byte than this,
- * because the length must include a trailing zero byte.
- *
- * Please note that in version 2 protocol, maximum user name length is
- * SM_USER, which is 32.
- */
-#define NAMEDATALEN 64
-
-/* configuration file name */
#define POOL_CONF_FILE_NAME "pgpool.conf"
/* PCP user/password file name */
* pgpool: a language independent connection pool server for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2003-2012 PgPool Global Development Group
+ * Copyright (c) 2003-2023 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
#include "parser/makefuncs.h"
#define POOL_MAX_SELECT_OIDS 128
-#define POOL_NAMEDATALEN 64 /* from NAMEDATALEN of PostgreSQL */
typedef struct
{
* SHARE/UPDATE */
int num_oids; /* number of oids */
int table_oids[POOL_MAX_SELECT_OIDS]; /* table oids */
- char table_names[POOL_MAX_SELECT_OIDS][POOL_NAMEDATALEN]; /* table names */
+ char table_names[POOL_MAX_SELECT_OIDS][NAMEDATALEN]; /* table names */
} SelectContext;
extern int pool_get_terminate_backend_pid(Node *node);
#include "pool.h"
#include "pool_config.h"
+#include "pg_config_manual.h"
#include "rewrite/pool_timestamp.h"
#include "main/pool_internal_comms.h"
#include "protocol/pool_process_query.h"
num_oids = ctx->num_oids++;
ctx->table_oids[num_oids] = oid;
- strlcpy(ctx->table_names[num_oids], table, POOL_NAMEDATALEN);
+ strlcpy(ctx->table_names[num_oids], table, NAMEDATALEN);
ereport(DEBUG1,
(errmsg("extracting table oids from SELECT statement"),
{
/*
* Function name. Max size is calculated as follows: schema
- * name(POOL_NAMEDATALEN byte) + quotation marks for schema name(2 byte) +
- * period(1 byte) + table name (POOL_NAMEDATALEN byte) + quotation marks
+ * name(NAMEDATALEN byte) + quotation marks for schema name(2 byte) +
+ * period(1 byte) + table name (NAMEDATALEN byte) + quotation marks
* for table name(2 byte) + NULL(1 byte)
*/
- static char funcname[POOL_NAMEDATALEN * 2 + 1 + 2 * 2 + 1];
+ static char funcname[NAMEDATALEN * 2 + 1 + 2 * 2 + 1];
List *names;
if(fcall == NULL)
{
case 1:
strcat(funcname, "\"");
- strncat(funcname, strVal(linitial(names)), POOL_NAMEDATALEN);
+ strncat(funcname, strVal(linitial(names)), NAMEDATALEN);
strcat(funcname, "\"");
break;
case 2:
strcat(funcname, "\"");
- strncat(funcname, strVal(linitial(names)), POOL_NAMEDATALEN);
+ strncat(funcname, strVal(linitial(names)), NAMEDATALEN);
strcat(funcname, "\"");
strcat(funcname, ".");
strcat(funcname, "\"");
- strncat(funcname, strVal(lsecond(names)), POOL_NAMEDATALEN);
+ strncat(funcname, strVal(lsecond(names)), NAMEDATALEN);
strcat(funcname, "\"");
break;
case 3:
strcat(funcname, "\"");
- strncat(funcname, strVal(lsecond(names)), POOL_NAMEDATALEN);
+ strncat(funcname, strVal(lsecond(names)), NAMEDATALEN);
strcat(funcname, "\"");
strcat(funcname, ".");
strcat(funcname, "\"");
- strncat(funcname, strVal(lthird(names)), POOL_NAMEDATALEN);
+ strncat(funcname, strVal(lthird(names)), NAMEDATALEN);
strcat(funcname, "\"");
break;
{
/*
* Table name. Max size is calculated as follows: schema
- * name(POOL_NAMEDATALEN byte) + quotation marks for schema name(2 byte) +
- * period(1 byte) + table name (POOL_NAMEDATALEN byte) + quotation marks
+ * name(NAMEDATALEN byte) + quotation marks for schema name(2 byte) +
+ * period(1 byte) + table name (NAMEDATALEN byte) + quotation marks
* for table name(2 byte) + NULL(1 byte)
*/
- static char tablename[POOL_NAMEDATALEN * 2 + 1 + 2 * 2 + 1];
+ static char tablename[NAMEDATALEN * 2 + 1 + 2 * 2 + 1];
if (rangevar == NULL)
{
if (rangevar->schemaname)
{
strcat(tablename, "\"");
- strncat(tablename, rangevar->schemaname, POOL_NAMEDATALEN);
+ strncat(tablename, rangevar->schemaname, NAMEDATALEN);
strcat(tablename, "\"");
strcat(tablename, ".");
}
}
strcat(tablename, "\"");
- strncat(tablename, rangevar->relname, POOL_NAMEDATALEN);
+ strncat(tablename, rangevar->relname, NAMEDATALEN);
strcat(tablename, "\"");
ereport(DEBUG1,