Re: [GENERAL] How to find greatest record before known values fast

2014-10-04 Thread Andrus
Hi! Thank you. In my db people often looks for different period sales using different filters and will sum There are lot of sales and every sale is individual record in sales table. So increasing sequential scan speed is important. I tried create table t1(v char(100), p numeric(12,5)); create

Re: [GENERAL] How to find greatest record before known values fast

2014-10-04 Thread Andrus
Hi! Thank you. People often looks for different period sales using different filters. There are lot of sales and every sale is individual record in sales table. So increasing sequential scan speed is important. I tried create table t1(v char(100), p numeric(12,5)); create table t2(v varchar(10

Re: [GENERAL] How to callproc a PL/pgSQL function a cursor OUT parameter and two OUT parameters

2014-10-04 Thread Adrian Klaver
On 10/04/2014 10:18 AM, Néstor Boscán wrote: CCing list. So in PL/pgSQL I can't have a function with a cursor and out parameters? I don't know I have not tried. Whether it works or not is not related to the error message you are getting. OUT parameters are for output only, they are declared

Re: [GENERAL] How to callproc a PL/pgSQL function a cursor OUT parameter and two OUT parameters

2014-10-04 Thread Adrian Klaver
On 10/04/2014 09:16 AM, Néstor Boscán wrote: Hi I have a PL/pgSQL that looks like this: create or replace function my_function (p_cursor out refcursor, p_code out varchar, p_message out varchar) as $$ begin open p_cursor for select * from table; p_code := 'AJ001'; return;

[GENERAL] How to callproc a PL/pgSQL function a cursor OUT parameter and two OUT parameters

2014-10-04 Thread Néstor Boscán
Hi I have a PL/pgSQL that looks like this: create or replace function my_function (p_cursor out refcursor, p_code out varchar, p_message out varchar) as $$ begin open p_cursor for select * from table; p_code := 'AJ001'; return; end; $$ language plpgsql; I've tried to invo

Re: [GENERAL] Really strange foreign key constraint problem blocking delete

2014-10-04 Thread Andy Colson
On 10/04/2014 12:45 AM, Tim Mickelson wrote: But I don't think so, but here are the table defenitions: CREATE TABLE bulldog.channel_mapping ( idchannel integer NOT NULL, idaut integer NOT NULL, CONSTRAINT channel_mapping_pk PRIMARY KEY (idchannel, idaut), CONSTRAINT channel_mapping_

Re: [GENERAL] Really strange foreign key constraint problem blocking delete

2014-10-04 Thread Adrian Klaver
On 10/03/2014 10:45 PM, Tim Mickelson wrote: But I don't think so, but here are the table defenitions: CREATE TABLE bulldog.channel_mapping ( idchannel integer NOT NULL, idaut integer NOT NULL, CONSTRAINT channel_mapping_pk PRIMARY KEY (idchannel, idaut), CONSTRAINT channel_mapping_