Re: POLA violation with \c service= - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: POLA violation with \c service=
Date
Msg-id 54B13427.2020907@dunslane.net
Whole thread Raw
In response to Re: POLA violation with \c service=  (David Fetter <david@fetter.org>)
Responses Re: POLA violation with \c service=
List pgsql-hackers
On 01/09/2015 02:15 PM, David Fetter wrote:
> Some C cleanups...
>
>



Not quite enough cleanup. As I told you on IRC, the only addition to 
common.h should be the declaration of recognized_connection_string. 
These do not belong there (they belong in common.c):
   +static const char uri_designator[] = "postgresql://";   +static const char short_uri_designator[] = "postgres://";

These declarations in common.h would cause a separate instance of these 
pieces of storage to occur in every object file where the .h file had 
been #included. In general, you should not expect to see any static 
declarations in .h files.

In addition, you need to ensure that recognized_connection_string() is 
not called with a NULL argument.


cheers

andrew




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Transactions involving multiple postgres foreign servers
Next
From: Andres Freund
Date:
Subject: Re: POLA violation with \c service=