Re: [GNC] Postgress connection string for nonstandard port

2023-02-26 Thread Geert Janssens
Op donderdag 23 februari 2023 22:00:12 CET schreef Bob Treumann:
> Thanks for all the feedback.   I will share my learnings;
> 
> The database must be created before you connect to it.The install
> process creates all the tables in the Public schema in that database once
> it connects successfully.

If your postgresql user has proper database creation rights, the database 
doesn't have to 
exist prior.

> 
> Geert Janssens referenced the code where he could tell that the appended
> port should work.
> Geert, can you tell me where to find that? I would like to see if I can
> modify it to connect to my chosen database and schema rather than using the
> public schema in a dedicated database.

I can give you a few pointers, but I'm afraid the whole path is not that 
straightforward.

I have started from the code that reads the database parameters:
https://github.com/Gnucash/gnucash/blob/maint/gnucash/gnome-utils/dialog-file-access.c#L71[1]
That code will eventually call 'gnc_uri_create_uri' in
_https://github.com/Gnucash/gnucash/blob/maint/gnucash/gnome-utils/dialog-file-access.c#L9_8
Note the port parameter is set to 0, which suggests to omit adding a port 
number to the uri 
by code. However if the host parameter contains a port part, that will be 
retained in the final 
uri, and that's how you can pass a non-standard port when entering database 
parameters.

> 
> I mentioned in another post that Postgress creates multiple schemas in a
> single database.That is my preferred way of operating because I can
> read and write to other schemas without connecting across databases.I'm
> not even sure if PG supports cross database connections.

There is no support for schemas other than the default, because schemas are a 
feature 
specific to postgresql and the same database code in gnucash also has to work 
with mysql 
and sqlite.

If you want to look into implementing some kind of generic table prefix (which 
could 
translate into a schema in posgresql and just a name prefix in the other 
databases), you will 
probably have to combine amandments in the gnc_uri code with changes in the dbi 
backend 
code found here
https://github.com/Gnucash/gnucash/tree/maint/libgnucash/backend/dbi[2]

Regards,

Geert


[1] 
https://github.com/Gnucash/gnucash/blob/maint/gnucash/gnome-utils/dialog-file-access.c#L71
[2] https://github.com/Gnucash/gnucash/tree/maint/libgnucash/backend/dbi
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Postgress connection string for nonstandard port

2023-02-26 Thread Geert Janssens
The attached image only shows the connection parameters as entered by the OP. 
It doesn't 
indicate any errors in itself.

But to be sure I have just verified this myself. I created a postgresql server 
listening on a 
non-standard port, and used the method I described below to successfully save a 
gnucash 
session to a pre-existing, empty database.

Regards,

Geert

Op donderdag 23 februari 2023 09:36:04 CET schreef Peter West:
> The OP said that that was not working (see his attached image.)
> 
> 
> —
> Peter West
> p...@pbw.id.au
> “Blessed are the peacemakers, for they shall be called sons of God.”
> 
> > On 23 Feb 2023, at 6:30 pm, Geert Janssens 
> > wrote:
> > 
> > From what I read in the code you should be able to pass a custom port by
> > adding it in the hostname field, like so:
> > 
> > yourserver.xyz:6543
> > 
> > Regards,
> > 
> > Geert

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Postgress connection string for nonstandard port

2023-02-23 Thread Bob Treumann
Thanks for all the feedback.   I will share my learnings;

The database must be created before you connect to it.The install
process creates all the tables in the Public schema in that database once
it connects successfully.

Geert Janssens referenced the code where he could tell that the appended
port should work.
Geert, can you tell me where to find that? I would like to see if I can
modify it to connect to my chosen database and schema rather than using the
public schema in a dedicated database.

I mentioned in another post that Postgress creates multiple schemas in a
single database.That is my preferred way of operating because I can
read and write to other schemas without connecting across databases.I'm
not even sure if PG supports cross database connections.

Thanks for everyones help!


On Thu, Feb 23, 2023 at 2:36 AM Peter West  wrote:

> The OP said that that was not working (see his attached image.)
>
>
> —
> Peter West
> p...@pbw.id.au
> “Blessed are the peacemakers, for they shall be called sons of God.”
>
> On 23 Feb 2023, at 6:30 pm, Geert Janssens 
> wrote:
>
> From what I read in the code you should be able to pass a custom port by
> adding it in the hostname field, like so:
>
> yourserver.xyz:6543
>
> Regards,
>
> Geert
>
> Op donderdag 23 februari 2023 07:26:09 CET schreef Peter West:
> > Are you on Windows, Mac or linux? How do you invoke GnuCash? There will
> be
> > some sort of environment in which the invocation occurs from your end.
> >
> > —
> > Peter West
> > p...@pbw.id.au
> > “Blessed are the peacemakers, for they shall be called sons of God.”
> >
> > > On 23 Feb 2023, at 2:13 am, Bob Treumann  wrote:
> > >
> > >
> > >
> > > I could set it since I control the server, but I don't know where I
> would
> > > set it so that it would take effect before the connection attempt is
> > > made.
> > >
> > > On Tue, Feb 21, 2023 at 10:53 PM Peter West  > > > wrote: Is it possible for you
> to set the PGPORT
> > > environment variable?
> > >
> > >
> > > —
> > > Peter West
> > > p...@pbw.id.au 
> > > “Blessed are the peacemakers, for they shall be called sons of God.”
> > >
> > >> On 22 Feb 2023, at 11:01 am, Peter West  > >> > wrote:
> > >>
> > >> I’m using the default port, so I can’t help there.
> > >>
> > >> “Database” refers to the database, in my case, gnucash.
> > >>
> > >>
> > >> —
> > >> Peter West
> > >> p...@pbw.id.au 
> > >> “Blessed are the pure in heart, for they shall see God.”
> > >>
> > >>> On 22 Feb 2023, at 8:07 am, Bob Treumann  > >>> > wrote:
> > >>>
> > >>> I am running PG on an amazon server on a non standard port (6543).
> > >>>
> > >>> The connection setup on gnucash does not have a filed to input the
> port.
> > >>> I added the port to the end of the hostname, a style that has worked
> > >>> with
> > >>> other applications.
> > >>>
> > >>> There is a field to enter the "database", which in PG contains
> multiple
> > >>> schemas.
> > >>> The user is typically connected to a schema by a default path.
> > >>>
> > >>> My questions are:
> > >>> How do I define the port?
> > >>> Does "Database" refer to "Schema"?
> > >>>
> > >>> I would try every combination but the interface only gives me one
> > >>> chance.
> > >>> It gives a "cannot connect" message then closes.
> > >>>
> > >>>
> > >>> [image: image.png]
> > >>> ___
> > >>> gnucash-user mailing list
> > >>> gnucash-user@gnucash.org  >
> > >>> To update your subscription preferences or to unsubscribe:
> > >>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > >>>  -
> > >>> Please remember to CC this list on all your replies.
> > >>> You can do this by using Reply-To-List or Reply-All.
> > >>
> > >> ___
> > >> gnucash-user mailing list
> > >> gnucash-user@gnucash.org  >
> > >> To update your subscription preferences or to unsubscribe:
> > >> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > >>  -
> > >> Please remember to CC this list on all your replies.
> > >> You can do this by using Reply-To-List or Reply-All.
> >
> > ___
> > gnucash-user mailing list
> > gnucash-user@gnucash.org
> > To update your subscription preferences or to unsubscribe:
> > https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > -
> > Please remember to CC this list on all your replies.
> > You can do this by using Reply-To-List or Reply-All.
>
>
>
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-

Re: [GNC] Postgress connection string for nonstandard port

2023-02-23 Thread Peter West
The OP said that that was not working (see his attached image.)


—
Peter West
p...@pbw.id.au
“Blessed are the peacemakers, for they shall be called sons of God.”

> On 23 Feb 2023, at 6:30 pm, Geert Janssens  wrote:
> 
> From what I read in the code you should be able to pass a custom port by 
> adding it in the hostname field, like so:
> 
> yourserver.xyz:6543
> 
> Regards,
> 
> Geert
> 
> Op donderdag 23 februari 2023 07:26:09 CET schreef Peter West:
> > Are you on Windows, Mac or linux? How do you invoke GnuCash? There will be
> > some sort of environment in which the invocation occurs from your end.
> >
> > —
> > Peter West
> > p...@pbw.id.au
> > “Blessed are the peacemakers, for they shall be called sons of God.”
> >
> > > On 23 Feb 2023, at 2:13 am, Bob Treumann  wrote:
> > >
> > >
> > >
> > > I could set it since I control the server, but I don't know where I would
> > > set it so that it would take effect before the connection attempt is
> > > made.
> > >
> > > On Tue, Feb 21, 2023 at 10:53 PM Peter West  > > > wrote: Is it possible for you to set the PGPORT
> > > environment variable?
> > >
> > >
> > > —
> > > Peter West
> > > p...@pbw.id.au 
> > > “Blessed are the peacemakers, for they shall be called sons of God.”
> > >
> > >> On 22 Feb 2023, at 11:01 am, Peter West  > >> > wrote:
> > >>
> > >> I’m using the default port, so I can’t help there.
> > >>
> > >> “Database” refers to the database, in my case, gnucash.
> > >>
> > >>
> > >> —
> > >> Peter West
> > >> p...@pbw.id.au 
> > >> “Blessed are the pure in heart, for they shall see God.”
> > >>
> > >>> On 22 Feb 2023, at 8:07 am, Bob Treumann  > >>> > wrote:
> > >>>
> > >>> I am running PG on an amazon server on a non standard port (6543).
> > >>>
> > >>> The connection setup on gnucash does not have a filed to input the port.
> > >>> I added the port to the end of the hostname, a style that has worked
> > >>> with
> > >>> other applications.
> > >>>
> > >>> There is a field to enter the "database", which in PG contains multiple
> > >>> schemas.
> > >>> The user is typically connected to a schema by a default path.
> > >>>
> > >>> My questions are:
> > >>> How do I define the port?
> > >>> Does "Database" refer to "Schema"?
> > >>>
> > >>> I would try every combination but the interface only gives me one
> > >>> chance.
> > >>> It gives a "cannot connect" message then closes.
> > >>>
> > >>>
> > >>> [image: image.png]
> > >>> ___
> > >>> gnucash-user mailing list
> > >>> gnucash-user@gnucash.org 
> > >>> To update your subscription preferences or to unsubscribe:
> > >>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > >>>  -
> > >>> Please remember to CC this list on all your replies.
> > >>> You can do this by using Reply-To-List or Reply-All.
> > >>
> > >> ___
> > >> gnucash-user mailing list
> > >> gnucash-user@gnucash.org 
> > >> To update your subscription preferences or to unsubscribe:
> > >> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > >>  -
> > >> Please remember to CC this list on all your replies.
> > >> You can do this by using Reply-To-List or Reply-All.
> >
> > ___
> > gnucash-user mailing list
> > gnucash-user@gnucash.org
> > To update your subscription preferences or to unsubscribe:
> > https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > -
> > Please remember to CC this list on all your replies.
> > You can do this by using Reply-To-List or Reply-All.
> 
> 

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Postgress connection string for nonstandard port

2023-02-23 Thread Geert Janssens
From what I read in the code you should be able to pass a custom port by adding 
it in the 
hostname field, like so:

yourserver.xyz:6543

Regards,

Geert

Op donderdag 23 februari 2023 07:26:09 CET schreef Peter West:
> Are you on Windows, Mac or linux? How do you invoke GnuCash? There will be
> some sort of environment in which the invocation occurs from your end.
> 
> —
> Peter West
> p...@pbw.id.au
> “Blessed are the peacemakers, for they shall be called sons of God.”
> 
> > On 23 Feb 2023, at 2:13 am, Bob Treumann  wrote:
> > 
> > 
> > 
> > I could set it since I control the server, but I don't know where I would
> > set it so that it would take effect before the connection attempt is
> > made.
> > 
> > On Tue, Feb 21, 2023 at 10:53 PM Peter West  > > wrote: Is it possible for you to set the PGPORT
> > environment variable?
> > 
> > 
> > —
> > Peter West
> > p...@pbw.id.au 
> > “Blessed are the peacemakers, for they shall be called sons of God.”
> > 
> >> On 22 Feb 2023, at 11:01 am, Peter West  >> > wrote:
> >> 
> >> I’m using the default port, so I can’t help there.
> >> 
> >> “Database” refers to the database, in my case, gnucash.
> >> 
> >> 
> >> —
> >> Peter West
> >> p...@pbw.id.au 
> >> “Blessed are the pure in heart, for they shall see God.”
> >> 
> >>> On 22 Feb 2023, at 8:07 am, Bob Treumann  >>> > wrote:
> >>> 
> >>> I am running PG on an amazon server on a non standard port (6543).
> >>> 
> >>> The connection setup on gnucash does not have a filed to input the port.
> >>> I added the port to the end of the hostname, a style that has worked
> >>> with
> >>> other applications.
> >>> 
> >>> There is a field to enter the "database", which in PG contains multiple
> >>> schemas.
> >>> The user is typically connected to a schema by a default path.
> >>> 
> >>> My questions are:
> >>> How do I define the port?
> >>> Does "Database" refer to "Schema"?
> >>> 
> >>> I would try every combination but the interface only gives me one
> >>> chance.
> >>> It gives a "cannot connect" message then closes.
> >>> 
> >>> 
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Postgress connection string for nonstandard port

2023-02-22 Thread Peter West
Are you on Windows, Mac or linux? How do you invoke GnuCash? There will be some 
sort of environment in which the invocation occurs from your end.

—
Peter West
p...@pbw.id.au
“Blessed are the peacemakers, for they shall be called sons of God.”

> On 23 Feb 2023, at 2:13 am, Bob Treumann  wrote:
> 
> 
> 
> I could set it since I control the server, but I don't know where I would set 
> it so that it would take effect before the connection attempt is made.   
> 
> On Tue, Feb 21, 2023 at 10:53 PM Peter West  > wrote:
> Is it possible for you to set the PGPORT environment variable?
> 
> 
> —
> Peter West
> p...@pbw.id.au 
> “Blessed are the peacemakers, for they shall be called sons of God.”
> 
>> On 22 Feb 2023, at 11:01 am, Peter West > > wrote:
>> 
>> I’m using the default port, so I can’t help there.
>> 
>> “Database” refers to the database, in my case, gnucash.
>> 
>> 
>> —
>> Peter West
>> p...@pbw.id.au 
>> “Blessed are the pure in heart, for they shall see God.”
>> 
>>> On 22 Feb 2023, at 8:07 am, Bob Treumann >> > wrote:
>>> 
>>> I am running PG on an amazon server on a non standard port (6543).
>>> 
>>> The connection setup on gnucash does not have a filed to input the port.
>>> I added the port to the end of the hostname, a style that has worked with
>>> other applications.
>>> 
>>> There is a field to enter the "database", which in PG contains multiple
>>> schemas.
>>> The user is typically connected to a schema by a default path.
>>> 
>>> My questions are:
>>> How do I define the port?
>>> Does "Database" refer to "Schema"?
>>> 
>>> I would try every combination but the interface only gives me one chance.
>>> It gives a "cannot connect" message then closes.
>>> 
>>> 
>>> [image: image.png]
>>> ___
>>> gnucash-user mailing list
>>> gnucash-user@gnucash.org 
>>> To update your subscription preferences or to unsubscribe:
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user 
>>> 
>>> -
>>> Please remember to CC this list on all your replies.
>>> You can do this by using Reply-To-List or Reply-All.
>> 
>> ___
>> gnucash-user mailing list
>> gnucash-user@gnucash.org 
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user 
>> 
>> -
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
> 

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Postgress connection string for nonstandard port

2023-02-22 Thread Bob Treumann
I could set it since I control the server, but I don't know where I would
set it so that it would take effect before the connection attempt is made.


On Tue, Feb 21, 2023 at 10:53 PM Peter West  wrote:

> Is it possible for you to set the PGPORT environment variable?
>
>
> —
> Peter West
> p...@pbw.id.au
> “Blessed are the peacemakers, for they shall be called sons of God.”
>
> On 22 Feb 2023, at 11:01 am, Peter West  wrote:
>
> I’m using the default port, so I can’t help there.
>
> “Database” refers to the database, in my case, gnucash.
>
>
> —
> Peter West
> p...@pbw.id.au
> “Blessed are the pure in heart, for they shall see God.”
>
> On 22 Feb 2023, at 8:07 am, Bob Treumann  wrote:
>
> I am running PG on an amazon server on a non standard port (6543).
>
> The connection setup on gnucash does not have a filed to input the port.
> I added the port to the end of the hostname, a style that has worked with
> other applications.
>
> There is a field to enter the "database", which in PG contains multiple
> schemas.
> The user is typically connected to a schema by a default path.
>
> My questions are:
> How do I define the port?
> Does "Database" refer to "Schema"?
>
> I would try every combination but the interface only gives me one chance.
> It gives a "cannot connect" message then closes.
>
>
> [image: image.png]
> ___
> gnucash-user mailing list
> gnucash-user@gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>
>
> ___
> gnucash-user mailing list
> gnucash-user@gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>
>
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Postgress connection string for nonstandard port

2023-02-21 Thread Peter West
Is it possible for you to set the PGPORT environment variable?


—
Peter West
p...@pbw.id.au
“Blessed are the peacemakers, for they shall be called sons of God.”

> On 22 Feb 2023, at 11:01 am, Peter West  wrote:
> 
> I’m using the default port, so I can’t help there.
> 
> “Database” refers to the database, in my case, gnucash.
> 
> 
> —
> Peter West
> p...@pbw.id.au
> “Blessed are the pure in heart, for they shall see God.”
> 
>> On 22 Feb 2023, at 8:07 am, Bob Treumann  wrote:
>> 
>> I am running PG on an amazon server on a non standard port (6543).
>> 
>> The connection setup on gnucash does not have a filed to input the port.
>> I added the port to the end of the hostname, a style that has worked with
>> other applications.
>> 
>> There is a field to enter the "database", which in PG contains multiple
>> schemas.
>> The user is typically connected to a schema by a default path.
>> 
>> My questions are:
>> How do I define the port?
>> Does "Database" refer to "Schema"?
>> 
>> I would try every combination but the interface only gives me one chance.
>> It gives a "cannot connect" message then closes.
>> 
>> 
>> [image: image.png]
>> ___
>> gnucash-user mailing list
>> gnucash-user@gnucash.org
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> -
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
> 
> ___
> gnucash-user mailing list
> gnucash-user@gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Postgress connection string for nonstandard port

2023-02-21 Thread Peter West
I’m using the default port, so I can’t help there.

“Database” refers to the database, in my case, gnucash.


—
Peter West
p...@pbw.id.au
“Blessed are the pure in heart, for they shall see God.”

> On 22 Feb 2023, at 8:07 am, Bob Treumann  wrote:
> 
> I am running PG on an amazon server on a non standard port (6543).
> 
> The connection setup on gnucash does not have a filed to input the port.
> I added the port to the end of the hostname, a style that has worked with
> other applications.
> 
> There is a field to enter the "database", which in PG contains multiple
> schemas.
> The user is typically connected to a schema by a default path.
> 
> My questions are:
> How do I define the port?
> Does "Database" refer to "Schema"?
> 
> I would try every combination but the interface only gives me one chance.
> It gives a "cannot connect" message then closes.
> 
> 
> [image: image.png]
> ___
> gnucash-user mailing list
> gnucash-user@gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


[GNC] Postgress connection string for nonstandard port

2023-02-21 Thread Bob Treumann
I am running PG on an amazon server on a non standard port (6543).

The connection setup on gnucash does not have a filed to input the port.
I added the port to the end of the hostname, a style that has worked with
other applications.

There is a field to enter the "database", which in PG contains multiple
schemas.
The user is typically connected to a schema by a default path.

My questions are:
How do I define the port?
Does "Database" refer to "Schema"?

I would try every combination but the interface only gives me one chance.
It gives a "cannot connect" message then closes.


[image: image.png]
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.