[GENERAL] pl/pgsql RECORD data type, how to access to the values

2008-04-05 Thread Guillaume Bog
Hello, I'm writing a trigger in pl/pgSQL and I'd like to pass one column name as argument to the trigger function. Provided my table has only one column named 'id', I can do easilly CREATE FUNCTION ft() RETURNS trigger AS $$ BEGIN RAISE NOTICE 'It works:%', OLD.id; END $$ LANGUAGE plpgsql;

Re: [GENERAL] pl/pgsql RECORD data type, how to access to the values

2008-04-05 Thread Guillaume Bog
On Sat, Apr 5, 2008 at 4:05 PM, Pavel Stehule <[EMAIL PROTECTED]> wrote: > Hello > > > > > On 05/04/2008, Guillaume Bog <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I'm writing a trigger in pl/pgSQL and I'd like to pass one column name as

Re: [GENERAL] pl/pgsql RECORD data type, how to access to the values

2008-04-06 Thread Guillaume Bog
On Mon, Apr 7, 2008 at 1:56 AM, Craig Ringer <[EMAIL PROTECTED]> wrote: > Guillaume Bog wrote: > > > I want a table to be "read-only", so I raise exceptions with a before > > trigger on update, insert and delete. It works well. > > > > This read

[GENERAL] High activity short table and locks

2008-07-23 Thread Guillaume Bog
Hi! We have been using postgresql since a while without problems. But now I find we experience some slowness and the weird thing is that it seems to happen because of a very short table (less than 200 lines), called "lockers" (see below it's structure). This table is accessed very often by a lot

Re: [GENERAL] High activity short table and locks

2008-07-23 Thread Guillaume Bog
On Wed, Jul 23, 2008 at 4:50 PM, Richard Huxton <[EMAIL PROTECTED]> wrote: > Guillaume Bog wrote: > >> It seems I'm a bit stuck here. I'd appreciate some help. My main general >> question is "how to handle very small but hot status table that has to be >&

Re: [GENERAL] High activity short table and locks

2008-07-25 Thread Guillaume Bog
M, Richard Huxton <[EMAIL PROTECTED]> wrote: > Guillaume Bog wrote: > >> On Wed, Jul 23, 2008 at 11:17 PM, Richard Huxton <[EMAIL PROTECTED]> >> wrote: >> >> I tried a vacuum full and had to stop it as it was blocking the server for >> too long.

[GENERAL] Place of subselect

2008-11-24 Thread Guillaume Bog
Hi dear Postgres users. I have performance issues if I do the following pseudo-query: SELECT a, b, (SELECT count(*) FROM t2 WHERE something) AS c FROM t1 ORDER BY a LIMIT 10; After some tests, it seems to me that the subquery on t2 is computed for all rows of t1. As I don't "ORDER BY c", there i

Re: [GENERAL] Place of subselect

2008-11-25 Thread Guillaume Bog
On Tue, Nov 25, 2008 at 15:56, A. Kretschmer < [EMAIL PROTECTED]> wrote: > am Tue, dem 25.11.2008, um 15:34:57 +0800 mailte Guillaume Bog folgendes: > > Hi dear Postgres users. > > > > I have performance issues if I do the following pseudo-query: > > > >

[GENERAL] finding a column by name in psql

2007-03-12 Thread Guillaume Bog
Hi everyone, I'm now used to using psql to manage my databases into a terminal, and I found the very convenient "\g |" command that pipes query result in any shell tool I want. But I still have hard time finding some columns in some tables (that may have 300+ cols). I would like to pipe the resul

Re: [GENERAL] finding a column by name in psql

2007-03-13 Thread Guillaume Bog
On 13/03/07, Merlin Moncure <[EMAIL PROTECTED]> wrote: On 3/12/07, Guillaume Bog <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm now used to using psql to manage my databases into a terminal, and > I found the very convenient "\g |" command that pipes

[GENERAL] A little help for big forms

2007-04-02 Thread Guillaume Bog
Hi PostgreSQL afficionados, I have a little question that I know is not fully on topic, but because I'm lurking this list I know many highly skilled and experienced people are there. So I try it: I have to store a big html form in my database. It has around 100 fields of differents kinds (varcha