Postgres AssertFailedException Exception

2019-12-18 Thread Patil, Prashant
Hi Team,

We are receiving following AssertFailedException exception while executing 
pgrouting query listed below. Anyone have idea about this exception? Is this 
known bug? Possible fix?
Server details -
Postgresql 9.3.25
Ubuntu 16.04.6 LTS
Pgrouting 2.6.0

2019-12-16 19:31:55 EST Passenger AppPreloader: /var/w...er.com/ViewEngine 
(forking...) [41329-3] postgres@odw ERROR:  AssertFailedException: 
p1.tot_cost() == p2.tot_cost() at 
/build/pgrouting-Prt6v2/pgrouting-2.6.0/include/yen/pgr_ksp.hpp:63
   *** Execution path***
   
[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(_Z13get_backtraceB5cxx11v+0x3c)
 [0x7ff5fd368b7c]
   
[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(_ZNK7Pgr_kspIN9pgrouting5graph14Pgr_base_graphIN5boost14adjacency_listINS3_4vecSES5_NS3_11undirectedSENS0_12Basic_vertexENS0_10Basic_edgeENS3_11no_propertyENS3_5listSEEES7_S8_EEE9compPathsclERK4PathSH_+0x2dd)
 [0x7ff5fd3d2bbd]
   
[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(_ZNSt8_Rb_treeI4PathS0_St9_IdentityIS0_EN7Pgr_kspIN9pgrouting5graph14Pgr_base_graphIN5boost14adjacency_listINS7_4vecSES9_NS7_11undirectedSENS4_12Basic_vertexENS4_10Basic_edgeENS7_11no_propertyENS7_5listSEEESB_SC_EEE9compPathsESaIS0_EE16_M_insert_uniqueIRKS0_EESt4pairISt17_Rb_tree_iteratorIS0_EbEOT_+0x4e)
 [0x7ff5fd3d2dae]
   
[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(_ZN7Pgr_kspIN9pgrouting5graph14Pgr_base_graphIN5boost14adjacency_listINS3_4vecSES5_NS3_11undirectedSENS0_12Basic_vertexENS0_10Basic_edgeENS3_11no_propertyENS3_5listSEEES7_S8_EEE11doNextCycleERSC_+0x641)
 [0x7ff5fd3e2251]
   
[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(_ZN7Pgr_kspIN9pgrouting5graph14Pgr_base_graphIN5boost14adjacency_listINS3_4vecSES5_NS3_11undirectedSENS0_12Basic_vertexENS0_10Basic_edgeENS3_11no_propertyENS3_5listSEEES7_S8_EEE3YenERSC_llib+0x2fb)
 [0x7ff5fd3e288b]
   
[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(do_pgr_ksp+0xbd4) 
[0x7ff5fd3e5f84]
   
[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(kshortest_path+0x40e) 
[0x7ff5fd3ced4e]
   [bt]postgres: postgres odw 10.76.0.185(44748) 
SELECT(ExecMakeTableFunctionResult+0x19c) [0x55625ab1dcbc]
   [bt]postgres: postgres odw 10.76.0.185(44748) SELECT(+0x1dc116) 
[0x55625ab31116]
   [bt]postgres: postgres odw 10.76.0.185(44748) 
SELECT(ExecScan+0x2c9) [0x55625ab1feb9]
   [bt]postgres: postgres odw 10.76.0.185(44748) 
SELECT(ExecProcNode+0x1a8) [0x55625ab187e8]
   [bt]postgres: postgres odw 10.76.0.185(44748) 
SELECT(standard_ExecutorRun+0x10e) [0x55625ab15c6e]
   [bt]/usr/lib/postgresql/9.3/lib/pg_stat_statements.so(+0x24a5) 
[0x7ffa2048a4a5]
   [bt]postgres: postgres odw 10.76.0.185(44748) SELECT(+0x2a8717) 
[0x55625abfd717]
   [bt]postgres: postgres odw 10.76.0.185(44748) 
SELECT(PortalRunFetch+0x180) [0x55625abff0a0]
   [bt]postgres: postgres odw 10.76.0.185(44748) SELECT(+0x1e423d) 
[0x55625ab3923d]

2019-12-16 19:31:55 EST Passenger AppPreloader: /var/w...er.com/ViewEngine 
(forking...) [41329-4] postgres@odw HINT:
2019-12-16 19:31:55 EST Passenger AppPreloader: /var/w...er.com/ViewEngine 
(forking...) [41329-5] postgres@odw CONTEXT:  PL/pgSQL function 
pgr_ksp(text,bigint,bigint,integer,boolean,boolean) line 4 at RETURN QUERY
   PL/pgSQL function 
nn_candidate_routes_from_and_to_latlon(geometry,geometry[]) line 75 at RETURN 
QUERY
2019-12-16 19:31:55 EST Passenger AppPreloader: /var/w...er.com/ViewEngine 
(forking...) [41329-6] postgres@odw STATEMENT:
   select st_multi(st_union(geom)) as 
geom,return_target_seq,path_id,st_length(st_union(st_transform(geom,2163))) as 
distance
from 
nn_candidate_routes_from_and_to_latlon(st_setsrid(st_makepoint(-117.99466873924484,33.92814775576908),4326),
 ARRAY(
   select geom from (
   select geom, 
st_distance(st_setsrid(st_makepoint(-117.99466873924484,33.92814775576908),4326),geom)
   from (
  select

(st_dumppoints((st_transform(st_segmentize(st_transform(wkt_geometry,2163),75),4326.geom
from (select * from staging_dw_cables where 
upper(owner) ~ 'OWNED' and start_ne_dw_enclosure_id is not null and 
end_ne_dw_enclosure_id is not null and pop_cable_tf = true
and wkt_geometry && 
st_transform(st_buffer(st_transform(st_setsrid(st_makepoint(-117.99466873924484,33.92814775576908),4326),2163),5),4326)
order by 
st_distance(st_setsrid(st_makepoint(-117.99466873924484,33.92814775576908),4326),wkt_geometry)
 limit 15) cables) sq order by 2 asc limit 15) sq
)) where geom is not null group by 
return_target_seq,path_id order by distance asc limit 25


Regards,
Prashant

This email may contain con

Postgres Security Patches Question

2019-04-24 Thread Patil, Prashant
Hi Team,

We have a question related to security patches.

Following is our server specification:-
OS-RedHat 7
Postgres - 9.3 (planning to upgrade to 11.2) and 11.2

We have installed postgres using source code and moved postgres data, config 
and share default install directories to custom directories/mount points. If 
there is any security patch that need to apply on postgres database in future, 
1. Would security patch available in form of source code/zip file OR do we have 
to apply it using rpm? 2. If rpm, would it be possible to install security 
patch on postgres custom directories through RPM? 3. Any caveat that we need to 
aware about?

Any help here would be really appreciated.

Regards,
Prashant

This email may contain confidential or privileged material. Use or disclosure 
of it by anyone other than the recipient is unauthorized. If you are not an 
intended recipient, please delete this email.


RE: Postgres Security Patches Question

2019-04-24 Thread Patil, Prashant
Thanks Adrian for quick reply. So what would be best options here to apply 
security patches?  Using RPM?


Regards,
Prashant

-Original Message-
From: Adrian Klaver 
Sent: Wednesday, April 24, 2019 10:38 AM
To: Patil, Prashant ; secur...@postgresql.org; 
pgsql-general@lists.postgresql.org; pgsql-general-ow...@lists.postgresql.org
Subject: Re: Postgres Security Patches Question


CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On 4/24/19 7:30 AM, Patil, Prashant wrote:
> Hi Team,
>
> We have a question related to security patches.
>
> Following is our server specification:-
>
> OS-RedHat 7
>
> Postgres - 9.3 (planning to upgrade to 11.2) and 11.2
>
> We have installed postgres using source code and moved postgres data,
> config and share default install directories to custom
> directories/mount points. If there is any security patch that need to
> apply on postgres database in future, 1. Would security patch
> available in form of source code/zip file OR do we have to apply it
> using rpm? 2. If rpm, would it be possible to install security patch
> on postgres custom directories through RPM? 3. Any caveat that we need to 
> aware about?
>
> Any help here would be really appreciated.

AFAIK the patches are not released separately. In your case you would need to 
download the new patched complete source and rebuild it.

>
> Regards,
>
> Prashant
>
> This email may contain confidential or privileged material. Use or
> disclosure of it by anyone other than the recipient is unauthorized.
> If you are not an intended recipient, please delete this email.


--
Adrian Klaver
adrian.kla...@aklaver.com
This email may contain confidential or privileged material. Use or disclosure 
of it by anyone other than the recipient is unauthorized. If you are not an 
intended recipient, please delete this email.




RE: Postgres Security Patches Question

2019-04-24 Thread Patil, Prashant
Thanks Tom. So since security patches is not release separately, they are part 
of minor releases. Is this correct statement?

If they are part minor releases, we need to download source code for that 
release and perform upgrade and while performing upgrade, we can point install 
directories to our custom data/config directories RIGHT?

Regards,
Prashant

-Original Message-
From: Tom Lane 
Sent: Wednesday, April 24, 2019 10:58 AM
To: Adrian Klaver 
Cc: Patil, Prashant ; 
pgsql-general@lists.postgresql.org
Subject: Re: Postgres Security Patches Question


CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


[ removing security list, since this is not a security bug report ]

Adrian Klaver  writes:
> On 4/24/19 7:30 AM, Patil, Prashant wrote:
>> ... If there is any security patch that need to apply on postgres
>> database in future, 1. Would security patch available in form of
>> source code/zip file OR do we have to apply it using rpm? 2. If rpm,
>> would it be possible to install security patch on postgres custom
>> directories through RPM? 3. Any caveat that we need to aware about?

> AFAIK the patches are not released separately. In your case you would
> need to download the new patched complete source and rebuild it.

We do not release security patches separately, and are not interested in doing 
so.  Two points you might wish to consider:

* Security patches are not tested standalone, only on top of the complete 
patch-series-to-date.  There's no certainty they'd even apply to an earlier 
snapshot, let alone work as intended.

* For most database installations, data-loss-risk bugs are at least as 
important as "security" bugs, maybe more so.  The vast majority of the things 
we label security bugs are privilege escalation problems accessible to someone 
who is already able to log into the database and execute arbitrary SQL.  But 
few installations have untrusted users connecting directly to the database, so 
these sorts of bug fixes are really just limiting the possible effects of any 
security loopholes (e.g. SQL-injection bugs) you may have in your applications. 
 Which is a good thing surely, but it pales compared to "this bug might corrupt 
all your data".

The PG community's recommendation is that you install new minor releases in 
toto.  Anybody who thinks it's better to just cherry-pick "security"
patches doesn't understand the realities of database work.

regards, tom lane
This email may contain confidential or privileged material. Use or disclosure 
of it by anyone other than the recipient is unauthorized. If you are not an 
intended recipient, please delete this email.