Re: WIP: URI connection string support for libpq

From: Alexander Shulgin <ash(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: URI connection string support for libpq
Date: 2012-03-07 21:54:06
Message-ID: 4F57D8FE.9070201@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/07/2012 09:16 PM, Alexander Shulgin wrote:
>
>> I would prefer src/interfaces/libpq/test, to keep it close to the code.
>
> Hm, actually that makes more sense and is not unprecedented (I see ecpg
> has it's own 'test' subdir.) Apparently I was under false impression
> that all regression tests are concentrated under $(topdir)/src/test.
>
> I'll post an updated patch shortly (unless someone like to argue to keep
> the tests where they are now.)

And here it is attached (v7.) The test code now lives under libpq/test.

A colleague of mine also pointed out that expanded PGUSER/PGPORT vars
slipped into the expected.out file in the previous version, so that was
not really useful for testing.

The new version addresses the above issue by expanding shell vars in a
separate step. The test lines moved to separate file 'regress.in,'
since we are expanding the variables manually now (no need to use heredoc.)

After moving the test lines to separate file I've noticed that it was
identical to the expected output file. So I've thought it would be nice
to add some failing URIs as well (improves code coverage.) I did that
and one test highlighted a minor bug, which I've also fixed.

For that, I decided to move previously extracted parts of code back to
the main parser routine, as it was getting too ugly to pass all the
required local vars to them. I hope this won't confuse the ones who had
a chance to review previous version too much.

--
Regards,
Alex

Attachment Content-Type Size
libpq-uri-v7.patch text/x-patch 24.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-03-07 21:57:12 Re: psql COPY vs. ON_ERROR_ROLLBACK, multi-command strings
Previous Message Thom Brown 2012-03-07 21:53:35 Re: Command Triggers, patch v11