Best way to select a random row from a derived table

2018-01-27 Thread Ryan Murphy
Hello hackers and postgressers, I am aware of 2 ways to select a random row from a table: 1) select * from table_name order by random() limit 1; -- terribly inefficient 2) select * from table_name tablesample system_rows(1) limit 1; -- only works on tables, not views or s

Re: pg 10.1 missing libpq in postgresql-devel

2018-01-27 Thread Adrian Klaver
On 01/27/2018 04:34 PM, support-tiger wrote: sorry for delay but ran some tests on older version pg gem - still fails With what error message? What Ruby gem? it fails on building the config file with simply missing libpq-fe.h, cannot find libpq-fe.h Well it is there: rpm -qlp postgresql

Re: pg 10.1 missing libpq in postgresql-devel

2018-01-27 Thread support-tiger
sorry for delay but ran some tests on older version pg gem - still fails it fails on building the config file with simply missing libpq-fe.h,  cannot find libpq-fe.h I suspect it is a problem with using the pgdg repository and that postgresql get "10" added to them ie postgresql10-devel and m