> 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
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
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 -
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_
"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
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
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
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
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
> -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,
>
>
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]
"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
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
[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
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
> "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.
>>
"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
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
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
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
>
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
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
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&
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
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]
> 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
* 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
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
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
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
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
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
-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
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
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
>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
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
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
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
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
>
> 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''
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
501 - 542 of 542 matches
Mail list logo