8 Commits

Author SHA1 Message Date
ede8880e72 Update copyright date 2025-01-13 09:07:30 +01:00
7b6ed0d2bc Use anonymous namespace instead of static in test code
This is recommended in C++ Core Guidelines SF.22
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-unnamed2
2024-08-15 22:24:35 +02:00
ff91d49869 Update copyright date 2024-01-26 16:45:53 +01:00
e59440cad3 Set default schema to 'public' and use qualified names everywhere
Until now the default schema was empty and the PostgreSQL search path
was used to find tables etc.

We now set the default schema for the middle and the pgsql and flex
outputs to 'public'.

This simplifies the code, because we don't have to handle the case
without schema specially any more. More importantly it makes it easier
for the user to reason about what osm2pgsql is doing, because it does
not depend on the setting of the search path in the PostgreSQL session.

This fixes a problem where osm2pgsql could not find the
osm2pgsql_properties table it created itself, because it was created in
a different schema than expected (#2010).

The behaviour of the gazetteer output has not changed. It still uses
unqualified names.

This will be a breaking change for those users who rely on the old
behaviour.

Fixes #2010, #2011.
2023-08-07 15:56:43 +02:00
3e298c0482 Refactor has_table()
Now uses an implemenation more like the other has_*() functions checking
database capabilities.
2023-05-14 09:27:44 +02:00
7ba523ba37 Update copyright date to 2023 2023-01-15 16:13:42 +01:00
949150219d Consolidate database capability checks
There were several places (pgsql.hpp, pgsql-capabilities.hpp,
db-check.hpp) that had code to check various capabilities, version
numbers etc. of the database we are connected to. This is now
consolidated in pgsql-capabilities.hpp. It needs to be initialized once
at program start by calling init_database_capabilities() with a database
connection object. Checking version numbers or capabilities is then much
easier, because no active database connection is needed any more.

This also adds code to get the list of supported index methods from the
database which we will need shortly. (Only works with PostgreSQL >9.5.)
2022-12-01 15:27:10 +01:00
c236ed0df7 Add functions to check for tablespaces, schemas and extensions in db 2022-09-30 11:24:43 +02:00