Lists: | pgsql-general |
---|
From: | Thomas Egge <teg(at)ratio(dot)de> |
---|---|
To: | pgsql-general(at)postgreSQL(dot)org |
Subject: | Read values from Trigger out |
Date: | 2000-02-09 15:36:56 |
Message-ID: | 00020916434500.16346@Thomy |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
I have created a trigger function.
could somebody tell me how I get the values from the insert in the trigger
function.
I tried the function
SPI_getvalue(trigger,tupdesc,attnum)
but after starting the trigger, I become this terminating output:
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
We have lost the connection to the backend, so further processing is impossible. Terminating.
thank's for your help
--
Thomas Egge
From: | "Nilesh A(dot) Phadke" <nphadke(at)csgrad(dot)cs(dot)vt(dot)edu> |
---|---|
To: | Thomas Egge <teg(at)ratio(dot)de> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: [GENERAL] Read values from Trigger out |
Date: | 2000-02-09 17:28:38 |
Message-ID: | Pine.OSF.4.21.0002091225270.22846-100000@csgrad.cs.vt.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Hello Thomas,
I have used the same thing and it does work for me.... I was also getting
similar problems initially....
What does your trigger do? does it insert a tuple back into the table? if
yes then that is your problem ... coz the insert will fire another trigger
and this may continue endlessly....
Nilesh.
On Wed, 9 Feb 2000, Thomas Egge wrote:
> I have created a trigger function.
>
> could somebody tell me how I get the values from the insert in the trigger
> function.
> I tried the function
>
> SPI_getvalue(trigger,tupdesc,attnum)
>
> but after starting the trigger, I become this terminating output:
>
> pqReadData() -- backend closed the channel unexpectedly.
> This probably means the backend terminated abnormally
> before or while processing the request.
> We have lost the connection to the backend, so further processing is impossible. Terminating.
>
>
> thank's for your help
> --
> Thomas Egge
>
> ************
>
>
-------------------------------------------------------------------
Your intellect is the best gift given to you by god |
How you use it decides your gift back to him........ |
-------------------------------------------------------------------
Nilesh Phadke | e-mail: nilesh(at)collegemail(dot)com |
Graduate Research Asstt. | Phone : (540) 951 8399 |
Department of Computer Science | Addr : 1011 University City Blvd |
Virginia Tech. | Apt I-7 |
| Blacksburg, VA 24060 |
-------------------------------------------------------------------
From: | Karel Zak - Zakkr <zakkr(at)zf(dot)jcu(dot)cz> |
---|---|
To: | Thomas Egge <teg(at)ratio(dot)de> |
Cc: | pgsql-general(at)postgreSQL(dot)org |
Subject: | Re: [GENERAL] Read values from Trigger out |
Date: | 2000-02-10 09:33:59 |
Message-ID: | Pine.LNX.3.96.1000210102741.21359A-100000@ara.zf.jcu.cz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On Wed, 9 Feb 2000, Thomas Egge wrote:
> I have created a trigger function.
>
> could somebody tell me how I get the values from the insert in the trigger
> function.
> I tried the function
>
> SPI_getvalue(trigger,tupdesc,attnum)
>
Example:
TupleDesc tupdesc;
HeapTuple rettuple = NULL;
char *value;
if (!CurrentTriggerData)
elog(ERROR, "triggers are not initialized");
if (TRIGGER_FIRED_BY_UPDATE(CurrentTriggerData->tg_event))
rettuple = CurrentTriggerData->tg_newtuple;
else if (TRIGGER_FIRED_BY_INSERT(CurrentTriggerData->tg_event))
rettuple = CurrentTriggerData->tg_trigtuple;
else if (TRIGGER_FIRED_BY_DELETE(CurrentTriggerData->tg_event))
rettuple = CurrentTriggerData->tg_trigtuple;
tupdesc = CurrentTriggerData->tg_relation->rd_att;
if (SPI_connect() < 0)
elog(ERROR, "SPI_connect()");
value = SPI_getvalue(rettuple, tupdesc, SPI_fnumber(tupdesc, "column_name"));
...see the PostgreSQL programmer's guide for more...
Karel
From: | <kaiq(at)realtyideas(dot)com> |
---|---|
To: | pgsql-general(at)postgreSQL(dot)org |
Subject: | NT binary dbd or odbc? |
Date: | 2000-02-10 21:44:41 |
Message-ID: | Pine.LNX.4.10.10002101534140.12875-100000@picasso.realtyideas.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
To please my customer, I'm porting an app from Linux/PG/perl-cgi
to NT/MSsql/perl-cgi. In the process, I'd like to make some testing.
so, I need perl-cgi on NT talk to pg on linxu.
questions:
1) Should I use DBD::PG or use DBD::ODBC.
2) Where I can get the binary files (I do not have the
compiler -- even if I have, I do not want to get into THAT).
thanks!!!
Kai
From: | M(dot)Mazurek(at)poznan(dot)multinet(dot)pl |
---|---|
To: | pgsql-general(at)postgreSQL(dot)org |
Subject: | pgFlush() -- connection not open |
Date: | 2000-02-13 11:48:14 |
Message-ID: | Pine.BSF.4.21.0002131142080.6821-100000@arka.poznan.mtl.pl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Hi,
I'm writing some small postgres2www aplication useing jdbc and large
objects.
During testing with heavy load of it I managed to mess up everything:)
I can connect do ny databese but I can't do any query, eg:
bannerdb=> \dt
pqFlush() -- connection not open
It happens with all db I have, I can;t destroy them and recreate them
(same error), I can't vacuum them. Is there any solution except deleteing
data dir adn reinitializing db?
thx
mazek