Re: Trivial libpq refactoring patch (was: Re: Another review of URI for libpq, v7 submission)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alex Shulgin <ash@commandprompt.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-03-22T16:10:15Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Refactor to eliminate duplicate copies of conninfo default-finding code.

Alex Shulgin <ash@commandprompt.com> writes:
> While working on this fix I've figured out that I need my
> conninfo_uri_parse to support use_defaults parameter, like
> conninfo(_array)_parse functions do.

> The problem is that the block of code which does the defaults handling
> is duplicated in both of the above functions.  What I'd like to do is
> extract it into a separate function to call.  What I wouldn't like is
> bloating the original URI patch with this unrelated change.

Applied with minor adjustments --- notably, I thought
conninfo_add_defaults was a better name for the function.

			regards, tom lane