Re: [SQL] knowing which columns have beend UPDATEd inside a TRIGGER?

2000-10-25 Thread Tomas Berndtsson
Tom Lane <[EMAIL PROTECTED]> writes: > Louis-David Mitterrand <[EMAIL PROTECTED]> writes: > > Is there a way to know which columns are being UPDATEd or INSERTEd from > > inside a trigger, either in C or pl/pgsql? > > Huh? An INSERT always inserts all columns, by definition. Some of them > migh

Re: [SQL] knowing which columns have beend UPDATEd inside a TRIGGER?

2000-10-25 Thread Louis-David Mitterrand
On Tue, Oct 24, 2000 at 06:51:03PM -0400, Tom Lane wrote: > Louis-David Mitterrand <[EMAIL PROTECTED]> writes: > > Is there a way to know which columns are being UPDATEd or INSERTEd from > > inside a trigger, either in C or pl/pgsql? > > Huh? An INSERT always inserts all columns, by definition.

Re: [SQL] help on creating table

2000-10-25 Thread Albert REINER
Saluton, this is easy: On Fri, Oct 20, 2000 at 06:48:54PM +0800, pgsql-sql wrote: ... > NODE1 >+ --- NODE1_1 >+ --- NODE1_2 >|+ --- NODE1_2_1 >+ --- NODE1_3 create table n (id int4, parent int4, data text); insert into n (id, data) values (1, 'node 1'); insert into n (i

Re: [SQL] Alternate Database Locations

2000-10-25 Thread Brian C. Doyle
Well I got it working kinda. You have set up an environment for the new directory and export it under the PGSQL super user account PGDATA2=/home/userid export PGDATA2 Then run initlocation PGDATA2 After that you have to restart your postmaster with the data dir as PGDATA2 postmaster -d PGDATA

Re: [SQL] Alternate Database Locations

2000-10-25 Thread Roderick A. Anderson
On Tue, 24 Oct 2000, Brian C. Doyle wrote: > Never mind... I got it working OK, don't play your cards so close to the vest. What was the problem (and solution)? TIA, Rod -- Roderick A. Anderson [EMAIL PROTECTED] Altoplanos Information Systems, Inc. Voice: 208.765.6149

[SQL] How to call a shell command in rule

2000-10-25 Thread Jie Liang
Hi, I want send a e-mail when the rows of mytable reaches 100,000, how? -- Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 [EMAIL PROTECTED] www.ipinc.com

[SQL] Get a time from a char column

2000-10-25 Thread Blaise Carrupt
Hi ! What I would like is this : insert into tt1 (select a from tt2) where tt1.x field is a time, and tt2.a field is a char containing '10:00'. Doing that, Postgres tells me something like 'x is of type time and a of type bpchar'. That's true, but I can't find the way to cast my char field in

[SQL] Surprising sequence scan when function call used

2000-10-25 Thread Will Fitzgerald
I have a table, login, which has a field by the same name; there's an index on that field. I was surprised to discover that a SELECT which compares the login field to a constant uses an Index scan, but if it is compared to a function call--for example, lower()--a sequence scan is forced. Any idea

Re: [SQL] Alternate Database Locations

2000-10-25 Thread Tom Lane
"Brian C. Doyle" <[EMAIL PROTECTED]> writes: > I am still trying to find out how to get multiple postmasters running on > different ports at the same time. Does anyone have any clue how to do that? Uh, you just do it. Start each postmaster in a different data directory and with a different por

[SQL] Add Constraint

2000-10-25 Thread Sivagami .
Hi all,   I am a newbie to Postgresql, but I am familiar with SQL. I am trying to add a constraint to my table using the ALTER TABLE command. The command goes like this :   ALTER TABLE USER_SIGNUP ADD CONSTRAINTP_USER_SIGNUP_USER_ID PRIMARY KEY(user_id);   But it is returning the error ERROR

[SQL] How to Return number of rows updated in stored procedure

2000-10-25 Thread Shane McEneaney
Hi, can anybody tell me how to capture the number of rows updated in an update query inside a stored procedure? This doesn't work but hopefully you will see what I mean. CREATE FUNCTION "test" () RETURNS int AS ' DECLARE v_number_of_rows int; BEGIN select into v_number_of_ro

Re: [SQL] Surprising sequence scan when function call used

2000-10-25 Thread Tom Lane
"Will Fitzgerald" <[EMAIL PROTECTED]> writes: > vdsq=> explain select * from login where login.login = lower('foo'); > Seq Scan on login (cost=0.00..1361.86 rows=609 width=62) 7.0 is a little bit stupid about cross-data-type comparisons (lower() yields text, not char(n)). This example works OK

Re: [SQL] How to call a shell command in rule

2000-10-25 Thread Clayton Cottingham
On Wed, 25 Oct 2000 10:44:48 -0700, Jie Liang said: > Hi, > > I want send a e-mail when the rows of mytable reaches 100,000, how? > > > one way is to make a function using perl and use say mail::sender as the module to send the info use the code snippet in perldoc Mail::Sender anot

[SQL] plperl

2000-10-25 Thread Jie Liang
hi, I followed README tried to install plperl: su-2.04# cd /work/src/pgsql702/src/pl/plperl su-2.04# perl Makefile.PL Writing Makefile for plperl su-2.04# make "../../../src/Makefile.global", line 135: Need an operator "../../../src/Makefile.global", line 139: Missing dependency operator "../../