[GENERAL] function returning a merge of the same query executed X time

2015-04-22 Thread Marc-André Goderre
Hi all, I'm having difficulties to create a function that should execute X time the same query and return their results as a single table. I tried this way but it don't work : Thanks to help. create function cm_get_json_loop_info( IN profile integer, IN distance double precision DEFAULT

Re: [GENERAL] function returning a merge of the same query executed X time

2015-04-22 Thread Jim Nasby
On 4/22/15 8:14 AM, Marc-André Goderre wrote: select row_to_json(q) from (select row_number() over() as id, sum(cost) as total_cost,sum(length) as total_length,json_agg(row_to_json(r)) as data from (select * from cm_get_loop_route_4(2, 10, -73.597070, 45.544083))r)q

Re: [GENERAL] function returning a merge of the same query executed X time

2015-04-22 Thread Geoff Winkless
Can you not just CROSS JOIN it to generate_series(1, 8)? On 22 April 2015 at 14:14, Marc-André Goderre wrote: > Hi all, > I'm having difficulties to create a function that should execute X time > the same query and return their results as a single table. > I tried this way but it don't work :

Re: [GENERAL] function returning a merge of the same query executed X time

2015-04-22 Thread Adrian Klaver
On 04/22/2015 06:14 AM, Marc-André Goderre wrote: Hi all, I'm having difficulties to create a function that should execute X time the same query and return their results as a single table. I tried this way but it don't work : Thanks to help. See comments inline. create function cm_get_json

[GENERAL] LDAP Authentication

2015-04-22 Thread Joseph Kregloh
I am currently setting up various environments to allow our developers to login to Postgresql using their LDAP password. Also limiting the servers they can access. I have successfully setup LDAP and setup simple authentication using simple bind. This was my test case. Now I need to move to the nex

[GENERAL] ERROR: could not open relation with OID

2015-04-22 Thread Steve Crawford
This morning we got the following error from a daily script that produces a simple largest-table report: ERROR: could not open relation with OID 597597503 I reran the script and it completed without error. Our server is running 9.1.15 from PgDg Ubuntu repos and the query run by the script is:

Re: [GENERAL] ERROR: could not open relation with OID

2015-04-22 Thread Andomar
This morning we got the following error from a daily script that produces a simple largest-table report: ERROR: could not open relation with OID 597597503 From a bit of Googling, it seems that Postgres was unable to open the physical file that contains the relation. Is it possible that there w

[GENERAL] Streaming-SQL Database PipelineDB (Based on PostgreSQL 9.4) - Available in Beta

2015-04-22 Thread Jeff Ferguson
Hello (PostgreSQL) World, We recently shipped our streaming-SQL analytics database, PipelineDB , which is based on PostgreSQL 9.4, in beta and are looking for companies to participate as early access partners. You can read more about the product in our technical docume

Re: [GENERAL] ERROR: could not open relation with OID

2015-04-22 Thread Adrian Klaver
On 04/22/2015 11:40 AM, Steve Crawford wrote: This morning we got the following error from a daily script that produces a simple largest-table report: ERROR: could not open relation with OID 597597503 I reran the script and it completed without error. Our server is running 9.1.15 from PgDg Ubun

[GENERAL] Connecting to 2 different DB on same machine

2015-04-22 Thread puneet252002
Hi Team,I am running in a confusion on how to connect two different database at different path. 1. Default PostgreSQL DB2. ManageEngine Servicedesk Plus DBI have installed PostgreSQL for windows successfully and connected to default database of PostgreSQL. Now I to connect ManageEngine Servicedesk

Re: [GENERAL] LDAP Authentication

2015-04-22 Thread John R Pierce
On 4/22/2015 11:37 AM, Joseph Kregloh wrote: I have successfully setup LDAP and setup simple authentication using simple bind. This was my test case. Now I need to move to the next lever which would be search and bind. This will allow me to grant access to particular servers for some people. I

Re: [GENERAL] Connecting to 2 different DB on same machine

2015-04-22 Thread John R Pierce
On 4/22/2015 10:49 AM, puneet252002 wrote: Hi Team, I am running in a confusion on how to connect two different database at different path. 1. Default PostgreSQL DB 2. ManageEngine Servicedesk Plus DB I have installed PostgreSQL for windows successfully and connected to default database of Post

Re: [GENERAL] ERROR: could not open relation with OID

2015-04-22 Thread Steve Crawford
On 04/22/2015 01:25 PM, Adrian Klaver wrote: If it is of importance, it appears that a temporary table and temporary index were being created within the same second that the query was run. Any advice? WHERE relkind = 'r' AND relpersistence != 't' So to confirm. Fix the query and do

Re: [GENERAL] LDAP Authentication

2015-04-22 Thread Joseph Kregloh
On Wed, Apr 22, 2015 at 5:30 PM, John R Pierce wrote: > On 4/22/2015 11:37 AM, Joseph Kregloh wrote: > >> I have successfully setup LDAP and setup simple authentication using >> simple bind. This was my test case. Now I need to move to the next lever >> which would be search and bind. This will a

Re: [GENERAL] LDAP Authentication

2015-04-22 Thread John R Pierce
On 4/22/2015 2:57 PM, Joseph Kregloh wrote: I see. That would still require a manual process to create the user on each server. I was planing on using some already existing scripts to create the user automatically on all servers and then LDAP would authorize depending on attributes in their

Re: [GENERAL] ERROR: could not open relation with OID

2015-04-22 Thread Adrian Klaver
On 04/22/2015 02:37 PM, Steve Crawford wrote: On 04/22/2015 01:25 PM, Adrian Klaver wrote: If it is of importance, it appears that a temporary table and temporary index were being created within the same second that the query was run. Any advice? WHERE relkind = 'r' AND relpersiste

Re: [GENERAL] Connecting to 2 different DB on same machine

2015-04-22 Thread Adrian Klaver
On 04/22/2015 10:49 AM, puneet252002 wrote: Hi Team, I am running in a confusion on how to connect two different database at different path. 1. Default PostgreSQL DB 2. ManageEngine Servicedesk Plus DB I have installed PostgreSQL for windows successfully and connected to default database of Postg