Re: [HACKERS] string function

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Zakkr <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] string function
Date: 1999-09-29 15:30:26
Message-ID: 37F23092.23270CDB@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Try somebody implemeny strftime(),strcat() to PSQL ? -
> (is any problem in PSQL, that not exist more string/date/..etc functions or
> is problem with programmer absence (only) ?)

It is some combination of: 1) a mild reluctance to add too many
specialty functions, 2) no specific need, at least from a programmer
who can make it happen, 3) unclear tradeoffs between bigger hammers
causing more damage than they help, and 4) existing functionality
which already does it. Oh, and 5) simply that no one has done it yet!

In (almost) all cases, extensions can be put into the contrib area,
and that is a good way to test out new functionality. In some cases,
new functionality should go into the main tree directly. Of the cases
you just mentioned:

1) strftime() allows arbitrary formatting of date/time strings.
Certainly useful, though one can easily format a string that is no
longer recognizable to Postgres as a date which is one reason why I
didn't code it up previously. Perhaps we should focus on an
Oracle-compatible routine for this; I think it uses tochar() to do
formatting. Someone recently volunteered to send in code which could
be used for this, but I haven't seen the code yet :(

2) strcat() concatenates two strings? There is a full set of functions
which do this, and they are used to support the SQL92 concatenation
operator "||".

But in general, more functionality is A Good Thing, and discussing it
on the hackers list is a good way to get people used to a new idea, or
to evolve a new idea into something people like even better.

- Thomas

--
Thomas Lockhart lockhart(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-09-29 15:39:55 Re: New notices?
Previous Message Don Baccus 1999-09-29 15:21:58 Re: [HACKERS] Planner drops unreferenced tables --- bug, no?