[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] why _ and - ?

From: Horst Herb
Subject: Re: [Gnumed-devel] why _ and - ?
Date: Mon, 22 Sep 2003 17:04:18 +1000

On Tue, 2003-09-23 at 02:15, syan tan wrote:
> Why are some of the functions named with a _ before them?

What functions? In Python, a _ is prepended to declare the scope of that
object as "private".

In the case of postgres usernames, we have created "pseudo users" where
a "_" is prepended to the user name.
"user" has only read access
"_user" has write access.
That way, we prevent accidental programmatical write access to the

Problem was that Postgres does not allow real concurrent atomic
transactions inside of the scope of a single client connection; if one
transaction fails, ALL started and not committed transaction within that
connection will be rolled back as well.
That misfeature would require an unreasonable amount of client
connections if widgets handle their database access truly independent;
in order to prevent such costly number of connections, we allow pooling
of read-only queries (which do no harm) into a single read-only
connection, whereas anything that wants write-access, requests a
dedicated connection via the pseudo user name.

> The groups users created e.g. gm-doctors and test-doc have to be quoted  
> when trying to
> alter drop or create them.
> psql,   drop group "gm-doctors" , instead of what the 
> auto-complete seems to tell you ( drop group gm-doctors).

Yes, an unnecessary pain. Karsten probably wasn't aware of this - I
wasn't either until I found out.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]