Allow the identifier length to be increased via a configure option

Lists: pgsql-hackerspgsql-patches
From: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Allow the identifier length to be increased via a configure option
Date: 2006-12-27 10:02:51
Message-ID: 459244CB.2010205@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

I am sending the patch for the following TODO item:
Allow the identifier length to be increased via a configure option

During the configuration time, the user can set the identifier length.
./configure.txt --with-identlen=128

However, I am not clear about the requirement.
Can somebody review and comment on this?

Thanks
Dhanaraj

PS: The regression test (name.sql) needs some changes.

*** configure.in.orig Wed Dec 27 14:56:10 2006
--- configure.in Wed Dec 27 14:58:43 2006
***************
*** 179,184 ****
--- 179,196 ----
AC_SUBST(default_port)

#
+ # Identifier length ( --with-identlen), default 64 bytes
+ #
+ AC_MSG_CHECKING([for identifier length])
+ PGAC_ARG_REQ(with, identlen, [ --with-identlen=INT identifier
length [[64 bytes]]],
+ [identlen=$withval],
+ [identlen=64])
+ AC_MSG_RESULT([$identlen])
+
+ sed 's/#define NAMEDATALEN .*/#define NAMEDATALEN '$identlen'/g'
./src/include/postgres_ext.h > ./src/include/postgres_ext.h.tmp
+ mv ./src/include/postgres_ext.h.tmp ./src/include/postgres_ext.h
+
+ #
# Option to disable shared libraries
#
PGAC_ARG_BOOL(enable, shared, yes,


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Allow the identifier length to be increased via a configure option
Date: 2006-12-27 20:22:35
Message-ID: 20061227202235.GW23059@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Dhanaraj M wrote:
> I am sending the patch for the following TODO item:
> Allow the identifier length to be increased via a configure option
>
> During the configuration time, the user can set the identifier length.
> ./configure.txt --with-identlen=128
>
> However, I am not clear about the requirement.
> Can somebody review and comment on this?

You should use pg_config.h, not mangle postgres_ext.h like that. Or
maybe generate postgres_ext.h from an hypotetical postgres_ext.h.in (but
I wouldn't do that, really).

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Allow the identifier length to be increased via a configure option
Date: 2006-12-27 20:29:48
Message-ID: 22139.1167251388@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Dhanaraj M wrote:
>> I am sending the patch for the following TODO item:
>> Allow the identifier length to be increased via a configure option

> You should use pg_config.h, not mangle postgres_ext.h like that. Or
> maybe generate postgres_ext.h from an hypotetical postgres_ext.h.in (but
> I wouldn't do that, really).

I'm wondering how this got into the TODO list. It seems rather
pointless, and likely to create client compatibility problems (if not,
why is NAMEDATALEN exported at all?)

A bigger problem with the proposed patch is that it makes it look like
you can set the identifier length to any random number; the restrictions
mentioned in postgres_ext.h aren't enforced or even displayed to the
user of configure.

regards, tom lane


From: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Allow the identifier length to be increased via a
Date: 2006-12-28 09:17:00
Message-ID: 45938B8C.70802@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>
>> Dhanaraj M wrote:
>>
>>> I am sending the patch for the following TODO item:
>>> Allow the identifier length to be increased via a configure option
>>>
>
>
>> You should use pg_config.h, not mangle postgres_ext.h like that. Or
>> maybe generate postgres_ext.h from an hypotetical postgres_ext.h.in (but
>> I wouldn't do that, really).
>>
>
> I'm wondering how this got into the TODO list. It seems rather
> pointless, and likely to create client compatibility problems (if not,
> why is NAMEDATALEN exported at all?)
>
Will this TODO item be removed from the list?
Or I shall proceed with the suggestions given.

Thanks
Dhanaraj


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Dhanaraj(dot)M(at)Sun(dot)COM
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Allow the identifier length to be increased via
Date: 2007-01-06 22:55:20
Message-ID: 200701062255.l06MtK112265@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Dhanaraj M wrote:
> Tom Lane wrote:
> > Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> >
> >> Dhanaraj M wrote:
> >>
> >>> I am sending the patch for the following TODO item:
> >>> Allow the identifier length to be increased via a configure option
> >>>
> >
> >
> >> You should use pg_config.h, not mangle postgres_ext.h like that. Or
> >> maybe generate postgres_ext.h from an hypotetical postgres_ext.h.in (but
> >> I wouldn't do that, really).
> >>
> >
> > I'm wondering how this got into the TODO list. It seems rather
> > pointless, and likely to create client compatibility problems (if not,
> > why is NAMEDATALEN exported at all?)
> >
> Will this TODO item be removed from the list?
> Or I shall proceed with the suggestions given.

TODO item removed.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Dhanaraj M <Dhanaraj(dot)M(at)sun(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Allow the identifier length to be increased via a configure option
Date: 2007-01-06 23:13:29
Message-ID: 200701070013.30303.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> I'm wondering how this got into the TODO list. It seems rather
> pointless, and likely to create client compatibility problems (if
> not, why is NAMEDATALEN exported at all?)

I think because it used to be used in libpq's notification structure.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Dhanaraj M <Dhanaraj(dot)M(at)sun(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Allow the identifier length to be increased via a configure option
Date: 2007-01-07 00:02:11
Message-ID: 28087.1168128131@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane wrote:
>> ... why is NAMEDATALEN exported at all?)

> I think because it used to be used in libpq's notification structure.

Yeah, you're probably right. Maybe we should take it out of
postgres_ext.h and move it to pg_config_manual.h. If no one complains
after a release cycle or so, we could reconsider making it configurable
more easily.

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Dhanaraj M <Dhanaraj(dot)M(at)sun(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] [PATCHES] Allow the identifier length to be
Date: 2007-01-11 03:01:13
Message-ID: 200701110301.l0B31Dc19002@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Tom Lane wrote:
> >> ... why is NAMEDATALEN exported at all?)
>
> > I think because it used to be used in libpq's notification structure.
>
> Yeah, you're probably right. Maybe we should take it out of
> postgres_ext.h and move it to pg_config_manual.h. If no one complains
> after a release cycle or so, we could reconsider making it configurable
> more easily.

Added to TODO:

* Move NAMEDATALEN from postgres_ext.h to pg_config_manual.h and
consider making it more configurable in future releases

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +