Re: Can I get some PostgreSQL developer feedback on these five general issues I have with PostgreSQL and its ecosystem?

2020-10-03 Thread Peter J. Holzer
On 2020-09-23 13:38:19 -0700, Adrian Klaver wrote:
> On 9/23/20 11:51 AM, tutilu...@tutanota.com wrote:
> > This comes down to what your definition of embedded is? A matter of
> > determining whether we are talking apples or oranges.
> > 
> > Just what I said in my original question. Something which is bundled and
> > invisible to the user.
> 
> That is going to be difficult with Postgres as it is its own process. It
> would take a good bit of tooling to hide that from the user.

I guess that comes down to the definition of "invisible". PostgreSQL
certainly won't be invisible to a user running «ps -e» on Linux or using
the task manager on Windows. It also won't be invisible to someone who
examines the file system and discovers a directory structure with
PostgreSQL's rather distinctive file names (the latter is of course true
for SQLite, too).

But I don't see any great difficulty in bundling PostgreSQL with an
application, such that it is automatically installed, configured,
populated and managed by the application. The user might never notice
that it's there at all.

But this is the responsibility of the application's author: The author
can put work into an installer or they can decide that it's better (for
some definition of "better") to tell the user to install PostgreSQL
themselves. It has very little to do with PostgreSQL.


> It is more then that. It would have to take into account the behavior
> changes that happen in Postgres between major versions. It also would have
> to account for OS specific parameters and the changes that happen there
> between OS versions. It also would need to 'know' how the database was going
> to be used;

This is IMHO the most important point: Memory, CPUs, OS versions: There
is only so much variety. But how the database is used - that can be very
different. For example, on our largest database server I have work_mem
set to 1/8 of the total RAM. This is not something I would recommend
generally, but it works well for our workload. And most importantly it
isn't something that can be determined statically - it depends on the
behaviour of the application. So either you already know that (which I,
as the author of our application do (mostly), but a Postgres tuning tool
can't) or you observe the application for some time (weeks, probably)
and adjust parameters (this is something a tool could do, and maybe
better than a human, but this is getting into AI territory).

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature


Re: UUID generation problem

2020-10-03 Thread Paul Förster
Hi James,

> On 03. Oct, 2020, at 04:17, James B. Byrne  wrote:
> 
> On Fri, October 2, 2020 21:13, Tom Lane wrote:
>> "James B. Byrne"  writes:
>>> On Fri, October 2, 2020 18:46, Tom Lane wrote:
>> 
>>> idempiere=# \dn
>>>List of schemas
>>>   Name|   Owner
>>> ---+---
>>> adempiere | adempiere
>>> public| postgres

> I will resolve the conflict either by granting 'idempiere_dbadmin' the
> necessary privileges or by changing the connection to use the 'adempiere' user
> instead.

you can also rename roles/users:

alter role adempiere_dbadmin rename to idempiere_dbadmin;

https://www.postgresql.org/docs/13/sql-alterrole.html

or schema:

alter schema adempiere rename to idempiere;

https://www.postgresql.org/docs/13/sql-alterschema.html

Cheers,
Paul



Re: pg_upgrade Python version issue on openSUSE

2020-10-03 Thread Peter J. Holzer
On 2020-09-26 17:54:31 +0200, Paul Förster wrote:
> Hi Adrian,
> > On 26. Sep, 2020, at 17:43, Adrian Klaver
> >  wrote:
> > 
> > I suppose getting them to install Python 2 is out of the question?
> > It is an official package.
> 
> I can try, but chances are at 99% that they refuse.
> 
> > Well there is always going to be versioning. If you mean the
> > incompatibility split, then for 2/3 that is not going away. There
> > will be a Python 4, but the core developers have said they learned
> > their lesson and it will just be an incremental upgrade.
> 
> so you're saying there will always be two Pythons? One Python 2 and
> one Python x (with x>=3)? Oh my god... Why don't they just make Python
> 3 backward compatible?

Python 2 is officially unsupported by the Python team since January 1st
2020. There has been one final release after that, but that contained
only bug fixes which were already pending before that date.

So as far as the Python team is concerned, there is only one Python and
that is Python 3.

But there is still a lot of legacy software out there and there are OSs
with very long (like 10 years) maintenance periods. So in practical
terms, Python 2 isn't dead, it just smells funny.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature


Re: Restoring a database problem

2020-10-03 Thread Peter J. Holzer
On 2020-09-30 20:11:12 -0500, Ron wrote:
> On 9/30/20 7:11 PM, Bruce Momjian wrote:
> > On Thu, Oct  1, 2020 at 01:00:21PM +1300, Glen Eustace wrote:
> > > I have had to do this so rarely and it has almost always been in a bit of 
> > > a
> > > panic so may well be missing something really obvious.
> > > 
> > > What I want to know is how to quiese a database to that I can restore it.
> > > 
> > > I need to close all existing connections and the prevent people/processes 
> > > from
> > > connecting again until the restore has completed.
[...]
> > I would modify pg_hba.conf to block access temporarily.
> 
> As would I; it's the first thing I thought of...

Interesting. The first thing I thought of was "iptables"[1]. Probably shows
that I'm a Linux guy first and a database guy second.

hp

[1] Yes, I know that this doesn't affect connections through Unix
sockets.

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature


Re: Profile Creation

2020-10-03 Thread Brajendra Pratap Singh
Hi Adrian,

Here the user profile means which contains the following functionality same
as in  EDB profile contains like password_verify_function,
password_life_time, password_lock_time etc.

Thanks,
Singh

On Sat, 3 Oct, 2020, 2:14 AM Adrian Klaver, 
wrote:

> On 10/2/20 1:40 PM, Brajendra Pratap Singh wrote:
> > Hi All,
> >
> > How can we create a user profile in open postgresql db?
>
> You are going to need to be more specific about what you consider a user
> profile to be.
>
> >
> > Thanks,
> > Singh
>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>


Re: Restoring a database problem

2020-10-03 Thread Glen Eustace
> I need to close all existing connections and the prevent people/processes from
> connecting again until the restore has completed.
I was hoping there was a command in psql that would do both, that is,
kick the exisiting connections and stop new ones.  It was being a bit
optimistic I think, but such a command would be really useful, IMHO.

Modifying pg_hba.conf, is a little complicated. The daemons are using
the db owner's credential and the backups are on a different server so I
still need to be able to connect to do the restore.

I guess I will need something like

local    mydb    all                reject
host    mydb    postgres    0.0.0.0/0    password
host    mydb    postgres    ::0/0        password
host    mydb    all      0.0.0.0/0    reject
host    mydb    all        ::0/0    reject

then systemctl reload postgresql-10

then from the server with the backup on it
pg_restore -h db-server -Upostgres -c -C -d mydb mydb-backup

Modifying pg_hba isnt going to kick the existing connections, so I will
need to do that either using psql and the commands in the article Rob
posted, (I think I have used that method somewhere already). or kill
them on the DB server

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Glen Eustace,
GodZone Internet Services, a division of AGRE Enterprises Ltd.,
P.O. Box 8020, Palmerston North, New Zealand 4446 Ph +64 6 357 8168, Mob
+64 27 542 4015

“Specialising in providing low-cost professional Internet Services since
1997"


signature.asc
Description: OpenPGP digital signature