Hi Nicolas,

Thanks for writing about your problem!

  In my current installation of LedgerSMB, the tables are in a schema other
than public, because I installed it in a database where there are other
data in schema public. (The reason I did that is that I want to link tables
in schema public and LedgerSMB tables, but I have not done it yet.)

No problem. Your setup *should* be supported. And I remember helping you when you first set up your database with the non-public schema.
 
  I could make it work relatively painlessly with LedgerSMB 1.3 by setting
db_namespace in ledgersmb.conf.

Actually, you should still be able to do that. However, I think the section in which the key resides has changed. Does your ledgersmb.conf have this:

[database]
db_namespace = alternativeschema

?
That is, is your db_namespace in the "database" section of the config file?
 
  Recently (that is, very late!) I wanted to upgrade to LedgerSMB 1.5.24
(not 1.6 because my server is still under Debian stretch). I think I could
upgrade the database correctly with setup.pl, but when running login.pl it
will not work because, according to Postgresql's logs, it insists on trying
to call the stored procedure public.setting_get, which does not exist.

Thanks for this info. I think I found that the module which calls the 'setting_get' (lib/LedgerSMB/PGOld.pm) to be lacking the code to set up the db_namespace. I'm now trying to figure out what the best way is to pass the configuration value to the database call component.
 
  Although I do not know perl, I tried to read the code to understand what
is going on. If I understood well, stored procedures are called by calling
directly or indirectly the perl function call_procedure in module PGObject,
which sets the schema to public when it is not specified. However, module
LedgerSMB also contains a function call_procedure which correctly sets the
schema, so the problem seems to be that sometimes PGObject's call_procedure
is called directly instead of module LedgerSMB's.

That's a completely correct assessment! The component that's missing to pass the argument is lib/LedgerSMB/PGOld.pm.
 
I do not understand why,
because I do not know what constructs like $self->call_procedure or
__PACKAGE__->call_procedure do, but anyway this is very annoying for me,
because it means that LedgerSMB 1.5 just will not work with db_namespace
set to anything else than public.
  Was this problem known? Is it corrected in a later version?

Is it a known problem? No, I wasn't aware of it. (And by extension, it's not fixed in any currently released versions.)

I want to help you by getting this fixed - in a 1.5 release. However, the last two weeks, I've had very little time to work on this project and my family duties due to a major release at $work. Would it be ok for you if we (you and I) were able to work out the complete and correct solution over the coming weeks? (Then, I'd expect you to have a working solution before the end of august.) Or is this currently blocking your $getting_work_done ?


Regards,

--
Bye,

Erik.

http://efficito.com -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.