Re: [GENERAL] partitioning and dynamic query creation

2011-02-12 Thread pasman pasmański
Try: execute ... using new.* 2011/2/10, Gerd Koenig : > Hello list, > > I'm currently thinking about a possibility to create a dynamic insert > statement inside a trigger function to put the data in the correct > partition. > What am I talking about ? > I want to put data dependant on a timestamp

Re: [GENERAL] Heavy queries not run by user application

2011-02-12 Thread John R Pierce
On 02/12/11 5:11 PM, Ruben Blanco wrote: Hi: I'm running a Postgres database with a total disk occupation of 100Gb, largest and most used table up to 40Gb (about 30.000.000 tuples). Overall performance degrades sometimes due to some queries that are not run by the final user app. I guess the

Re: [GENERAL] Heavy queries not run by user application

2011-02-12 Thread pasman pasmański
2011/2/13, Ruben Blanco : > Hi: > > I'm running a Postgres database with a total disk occupation of 100Gb, > largest and most used table up to 40Gb (about 30.000.000 tuples). > > Overall performance degrades sometimes due to some queries that are not run > by the final user app. I guess they are ru

Re: [GENERAL] Multithreaded query onto 4 postgresql instances

2011-02-12 Thread mark
> Otherwise you probably didn't gain anything > by splitting your database up like that - you've just reduced the > available resources on that single machine. > Unless that single machine has more resource than a single PG instance can consume to satisfy one query. (see how much faster a greenpl

[GENERAL] Select + Functions + Composite Types: Behavior

2011-02-12 Thread David Johnston
Hey, I notice the following behavior but have not seen it documented anywhere. I am curious if: A. I missed the documentation B. Is poorly documented C. It's a bug If I put a function that returns a composite type into the FROM clause of a SELECT query (and it - the function - is the only so

[GENERAL] Heavy queries not run by user application

2011-02-12 Thread Ruben Blanco
Hi: I'm running a Postgres database with a total disk occupation of 100Gb, largest and most used table up to 40Gb (about 30.000.000 tuples). Overall performance degrades sometimes due to some queries that are not run by the final user app. I guess they are run by Postgres itself. They use to take

Re: [GENERAL] Select + Functions + Composite Types: Behavior

2011-02-12 Thread David Johnston
Another similar situation that I'll bring here first: I want to do: SELECT createdid, eventresult FROM createvehiclesaleimport() er INTO targetid, evtresult; But this gives a function compilation error: ' "evtresult" is not a scalar variable ' createdid/targeted are boolean eventresult/evtresul

Re: [GENERAL] Select + Functions + Composite Types: Behavior

2011-02-12 Thread David Johnston
Tom, BTW, with the quick response you provided (THANKS!) I probably should have pinged the list sooner in my search... David J. -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Saturday, February 12, 2011 5:33 PM To: David Johnston Cc: pgsql-general@postgresql.org Sub

Re: [GENERAL] Select + Functions + Composite Types: Behavior

2011-02-12 Thread David Johnston
SELECT * FROM compositereturningfunction() 'alias' INTO compositevariable; Does the trick [note the '*' instead of 'x' in the select list] If I put the name of the alias in the select list, like your example shows, I still get the error (though honestly, I expected it to fail to execute...) At le

Re: [GENERAL] Idle connections

2011-02-12 Thread mark
> -Original Message- > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Wednesday, October 06, 2010 11:14 PM > To: mark > Cc: r...@iol.ie; 'Mathieu De Zutter'; 'Georgi Ivanov'; pgsql- > gene...@postgresql.org > Subject: Re: [GENERAL] Idle connections > > "mark" writes: > > If you get

Re: [GENERAL] Select + Functions + Composite Types: Behavior

2011-02-12 Thread Tom Lane
"David Johnston" writes: > If I put a function that returns a composite type into the FROM clause of a > SELECT query (and it - the function - is the only source for the query) the > "*" select list expands so that there is a single record for each component > of the composite type. > SELECT * FR

Re: [GENERAL] SELECT INTO array[i] with PL/pgSQL

2011-02-12 Thread Dmitriy Igrishin
Hey, 2011/2/8 Edoardo Panfili > On 07/02/11 22.15, Julia Jacobson wrote: > >> Dear PostgreSQL community, >> >> Please consider the following minimal example: >> >> CREATE TABLE example (row_id SERIAL, value TEXT); >> INSERT INTO example(value) VALUES ('val1'); >> INSERT INTO example(value) VALUE

Re: [GENERAL] Size of varchar in an array

2011-02-12 Thread Dmitriy Igrishin
Hey, 2011/2/8 RW Shore > I'm using the following type definition: > create type typedef.BASIC_PEDIGREE as ( > DATE_ADDED TIMESTAMP, > DESCRIPTION VARCHAR(128) [10] > )\c > > I understand that PostgreSQL doesn't enforce the array length [10]. > However, I'd like to write an applic

Re: [GENERAL] Multithreaded query onto 4 postgresql instances

2011-02-12 Thread Alban Hertroys
On 10 Feb 2011, at 9:01, Alessandro Candini wrote: > I have installed 4 different instances of postgresql-9.0.2 on the same > machine, on ports 5433, 5434, 5435, 5436. I do hope you intend to put those databases on different machines eventually, or some such? Otherwise you probably didn't gain

Re: [GENERAL] Multithreaded query onto 4 postgresql instances

2011-02-12 Thread Allan Kamau
> 2011/2/10, Alessandro Candini : >> Here you are my probably uncommon situation. >> >> I have installed 4 different instances of postgresql-9.0.2 on the same >> machine, on ports 5433, 5434, 5435, 5436. >> On these instances I have splitted a huge database, dividing it per date >> (from 1995 to 19