Re: Moved simple_prompt()/sprompt.c

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: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Moved simple_prompt()/sprompt.c
Date: 2003-08-08 20:58:29
Message-ID: 200308082058.h78KwTZ21183@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Yes, thread.c, path.c, and sprompt.c should be in utils, but how do I do
> > that? Utils seems to be a place things are pulled from, rather than a
> > library that goes with every link.
>
> > Is it worth creating another library that acts just like /port but is
> > called utils, or should we just rename the directory to portutils?
>
> path.c is arguably okay material for /port, since it is dealing with
> platform-to-platform variations.
>
> sprompt.c is only going to be used by stuff under src/bin. I wonder if
> we should create a src/bin/utils directory.

I found it used by two contrib modules. I just removed the old
duplicate code because they are already linking with pgport. For this
reason, src/bin/utils is looking worse, so perhaps we should be looking
at /utils and creating a libpgutils library like pgport for 7.5.

> Not sure about thread.c --- perhaps we could just dump it into libpq.
> (libpq requires it anyway, no? So why not export it from there and let
> the apps atop libpq use the same instance.)

Yes, libpq would probably be best until we find someone else who needs
it.

> > I am looking to move fmtId() over to port too so psql can use it. It is
> > already used by pg_dump, and /scripts.
>
> That's definitely not port/ material. A src/bin/utils/ directory would
> make sense for it though.

I am thinking of just leaving fmtId() in /pg_dump and symlinking from
there as /scripts does. It is pretty specific. fmtId() actually links
in /src/backend/parser/keywords.o, so it is a really wild function. If
we put fmtId() in a library, we would need to put keywords.o in there
too, and that is just too weird, and a dependency mess.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-08-08 21:01:54 Re: WITH HOLD and pooled connections
Previous Message Tom Lane 2003-08-08 20:53:33 Re: WITH HOLD and pooled connections