RE: [GENERAL] Trigger with superuser privileges

2000-12-19 Thread Edmar Wiggers
> Anobody could tell-me how can I make a Trigger thats execute some things > whith "postgres" superuser privileges (like INSERT INTO a table that the > user logged in don't have access) I think triggers should run with table-owner user permissions. That way you could have a table owned by superus

[GENERAL] Trigger with superuser privileges

2000-12-19 Thread Tulio Oliveira
Hi, all Anobody could tell-me how can I make a Trigger thats execute some things whith "postgres" superuser privileges (like INSERT INTO a table that the user logged in don't have access) regards, Tulio Oliveira -- == AKACIA TECNOLOGIA Des

[GENERAL] Trigger

2000-12-15 Thread Manika dey
Hi, Can anyone help me . I want to know how to write triggers. i am using java and postgresql --- From:- | Ms. Manika Dey.|Ph.No:-- Engineer-SC (Comp. Tech.) | IPR -- 02712 -

Re: [GENERAL] Trigger/Function problem

2000-12-14 Thread Dan Wilson
That was it! Thanks Tom. I just put this functionality into phpPgAdmin and of course it is taking the newline char from the browser's OS. Thanks for all your help! -Dan > "Dan Wilson" <[EMAIL PROTECTED]> writes: > > I get the following error: > > NOTICE: plpgsql: ERROR during compile of f_

Re: [GENERAL] Trigger/Function problem

2000-12-14 Thread Tom Lane
"Dan Wilson" <[EMAIL PROTECTED]> writes: > I get the following error: > NOTICE: plpgsql: ERROR during compile of f_auto_date near line 1 > "RROR: parse error at or near " Just like that, eh? It looks like the parser is spitting up on a \r in the function text. Try saving your script with Unix

Re: [GENERAL] Trigger/Function problem

2000-12-14 Thread Dan Wilson
If you look at my function definition, you can see that this is not within the function body. This is the testing of the trigger which produces the error. It's just a plain old SQL statment that initiates the trigger. -Dan - Original Message - From: "Robert B. Easter" <[EMAIL PROTECTED

Re: [GENERAL] Trigger/Function problem

2000-12-14 Thread Robert B. Easter
On Thursday 14 December 2000 21:10, Robert B. Easter wrote: > On Thursday 14 December 2000 21:27, Dan Wilson wrote: > > I'm totally fine up to this point... then I try this: > > > > UPDATE help SET site_id = 'APW' WHERE help_id = 2; > > > > I get the following error: > > > > NOTICE: plpgsql: ERRO

Re: [GENERAL] Trigger/Function problem

2000-12-14 Thread Robert B. Easter
On Thursday 14 December 2000 21:27, Dan Wilson wrote: > > I'm totally fine up to this point... then I try this: > > UPDATE help SET site_id = 'APW' WHERE help_id = 2; > > I get the following error: > > NOTICE: plpgsql: ERROR during compile of f_auto_date near line 1 > "RROR: parse error at or ne

[GENERAL] Trigger/Function problem

2000-12-14 Thread Dan Wilson
I'm having problems with a trigger/function and I think it's actually a system problem but I have no clue how to fix it. The trigger is supposed to automatically timestamp the record when it is altered. I've never used anything more than a sql function before so the plpgsql is new to me. Here's

Re: [GENERAL] Trigger Problems?

2000-12-07 Thread GH
> -Original Message- > From: Darrin Ladd <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> > Date: Wednesday, December 06, 2000 12:03 PM > Subject: [GENERAL] Trigger Problems? > > > Hello, > >

Re: [GENERAL] Trigger Problems?

2000-12-07 Thread Darrin Ladd
ete these triggers or if this is a bug.  Either way, I learned something new.   Thanks, Darrin -Original Message-From: Darrin Ladd <[EMAIL PROTECTED]>To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>Date: Wednesday, December 06, 2000 12:03 PMSubject: [GENERAL]

Re: [GENERAL] Trigger firing order

2000-11-29 Thread Tom Lane
"Alex Bolenok" <[EMAIL PROTECTED]> writes: > peroon=# INSERT INTO t_foo (foo_value) VALUES (2000); > NOTICE: fn_foo_ains: Start > NOTICE: fn_foo_ains: End > NOTICE: fn_bar_ains: Start > NOTICE: fn_bar_ains: End Looking at the code, it seems that all AFTER triggers are implicitly handled as DE

Re: [GENERAL] trigger, how to determine action calling?

2000-08-31 Thread Ron Peterson
Marcin Mazurek wrote: > > Hi, > Is it possible to determine easily which action called triger? > For example: > CREATE TRIGGER log_znw BEFORE INSERT OR UPDATE ON tab >FOR EACH ROW EXECUTE PROCEDURE log_tab(); > How to check in called function if it was INSERT or UPDATE? Sure. Here's a snipp

Re: [GENERAL] General Trigger Functions

2000-07-25 Thread Jan Wieck
[EMAIL PROTECTED] wrote: > Hi, > > Is there a way to write a "generic" trigger function in postgres > that can loop thru a table's cloumns (using TG_RELNAME) > and perform certain activities based on, say, certain column-types? > In other words, is it possible to assign OLD. > and NEW. to a variab

[GENERAL] General Trigger Functions

2000-07-25 Thread mjp
Hi, Is there a way to write a "generic" trigger function in postgres that can loop thru a table's cloumns (using TG_RELNAME) and perform certain activities based on, say, certain column-types? In other words, is it possible to assign OLD. and NEW. to a variable inside triggers? Thanks, Morey Par

Re: [GENERAL] trigger question

2000-07-03 Thread Anatoly K. Lasareff
> "m" == mikeo <[EMAIL PROTECTED]> writes: m> At 11:27 AM 6/27/00 -0400, Tom Lane wrote: >> mikeo <[EMAIL PROTECTED]> writes: >>> in oracle, the triggers were smart enough to know not to reference >>> an old value on insert in an "insert or update" trigger procedure, >>> apparently. >>

Re: [GENERAL] Trigger programming..

2000-06-30 Thread Tom Lane
"Mitch Vincent" <[EMAIL PROTECTED]> writes: > I have this code... > tupdesc = rel->rd_att; /* what the tuple looks like (?) */ > app_id_colnum = SPI_fnumber(tupdesc, app_id_fieldname); > if (app_id_colnum == SPI_ERROR_NOATTRIBUTE) >elog(ERROR, "app_id_colnum - SPI_ERROR_NOATTRIBUTE err

Re: [GENERAL] trigger question

2000-06-27 Thread Tom Lane
mikeo <[EMAIL PROTECTED]> writes: > in oracle, the triggers were smart enough to know not to reference > an old value on insert in an "insert or update" trigger procedure, > apparently. > this is the original oracle trigger that works fine > with the same insert statement: > CREATE OR REPLACE T

Re: [GENERAL] trigger question

2000-06-27 Thread mikeo
At 10:33 AM 6/27/00 -0400, Tom Lane wrote: >mikeo <[EMAIL PROTECTED]> writes: >> CREATE function rates_hist_function() >> returns opaque >> as 'BEGIN >>if ( old.rt_valid <> ''P'' or new.rt_valid not in (''Y'',''N'')) > > >> i get th

Re: [GENERAL] trigger question

2000-06-27 Thread Tom Lane
mikeo <[EMAIL PROTECTED]> writes: > CREATE function rates_hist_function() > returns opaque > as 'BEGIN >if ( old.rt_valid <> ''P'' or new.rt_valid not in (''Y'',''N'')) > i get this error: > ERROR: record old is unassigned yet >

[GENERAL] trigger question

2000-06-27 Thread mikeo
hi, i've created a function as follows: drop function rates_hist_function(); CREATE function rates_hist_function() returns opaque as 'BEGIN if ( old.rt_valid <> ''P'' or new.rt_valid not in (''Y'',''N'')) then new.rt_timestamp = n

follow up RE: [GENERAL] Trigger with delete

2000-06-20 Thread Marc Britten
you need to enable plpgsql AND use it as the lang of your function so LANGUAGE 'plpgsql'; thanks -Original Message- From: Marc Britten Sent: Tuesday, June 20, 2000 10:11 AM To: 'Matthias Teege'; [EMAIL PROTECTED] Subject: RE: [GENERAL] Trigger with delete 2 thin

RE: [GENERAL] Trigger with delete

2000-06-20 Thread Marc Britten
lto:[EMAIL PROTECTED]] Sent: Tuesday, June 20, 2000 8:07 AM To: [EMAIL PROTECTED] Subject: [GENERAL] Trigger with delete Moin, I want to setup a trigger that removes entries from a related table depented an the record in the main table. So I try the following: CREATE FUNCTION "delete_aufpos&

Re: [GENERAL] trigger errors

2000-06-15 Thread Ron Peterson
Marc Britten wrote: > > hi again, > > i created a trigger on a table for insert or delete, and a function that > gets created fine. > > however when i go to insert something into the table i get > > NOTICE: plpgsql: ERROR during compile of create_count_cache near line 2 > ERROR: parse error

[GENERAL] TRIGGER Syntax

2000-06-06 Thread Ron Peterson
What does 'STATEMENT' refer to in the following description for CREATE TRIGGER? CREATE TRIGGER name { BEFORE | AFTER } { event [OR ...] } ON table FOR EACH { ROW | STATEMENT } EXECUTE PROCEDURE func ( arguments ) Ron Peterson [EMAIL PROTECTED]

Re: [GENERAL] Trigger

2000-03-07 Thread Bruce Momjian
> Switch to v7.0 beta1 and use FOREIGN KEY. You will save a lot of time. > Before you really finish your development there will be 7.0 production (this > is my private estimation). > Andrzej Mazurkiewicz > > > I am trying to create a trigger for a detail table to check that value > > what is ente

Re: [GENERAL] Trigger

2000-03-07 Thread Alfred Perlstein
* Raigo Lukk <[EMAIL PROTECTED]> [000307 05:36] wrote: > Hi > > I am trying to create a trigger for a detail table to check that value > what is entered exists in master table. > For example into CustomerOrder table could not be enterd order for > Customer what does not exists. > > How is it bes

RE: [GENERAL] Trigger

2000-03-07 Thread Andrzej Mazurkiewicz
000 13:55 > To: [EMAIL PROTECTED] > Subject: [GENERAL] Trigger > > Hi > > I am trying to create a trigger for a detail table to check that value > what is entered exists in master table. > For example into CustomerOrder table could not be enterd order for > Custom

[GENERAL] Trigger

2000-03-07 Thread Raigo Lukk
Hi I am trying to create a trigger for a detail table to check that value what is entered exists in master table. For example into CustomerOrder table could not be enterd order for Customer what does not exists. How is it best done in PostgreSQL? I believe a trigger is what I must do. I looked

[GENERAL] Trigger

2000-03-07 Thread Raigo Lukk
Hi I am trying to create a trigger for a detail table to check that value what is entered exists in master table. For example into CustomerOrder table could not be enterd order for Customer what does not exists. How is it best done in PostgreSQL? I believe a trigger is what I must do. I looked

Re: [GENERAL] Trigger problem

2000-01-19 Thread Ed Loehr
Sarah Officer wrote: > > > delete from istatus where status_code = 'A1'; > ERROR: fmgr_info: function 18848: cache lookup failed > > What is the problem with the cache lookup? Any suggestions would be > appreciated. I seem to recall that kind of message often shows up when you have dropped an

[GENERAL] Trigger problem

2000-01-19 Thread Sarah Officer
I am trying to create a simple trigger function. With some help from the mailing list, I managed to create a trigger and functions. Unfortunately I get an error message when I delete from the table which has the trigger. Can anyone help me spot the error? Here's what I have done: CREATE FUNC

[GENERAL] trigger problem?

2000-01-06 Thread Oren Teich
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 06, 2000 5:15 PM I'm using the fti function that is included with the source, and seem to have run into a problem with the trigger call. I have a full text index with only around 556645 entries

Re: [GENERAL] Trigger documentation? Need more examples.. pleeeze.. ;-)

1999-08-20 Thread Henrique Pantarotto
Zakkr, I love you. It worked!! Your help should keep me busy this weekend.. ;-) Thanks a lot.. I shall bug you again for sure.. j/k.. ;-) Henrique Pantarotto Sao Paulo, SP - Brazil On sex, 20 ago 1999, Zakkr wrote: > On Fri, 20 Aug 1999, Henrique Pantarotto wrote: > > > I would like to kno

Re: [GENERAL] Trigger documentation? Need more examples.. pleeeze.. ;-)

1999-08-20 Thread Zakkr
On Fri, 20 Aug 1999, Henrique Pantarotto wrote: > I would like to know how, from a trigger C function, can I get the "old" and > "new" value for an updated field. Is this possible? How do I do that? > > For example, if I do: > > update users set username = "clinton" where id = "2400" examp

Re: [GENERAL] Trigger documentation? Need more examples.. pleeeze.. ;-)

1999-08-20 Thread amy cheng
>To: Zakkr <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED] >Subject: Re: [GENERAL] Trigger documentation? Need more examples.. >pleeeze.. ;-) >Date: Fri, 20 Aug 1999 09:44:40 -0300 > >Zakkr, > >I wonder if you read my message. I am aware of the examples in the >cont

Re: [GENERAL] Trigger documentation? Need more examples.. pleeeze.. ;-)

1999-08-20 Thread Henrique Pantarotto
Zakkr, I wonder if you read my message. I am aware of the examples in the contrib/spi directory, but they aren't enough for me. I'm looking for a more specific trigger documentation, or more trigger examples. I would like to know how, from a trigger C function, can I get the "old" and "new" va

Re: [GENERAL] Trigger documentation? Need more examples.. pleeeze.. ;-)

1999-08-20 Thread Zakkr
On Thu, 19 Aug 1999, Henrique Pantarotto wrote: > Hello PostgreSQL friends! > > I'm new to PostgreSQL, but I've been using MySQL/mSQL for a long time now. I > switched to PostgreSQL mostly because of it's features: triggers, specially. > Trigger examples ... why not: ..see a /postgresql-6.5

Re: [GENERAL] Trigger documentation? Need more examples.. pleeeze.. ;-)

1999-08-19 Thread Henrique Pantarotto
the one in the /test is rather complex (too complex?). > > However, PL/pgSQL may not be able to to external stuff, even C > can do that. -- I have the same problem, anybody'd ideas? > > > > > >From: Henrique Pantarotto <[EMAIL PROTECTED]> > >To: [EM

[GENERAL] Trigger documentation? Need more examples.. pleeeze.. ;-)

1999-08-19 Thread Henrique Pantarotto
Hello PostgreSQL friends! I'm new to PostgreSQL, but I've been using MySQL/mSQL for a long time now. I switched to PostgreSQL mostly because of it's features: triggers, specially. I've studied, compiled and tried the examples from the crontrib/spi directory. They all worked, but without some k

Re: [GENERAL] Trigger or Rule?

1999-04-26 Thread Adriaan Joubert
> > select count(*) into cnt from where new. = key; > if (cnt>0) then > delete from where key = new. > end if > Just looked at this, and this is not actually what you wanted. If you do not want to replace the old row, do something along the lines RAISE EXCEPTION ''Duplicate entry''

Re: [GENERAL] Trigger or Rule?

1999-04-26 Thread Adriaan Joubert
Andy Lewis wrote: > > I have a table that among other things has a name, address, city, state > fields. When I insert into, I want to be able to make sure that there is > no duplicate records or that a row is inserted that is already in the DB. > > Question number one is: Should I use a trigger

<    1   2   3   4   5   6