public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bruce Momjian <[email protected]>
To: David Johnston <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: libpq "service" parameter not documented as not allowed inside a pg_service file
Date: Wed, 1 Apr 2015 16:52:48 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwbySWHzg1ogkwJg+rXK_Jgy5t8ren+iy7L_ms5Y=Yq5PQ@mail.gmail.com>
References: <CAKFQuwbySWHzg1ogkwJg+rXK_Jgy5t8ren+iy7L_ms5Y=Yq5PQ@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-docs>

On Fri, Dec 19, 2014 at 06:52:42PM -0700, David Johnston wrote:
> While the fact that you cannot do:
> 
> [service_template]
> host=xxx.xxx.xxx.xxx
> 
> [service_db1]
> dbname=db1
> service=service_template
> 
> seems obvious there is nothing in the documentation that says this is
> prohibited; and attempting a simple alias entry:

I have developed the attached patch to warn users that nesting of
service entries is not supported.  I prefer code warnings over
documentation because the user gets the warning as soon as they try
something, rather than having to hunt in the documentation.  I don't
think this issue has come up enough to warrant a doc mention too though.

-- 
  Bruce Momjian  <[email protected]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


Attachments:

  [text/x-diff] pg_service.diff (722B, 2-pg_service.diff)
  download | inline diff:
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
new file mode 100644
index e2a06b3..083e6df
*** a/src/interfaces/libpq/fe-connect.c
--- b/src/interfaces/libpq/fe-connect.c
*************** parseServiceFile(const char *serviceFile
*** 4061,4066 ****
--- 4061,4076 ----
  				}
  				*val++ = '\0';
  
+ 				if (strcmp(key, "service") == 0)
+ 				{
+ 					printfPQExpBuffer(errorMessage,
+ 									  libpq_gettext("nested service specifications not supported in service file \"%s\", line %d\n"),
+ 									  serviceFile,
+ 									  linenr);
+ 					fclose(f);
+ 					return 3;
+ 				}
+ 
  				/*
  				 * Set the parameter --- but don't override any previous
  				 * explicit setting.


view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: libpq "service" parameter not documented as not allowed inside a pg_service file
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox