Re: [PATCHES] small doc patch for regexp_replace

Lists: pgsql-docspgsql-patches
From: Joachim Wieland <joe(at)mcknight(dot)de>
To: pgsql-patches(at)postgresql(dot)org
Subject: small doc patch for regexp_replace
Date: 2006-05-18 00:01:41
Message-ID: 20060518000141.GA5419@mcknight.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-patches

Is there any reason, why regexp_replace is not included in the tables of the
string functions?

http://developer.postgresql.org/docs/postgres/functions-string.html

The appended patch adds regexp_replace() and links to the pattern matching
section for substring / regexp_replace.

I noticed that in the table the declaration of the arguments is
inconsistent, for example:

lower(string)
ascii(text)
length(string text)

also in the sgml, there is sometimes "text" and sometimes
"<type>text</type>".

I'd fix that if someone told me what the preferred (if any) form is...

Joachim

Attachment Content-Type Size
regexp_replace-doc.diff text/plain 3.3 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Joachim Wieland <joe(at)mcknight(dot)de>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: small doc patch for regexp_replace
Date: 2006-05-18 00:54:37
Message-ID: 200605180054.k4I0sb518077@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-patches

Joachim Wieland wrote:
> Is there any reason, why regexp_replace is not included in the tables of the
> string functions?
>
> http://developer.postgresql.org/docs/postgres/functions-string.html
>
> The appended patch adds regexp_replace() and links to the pattern matching
> section for substring / regexp_replace.
>
> I noticed that in the table the declaration of the arguments is
> inconsistent, for example:
>
> lower(string)
> ascii(text)
> length(string text)
>
> also in the sgml, there is sometimes "text" and sometimes
> "<type>text</type>".
>
> I'd fix that if someone told me what the preferred (if any) form is...

Seems there is some inconsistency there. There are two types of
function listings, one with just the types, and another with param_name
and then type. We use "string" instead of "text" because varchar() and
char() can also be used.

Anyway, applied patch attached that tries to clean it up. Let me know
if you find others.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

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

Attachment Content-Type Size
/rtmp/diff text/x-diff 6.5 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, pgsql-patches(at)postgresql(dot)org
Subject: Re: small doc patch for regexp_replace
Date: 2006-05-18 02:59:01
Message-ID: 7317.1147921141@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Seems there is some inconsistency there. There are two types of
> function listings, one with just the types, and another with param_name
> and then type. We use "string" instead of "text" because varchar() and
> char() can also be used.

Where did that come from? The actual functions generally take "text",
relying on implicit conversions to handle the other types. Since we do
not have any type named "string", I think the locution <type>string</>
is a contradiction in terms.

IMHO these should all go back to <type>text</>.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, pgsql-patches(at)postgresql(dot)org
Subject: Re: small doc patch for regexp_replace
Date: 2006-05-18 03:20:39
Message-ID: 200605180320.k4I3Kdb29964@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Seems there is some inconsistency there. There are two types of
> > function listings, one with just the types, and another with param_name
> > and then type. We use "string" instead of "text" because varchar() and
> > char() can also be used.
>
> Where did that come from? The actual functions generally take "text",
> relying on implicit conversions to handle the other types. Since we do
> not have any type named "string", I think the locution <type>string</>
> is a contradiction in terms.
>
> IMHO these should all go back to <type>text</>.

Well, we actually have <parameter>string</> and I got a few wrong. I
have committed the changes. If we want to use <type>text</> instead
of <parameter>string</>, I can make that change too. There are quite a
few of them, like md5(). Yes?

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

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


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, PostgreSQL-documentation <pgsql-docs(at)postgresql(dot)org>
Subject: Re: [PATCHES] small doc patch for regexp_replace
Date: 2006-05-18 16:43:56
Message-ID: 200605181643.k4IGhun15313@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Seems there is some inconsistency there. There are two types of
> > function listings, one with just the types, and another with param_name
> > and then type. We use "string" instead of "text" because varchar() and
> > char() can also be used.

There are many mentions of <parameter>string</> used a function
arguments in func.sgml. Should those be changed to <type>text</>?

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, PostgreSQL-documentation <pgsql-docs(at)postgresql(dot)org>
Subject: Re: [PATCHES] small doc patch for regexp_replace
Date: 2006-05-18 17:47:23
Message-ID: 16159.1147974443@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> There are many mentions of <parameter>string</> used a function
> arguments in func.sgml. Should those be changed to <type>text</>?

<parameter>string</> is fine, especially if the function actually has a
separate variant for bpchar. I was just unhappy with <type>string</>,
which is a lie.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, PostgreSQL-documentation <pgsql-docs(at)postgresql(dot)org>
Subject: Re: [PATCHES] small doc patch for regexp_replace
Date: 2006-05-18 17:51:00
Message-ID: 200605181751.k4IHp0c27785@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > There are many mentions of <parameter>string</> used a function
> > arguments in func.sgml. Should those be changed to <type>text</>?
>
> <parameter>string</> is fine, especially if the function actually has a
> separate variant for bpchar. I was just unhappy with <type>string</>,

FYI, in most cases, they don't have bpchar variants.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

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


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Joachim Wieland <joe(at)mcknight(dot)de>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: small doc patch for regexp_replace
Date: 2006-05-30 11:55:01
Message-ID: 200605301155.k4UBt1e01671@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs pgsql-patches


Patch applied. Thanks. Your documentation changes can be viewed in
five minutes using links on the developer's page,
http://www.postgresql.org/developer/testing.

---------------------------------------------------------------------------

Joachim Wieland wrote:
> Is there any reason, why regexp_replace is not included in the tables of the
> string functions?
>
> http://developer.postgresql.org/docs/postgres/functions-string.html
>
> The appended patch adds regexp_replace() and links to the pattern matching
> section for substring / regexp_replace.
>
> I noticed that in the table the declaration of the arguments is
> inconsistent, for example:
>
> lower(string)
> ascii(text)
> length(string text)
>
> also in the sgml, there is sometimes "text" and sometimes
> "<type>text</type>".
>
> I'd fix that if someone told me what the preferred (if any) form is...
>
>
> Joachim

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

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