Re: POLA violation with \c service=

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: David Fetter <david(at)fetter(dot)org>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: POLA violation with \c service=
Date: 2015-01-10 14:16:07
Message-ID: 54B13427.2020907@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-01-10 14:32:37 Re: POLA violation with \c service=
Previous Message Michael Paquier 2015-01-10 13:11:07 Re: Transactions involving multiple postgres foreign servers