Re: Computed index on transformation of jsonb key set

2019-04-27 Thread Andrew Gierth
> "Steven" == Steven Schlansker  writes:

 Steven> I figured I'd end up with significantly better storage and
 Steven> performance characteristics if I first compute a uuid[] value
 Steven> and build the GIN over that, and use the array operator class
 Steven> instead. Additionally, this eliminates possible confusion about
 Steven> uuid casing (text is case sensitive, uuid is not) and this has
 Steven> already caused at least one bug in our application.

 Steven> I attempted to optimize a query like:
 Steven> select * from tbl where array(select jsonb_object_keys(mapData)::uuid) 
&& array['320982a7-cfaa-572a-b5ea-2074d7f3b014'::uuid];

Obvious solution:

create function uuid_keys(mapData jsonb) returns uuid[]
  language plpgsql immutable strict
  as $$
begin
  return array(select jsonb_object_keys(mapData)::uuid);
end;
  $$;

create index on tbl using gin (uuid_keys(mapData));

select * from tbl where uuid_keys(mapData) && array[...];

-- 
Andrew (irc:RhodiumToad)




Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Matthias Apitz
Hello,

I'm investigating on a SuSE Linux SLES 12 server if we could add support
for PostgreSQL 10 to our Library Management System (currently running on top
of Oracle 12 and Sybase 15.7) using all kind of languages and API one could 
imagine.

I've up and running the server and figured out how to connect (apart of
psql) with:

- C code to run SQL commands from char strings
- ESQL/C code to embed SQL statements into C
- JDBC

To get Perl's DBD::Pg compiled now I really do need the pg_config tool,
but I can't figure out how to get it. I see the following RPM (the ones
with an 'i' or 'i+' are installed):

# zypper search postg
...
   | libgda-5_0-postgres  | PostgreSQL Provider for GNU Data Access-> | 
package
...
i+ | postgresql-init  | Init script and other infrastructure fo-> | 
package
   | postgresql-init  | Init script and other infrastructure fo-> | 
srcpackage
i+ | postgresql-jdbc  | Official JDBC Driver for PostgreSQL   | 
package
   | postgresql-jdbc-javadoc  | API docs for postgresql-jdbc  | 
package
   | postgresql-unit10| SI Units for PostgreSQL   | 
package
   | postgresql10 | Basic Clients and Utilities for Postgre-> | 
srcpackage
i+ | postgresql10 | Basic Clients and Utilities for Postgre-> | 
package
i+ | postgresql10-contrib | Contributed Extensions and Additions to-> | 
package
i  | postgresql10-devel   | PostgreSQL development header files and-> | 
package
i+ | postgresql10-docs| HTML Documentation for PostgreSQL | 
package
   | postgresql10-libs| Basic Clients and Utilities for Postgre-> | 
srcpackage
i+ | postgresql10-libs| The shared libraries required for any P-> | 
package
   | postgresql10-odbc| PostgreSQL ODBC driver| 
package
   | postgresql10-plperl  | The Perl procedural language for Postgr-> | 
package
   | postgresql10-plpython| The Python procedural language for Post-> | 
package
   | postgresql10-pltcl   | The Tcl procedural language for Postgre-> | 
package
i+ | postgresql10-server  | The Programs Needed to Create and Run a-> | 
package
   | postgresql10-tcl | A Tcl client library for PostgreSQL   | 
package
   | postgresql10-test| The test suite distributed with Postgre-> | 
package
   | postgresql96 | Basic Clients and Utilities for Postgre-> | 
package
   | postgresql96 | Basic Clients and Utilities for Postgre-> | 
srcpackage
   | postgresql96-contrib | Contributed Extensions and Additions to-> | 
package
   | postgresql96-docs| HTML Documentation for PostgreSQL | 
package
   | postgresql96-libs| Basic Clients and Utilities for Postgre-> | 
srcpackage
   | postgresql96-server  | The Programs Needed to Create and Run a-> | 
package
   | postgresql_anonymizer10  | Anonymization & Data Masking for Postgr-> | 
package
   | split_postgres_dump  | Break a PostgreSQL dump file into pre-d-> | 
package

What I do missing to get 'pg_config'? Thanks

matthias

-- 
Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub


signature.asc
Description: PGP signature


Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Laurenz Albe
Matthias Apitz wrote:
> I'm investigating on a SuSE Linux SLES 12 server if we could add support
> for PostgreSQL 10 to our Library Management System (currently running on top
> of Oracle 12 and Sybase 15.7) using all kind of languages and API one could 
> imagine.
> 
> I've up and running the server and figured out how to connect (apart of
> psql) with:
> 
> - C code to run SQL commands from char strings
> - ESQL/C code to embed SQL statements into C
> - JDBC
> 
> To get Perl's DBD::Pg compiled now I really do need the pg_config tool,
> but I can't figure out how to get it. I see the following RPM (the ones
> with an 'i' or 'i+' are installed):
> 
[...]
> i  | postgresql10-devel   | PostgreSQL development header files and-> 
> | package

That would be the one with pg_config in it.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





Re: TCP Resets when closing connection opened via SSL

2019-04-27 Thread Peter J. Holzer
On 2019-04-26 18:36:12 +0200, Jānis Pūris wrote:
> Thanks for the insight, Tom.
> 
> 
> It's fairly obvious from the postmaster log that the client side
> is not bothering to close the transaction it started
> 
> 
> Thats what I was also thinking, but I've managed to reproduce it with
> autocommit or commit before closing connection as well.
> This is only reproducible with SSL connection.
> 
> I've reproduced it with ubuntu package bundles certs, my own created, 
> generated
> with CA etc hence I do not think it is a problem with certificates themselves.
> This happens with various clients, php driver, java driver and also libpq used
> by psycopg2. We are running a lot of different kind of microservices and thus
> far I can tell, almost (if not all) of them have this problem manifest.
> 
> I can not however reproduce this when doing something like
> $ psql "user=postgres sslmode=require host=localhost dbname=postgres"
> postgres=# \q

I can reproduce it in this case also (kernel 4.9, openssl 1.1.0j,
posgres 9.5.16).

stracing psql shows this:

send(3, 
"\27\3\3\0\35fV\354\31v\332\10\22\202-#8\5\267\5\202\346\3748\353\326&\374\rf\2776"...,
 34, MSG_NOSIGNAL) = 34
send(3, 
"\25\3\3\0\32fV\354\31v\332\10\23\307\207\335V\355Lhh\"\214\331\25l\352\27\32\332\357",
 31, MSG_NOSIGNAL) = 31
close(3)= 0

I.e., psql sends some data (presumably a TLS close_notify alert) and
then closes the file descriptor.

tcpdump shows this:

12:30:02.276188 IP6 localhost.47712 > localhost.postgresql: Flags [P.], seq 
414:445, ack 1239, win 360, options [nop,nop,TS val 337416186 ecr 337416186], 
length 31
12:30:02.276243 IP6 localhost.47712 > localhost.postgresql: Flags [F.], seq 
445, ack 1239, win 360, options [nop,nop,TS val 337416186 ecr 337416186], 
length 0
12:30:02.276306 IP6 localhost.postgresql > localhost.47712: Flags [P.], seq 
1239:1270, ack 446, win 350, options [nop,nop,TS val 337416186 ecr 337416186], 
length 31
12:30:02.276315 IP6 localhost.47712 > localhost.postgresql: Flags [R], seq 
2477517213, win 0, length 0

The first packet shown are the 31 bytes of the second send, then the
cliens sends a FIN packet. Then the server replies with a packet of the
same length (so presumably also a close_notify alert). Since the client
has already closed the connection, it replies with a RST.

One might argue that openssl should wait for the other side to reply
before closing the connection. But waiting doesn't really accomplish
anything from the application's point of view and introduces and
unnecessary delay.

> This is an issue because we have a lot of connections being initiated and
> closed. And this creates a lot of TCP resets.

Why are those resets a problem? (If the answer is "our monitoring
software complains about them" then the question becomes "why does your
monitoring software think they are a problem?")

hp

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | h...@hjp.at | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature


Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Matthias Apitz
On Sat, 27 Apr 2019 12:41:07 +0200, Laurenz Albe wrote:
> Matthias Apitz wrote:
>> I'm investigating on a SuSE Linux SLES 12 server if we could add support
>> for PostgreSQL 10 to our Library Management System (currently
>> running on top
>> of Oracle 12 and Sybase 15.7) using all kind of languages and
>> API one could imagine.
>>
>> I've up and running the server and figured out how to connect (apart of
>> psql) with:
>>
>> - C code to run SQL commands from char strings
>> - ESQL/C code to embed SQL statements into C
>> - JDBCuruu
>>
>> To get Perl's DBD::Pg compiled now I really do need the pg_config tool,
>> but I can't figure out how to get it. I see the following RPM (the ones
>> with an 'i' or 'i+' are installed):
>>
> [...]
>> i  | postgresql10-devel   | PostgreSQL development
>> header files and-> | package
>
> That would be the one with pg_config in it.
>

But, thid is installed  I will later unpack its RPM and have a look.

matthias

--
Sent using Dekko from my Ubuntu device
http://www.unixarea.de/+49 176 38902045




Re: TCP Resets when closing connection opened via SSL

2019-04-27 Thread Jānis Pūris
Thank you, Peter.

It makes more sense now, and I'm so glad someone else is able to reproduce this.

To clarify on why I consider this a problem - It is not just the alerts on 
monitoring system. The alerts themselves can be tuned / thresholds increased 
etc. The real issue (could argue this is non-issue), is the noise..

If something start to not work as expected besides this "inconvenience" and 
start to produce TCP resets as well, this could potentially diminish the 
troubleshooting tool visibility.

That said. Now that someone else is able to reproduce this and I more clarity 
as to what may be going on (can explain to team), I can consider this as "known 
behaviour".

Hopefully this will be addressed someday, but until then, we'll just have to 
live with it. :)

Med vennlig hilsen.
Best regards, Janis Puris.
On 27 Apr 2019, 12:55 +0200, Peter J. Holzer , wrote:
> On 2019-04-26 18:36:12 +0200, Jānis Pūris wrote:
> > Thanks for the insight, Tom.
> >
> >
> > It's fairly obvious from the postmaster log that the client side
> > is not bothering to close the transaction it started
> >
> >
> > Thats what I was also thinking, but I've managed to reproduce it with
> > autocommit or commit before closing connection as well.
> > This is only reproducible with SSL connection.
> >
> > I've reproduced it with ubuntu package bundles certs, my own created, 
> > generated
> > with CA etc hence I do not think it is a problem with certificates 
> > themselves.
> > This happens with various clients, php driver, java driver and also libpq 
> > used
> > by psycopg2. We are running a lot of different kind of microservices and 
> > thus
> > far I can tell, almost (if not all) of them have this problem manifest.
> >
> > I can not however reproduce this when doing something like
> > $ psql "user=postgres sslmode=require host=localhost dbname=postgres"
> > postgres=# \q
>
> I can reproduce it in this case also (kernel 4.9, openssl 1.1.0j,
> posgres 9.5.16).
>
> stracing psql shows this:
>
> send(3, 
> "\27\3\3\0\35fV\354\31v\332\10\22\202-#8\5\267\5\202\346\3748\353\326&\374\rf\2776"...,
>  34, MSG_NOSIGNAL) = 34
> send(3, 
> "\25\3\3\0\32fV\354\31v\332\10\23\307\207\335V\355Lhh\"\214\331\25l\352\27\32\332\357",
>  31, MSG_NOSIGNAL) = 31
> close(3) = 0
>
> I.e., psql sends some data (presumably a TLS close_notify alert) and
> then closes the file descriptor.
>
> tcpdump shows this:
>
> 12:30:02.276188 IP6 localhost.47712 > localhost.postgresql: Flags [P.], seq 
> 414:445, ack 1239, win 360, options [nop,nop,TS val 337416186 ecr 337416186], 
> length 31
> 12:30:02.276243 IP6 localhost.47712 > localhost.postgresql: Flags [F.], seq 
> 445, ack 1239, win 360, options [nop,nop,TS val 337416186 ecr 337416186], 
> length 0
> 12:30:02.276306 IP6 localhost.postgresql > localhost.47712: Flags [P.], seq 
> 1239:1270, ack 446, win 350, options [nop,nop,TS val 337416186 ecr 
> 337416186], length 31
> 12:30:02.276315 IP6 localhost.47712 > localhost.postgresql: Flags [R], seq 
> 2477517213, win 0, length 0
>
> The first packet shown are the 31 bytes of the second send, then the
> cliens sends a FIN packet. Then the server replies with a packet of the
> same length (so presumably also a close_notify alert). Since the client
> has already closed the connection, it replies with a RST.
>
> One might argue that openssl should wait for the other side to reply
> before closing the connection. But waiting doesn't really accomplish
> anything from the application's point of view and introduces and
> unnecessary delay.
>
> > This is an issue because we have a lot of connections being initiated and
> > closed. And this creates a lot of TCP resets.
>
> Why are those resets a problem? (If the answer is "our monitoring
> software complains about them" then the question becomes "why does your
> monitoring software think they are a problem?")
>
> hp
>
> --
> _ | Peter J. Holzer | we build much bigger, better disasters now
> |_|_) | | because we have much more sophisticated
> | | | h...@hjp.at | management tools.
> __/ | http://www.hjp.at/ | -- Ross Anderson 


Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Matthias Apitz
El día sábado, abril 27, 2019 a las 11:00:53a. m. +, Matthias Apitz 
escribió:

> >> To get Perl's DBD::Pg compiled now I really do need the pg_config tool,
> >> but I can't figure out how to get it. I see the following RPM (the ones
> >> with an 'i' or 'i+' are installed):
> >> 
> > [...]
> >> i  | postgresql10-devel   | PostgreSQL development 
> >> header files and-> | package
> >
> > That would be the one with pg_config in it.
> >
> 
> But, this is installed  I will later unpack its RPM and have a look.

# rpm -q --list postgresql10-devel-10.4-1PGDG.sles12.x86_64 | grep pg_config
/usr/pgsql-10/include/ecpg_config.h
/usr/pgsql-10/include/ecpg_config_x86_64.h
/usr/pgsql-10/include/pg_config.h
/usr/pgsql-10/include/pg_config_ext.h
/usr/pgsql-10/include/pg_config_manual.h
/usr/pgsql-10/include/pg_config_os.h
/usr/pgsql-10/include/pg_config_x86_64.h
/usr/pgsql-10/include/server/pg_config.h
/usr/pgsql-10/include/server/pg_config_ext.h
/usr/pgsql-10/include/server/pg_config_manual.h
/usr/pgsql-10/include/server/pg_config_os.h
/usr/pgsql-10/include/server/pg_config_x86_64.h
/usr/pgsql-10/share/locale/cs/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/de/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/es/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/fr/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/he/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/it/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/ja/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/ko/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/nb/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/pl/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/pt_BR/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/ro/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/ru/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/sv/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/ta/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/tr/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/zh_CN/LC_MESSAGES/pg_config-10.mo
/usr/pgsql-10/share/locale/zh_TW/LC_MESSAGES/pg_config-10.mo

There is no cmd 'pg_config'. Can I compile this from source?

matthias

-- 
Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub


signature.asc
Description: PGP signature


Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Adrian Klaver

On 4/27/19 12:58 AM, Matthias Apitz wrote:

Hello,

I'm investigating on a SuSE Linux SLES 12 server if we could add support
for PostgreSQL 10 to our Library Management System (currently running on top
of Oracle 12 and Sybase 15.7) using all kind of languages and API one could 
imagine.

I've up and running the server and figured out how to connect (apart of
psql) with:

- C code to run SQL commands from char strings
- ESQL/C code to embed SQL statements into C
- JDBC

To get Perl's DBD::Pg compiled now I really do need the pg_config tool,
but I can't figure out how to get it. I see the following RPM (the ones
with an 'i' or 'i+' are installed):


Did the compile process complain about not finding pg_config?

What happens if you run?:

whereis pg_config




# zypper search postg
...
| libgda-5_0-postgres  | PostgreSQL Provider for GNU Data Access-> 
| package
...
i+ | postgresql-init  | Init script and other infrastructure fo-> | 
package
| postgresql-init  | Init script and other infrastructure fo-> 
| srcpackage
i+ | postgresql-jdbc  | Official JDBC Driver for PostgreSQL   | 
package
| postgresql-jdbc-javadoc  | API docs for postgresql-jdbc  
| package
| postgresql-unit10| SI Units for PostgreSQL   
| package
| postgresql10 | Basic Clients and Utilities for Postgre-> 
| srcpackage
i+ | postgresql10 | Basic Clients and Utilities for Postgre-> | 
package
i+ | postgresql10-contrib | Contributed Extensions and Additions to-> | 
package
i  | postgresql10-devel   | PostgreSQL development header files and-> | 
package
i+ | postgresql10-docs| HTML Documentation for PostgreSQL | 
package
| postgresql10-libs| Basic Clients and Utilities for Postgre-> 
| srcpackage
i+ | postgresql10-libs| The shared libraries required for any P-> | 
package
| postgresql10-odbc| PostgreSQL ODBC driver
| package
| postgresql10-plperl  | The Perl procedural language for Postgr-> 
| package
| postgresql10-plpython| The Python procedural language for Post-> 
| package
| postgresql10-pltcl   | The Tcl procedural language for Postgre-> 
| package
i+ | postgresql10-server  | The Programs Needed to Create and Run a-> | 
package
| postgresql10-tcl | A Tcl client library for PostgreSQL   
| package
| postgresql10-test| The test suite distributed with Postgre-> 
| package
| postgresql96 | Basic Clients and Utilities for Postgre-> 
| package
| postgresql96 | Basic Clients and Utilities for Postgre-> 
| srcpackage
| postgresql96-contrib | Contributed Extensions and Additions to-> 
| package
| postgresql96-docs| HTML Documentation for PostgreSQL 
| package
| postgresql96-libs| Basic Clients and Utilities for Postgre-> 
| srcpackage
| postgresql96-server  | The Programs Needed to Create and Run a-> 
| package
| postgresql_anonymizer10  | Anonymization & Data Masking for Postgr-> 
| package
| split_postgres_dump  | Break a PostgreSQL dump file into pre-d-> 
| package

What I do missing to get 'pg_config'? Thanks

matthias




--
Adrian Klaver
adrian.kla...@aklaver.com




Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Matthias Apitz
El día sábado, abril 27, 2019 a las 06:22:00a. m. -0700, Adrian Klaver escribió:

> On 4/27/19 12:58 AM, Matthias Apitz wrote:
> > Hello,
> > 
> > I'm investigating on a SuSE Linux SLES 12 server if we could add support
> > for PostgreSQL 10 to our Library Management System (currently running on top
> > of Oracle 12 and Sybase 15.7) using all kind of languages and API one could 
> > imagine.
> > 
> > I've up and running the server and figured out how to connect (apart of
> > psql) with:
> > 
> > - C code to run SQL commands from char strings
> > - ESQL/C code to embed SQL statements into C
> > - JDBC
> > 
> > To get Perl's DBD::Pg compiled now I really do need the pg_config tool,
> > but I can't figure out how to get it. I see the following RPM (the ones
> > with an 'i' or 'i+' are installed):
> 
> Did the compile process complain about not finding pg_config?

Yes:

...
Running Makefile.PL
Path to pg_config?
Configuring DBD::Pg 3.7.4
PostgreSQL version: 0 (default port: 0)
POSTGRES_HOME: /usr/pgsql-10
POSTGRES_INCLUDE: /usr/pgsql-10/include
POSTGRES_LIB: /usr/pgsql-10/lib
OS: linux
Could not determine the PostgreSQL library version.

> What happens if you run?:
> 
> whereis pg_config

whereis pg_config
pg_config:

I also looked as root with find from / ... there is no pg_config
o the server and not in the installed RPM.

Meanwhile I fetched the full source of 10.4 and can build it, but ofc
this shows the data of *my* build and not the installed version:

apitzm@srap16dxr1:~/Postgres/postgresql-10.4> ./src/bin/pg_config/pg_config
BINDIR = /home/apitzm/Postgres/postgresql-10.4/src/bin/pg_config
DOCDIR = /usr/local/pgsql/share/doc
HTMLDIR = /usr/local/pgsql/share/doc
INCLUDEDIR = /usr/local/pgsql/include
PKGINCLUDEDIR = /usr/local/pgsql/include
...

But, I have an idea, I will write a simulated 'pg_config' which punches
the values of the installation when asked :-)

matthias

-- 
Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub


signature.asc
Description: PGP signature


Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Andrew Gierth
> "Matthias" == Matthias Apitz  writes:

 Matthias> There is no cmd 'pg_config'. Can I compile this from source?

Some distros separate out a 'libpq' package, and have a 'libpq-devel'
package with pg_config in it. Did you look for that?

-- 
Andrew (irc:RhodiumToad)




Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Adrian Klaver

On 4/27/19 6:33 AM, Matthias Apitz wrote:

El día sábado, abril 27, 2019 a las 06:22:00a. m. -0700, Adrian Klaver escribió:


On 4/27/19 12:58 AM, Matthias Apitz wrote:

Hello,

I'm investigating on a SuSE Linux SLES 12 server if we could add support
for PostgreSQL 10 to our Library Management System (currently running on top
of Oracle 12 and Sybase 15.7) using all kind of languages and API one could 
imagine.

I've up and running the server and figured out how to connect (apart of
psql) with:

- C code to run SQL commands from char strings
- ESQL/C code to embed SQL statements into C
- JDBC

To get Perl's DBD::Pg compiled now I really do need the pg_config tool,
but I can't figure out how to get it. I see the following RPM (the ones
with an 'i' or 'i+' are installed):


Did the compile process complain about not finding pg_config?


Yes:

...
Running Makefile.PL
Path to pg_config?
Configuring DBD::Pg 3.7.4
PostgreSQL version: 0 (default port: 0)
POSTGRES_HOME: /usr/pgsql-10
POSTGRES_INCLUDE: /usr/pgsql-10/include
POSTGRES_LIB: /usr/pgsql-10/lib
OS: linux
Could not determine the PostgreSQL library version.


I am on openSUSE LEAP and I see the package:

perl-DBD-Pg   | PostgreSQL database 
driver for the DBI module






What happens if you run?:

whereis pg_config


whereis pg_config
pg_config:

I also looked as root with find from / ... there is no pg_config
o the server and not in the installed RPM.

Meanwhile I fetched the full source of 10.4 and can build it, but ofc
this shows the data of *my* build and not the installed version:

apitzm@srap16dxr1:~/Postgres/postgresql-10.4> ./src/bin/pg_config/pg_config
BINDIR = /home/apitzm/Postgres/postgresql-10.4/src/bin/pg_config
DOCDIR = /usr/local/pgsql/share/doc
HTMLDIR = /usr/local/pgsql/share/doc
INCLUDEDIR = /usr/local/pgsql/include
PKGINCLUDEDIR = /usr/local/pgsql/include
...

But, I have an idea, I will write a simulated 'pg_config' which punches
the values of the installation when asked :-)

matthias




--
Adrian Klaver
adrian.kla...@aklaver.com




Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Matthias Apitz
El día sábado, abril 27, 2019 a las 02:39:54p. m. +0100, Andrew Gierth escribió:

> > "Matthias" == Matthias Apitz  writes:
> 
>  Matthias> There is no cmd 'pg_config'. Can I compile this from source?
> 
> Some distros separate out a 'libpq' package, and have a 'libpq-devel'
> package with pg_config in it. Did you look for that?

Yes, it isn't there either. Meanwhile I wrote my own 'pg_config' as:

$ cat /opt/bin/pg_config
#!/bin/sh

test $1 = '--version'   && echo 'PostgreSQL 10.4'
test $1 = '--bindir'&& echo '/usr/pgsql-10/bin'
test $1 = '--configure' && echo ''
exit 0

and with this the building went fine:


$ /usr/local/sisis-pap/perlbrew/bin/cpanm DBD::Pg
--> Working on DBD::Pg
Fetching http://www.cpan.org/authors/id/T/TU/TURNSTEP/DBD-Pg-3.8.0.tar.gz ... OK
Configuring DBD-Pg-3.8.0 ... OK
Building and testing DBD-Pg-3.8.0 ... OK
Successfully installed DBD-Pg-3.8.0
1 distribution installed

matthias

-- 
Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub


signature.asc
Description: PGP signature


Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Christoph Moench-Tegeder
## Matthias Apitz (g...@unixarea.de):

> To get Perl's DBD::Pg compiled now I really do need the pg_config tool,
> but I can't figure out how to get it. I see the following RPM (the ones
> with an 'i' or 'i+' are installed):

Um. Which postgresql10-* packages are that?
SLES12SP4 has "postgresql10" and friends:
Information for package postgresql10:
-
Repository : SLES12-SP4-Updates
Name   : postgresql10
Version: 10.6-1.6.1
Arch   : x86_64
Vendor : SUSE LLC 

And there are the PGDG packages:
cmt@squirrel:/tmp$ rpm -qp --info postgresql10-10.7-1PGDG.sles12.x86_64.rpm
warning: postgresql10-10.7-1PGDG.sles12.x86_64.rpm: Header V4 DSA/SHA1 
Signature, key ID 442df0f8: NOKEY
Name: postgresql10
Version : 10.7
Release : 1PGDG.sles12
Architecture: x86_64
Install Date: (not installed)
Group   : Applications/Databases
Size: 15066385
License : PostgreSQL

If you are on a SLES without postgresql10 packages and use the PGDG
packages, you'll find pg_config in the "postgresql10" package (at
least it's in that postgresql10-10.7-1PGDG.sles12.x86_64.rpm I used above,
and the spec file shows the same...), the full path would be
 "/usr/pgsql-10/bin/pg_config".

If you're on SLES12 with Suse's postgresql10 packages, you'll find
pg_config in "postgresql10-devel" - which you only get if you have
activated/installed the "SDK" repositories. The full path for pg_config
with this package is
  "/usr/lib/postgresql10/bin/pg_config".

If you are on a SLES with postgresql10 packages and are mixing that
with the PGDG packages, you might be in a mess. And as far as I know
there's no good way to make sure which packages you get, as zypper
tells me "Repository priorities are without effect. All enabled repositories
share the same priority.".

Regards,
Christoph

-- 
Spare Space