agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] the relation ID of the table on which the trigger occured.
7+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] the relation ID of the table on which the trigger occured.
@ 2005-05-25 07:40 
  2005-05-25 07:50 ` [Pljava-dev] the relation ID of the table on which the trigger occured. 
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2005-05-25 07:40 UTC (permalink / raw)

Hi,
I think that TriggerData class is missing getRelationID method - this 
should return  OID of the table on which the trigger fired. Can I get 
table's OID which fired the trigger in other way ?

Regards,
ML





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] the relation ID of the table on which the trigger occured.
  2005-05-25 07:40 [Pljava-dev] the relation ID of the table on which the trigger occured. 
@ 2005-05-25 07:50 ` 
  2005-05-25 08:32   ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2005-05-25 07:50 UTC (permalink / raw)

Marek Lewczuk wrote:

> Hi,
> I think that TriggerData class is missing getRelationID method - this 
> should return  OID of the table on which the trigger fired. Can I get 
> table's OID which fired the trigger in other way ?

The TriggerData.getTableName() will give you the name of the relation. 
The TriggerData interface is designed to be as database agnostic as 
possible (to allow other vendors to use the same interface) and the 
relation OID is very PostgreSQL specific.

We might add a method on the Oid class in the future. Something like:

    public static Oid forRelationName(String relationName)

but at present you must use SQL to obtain the OID.

Regards,
Thomas Hallgren






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Re: the relation ID of the table on which the trigger occured.
  2005-05-25 07:40 [Pljava-dev] the relation ID of the table on which the trigger occured. 
  2005-05-25 07:50 ` [Pljava-dev] the relation ID of the table on which the trigger occured. 
@ 2005-05-25 08:32   ` 
  2005-05-25 09:15     ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2005-05-25 08:32 UTC (permalink / raw)

Thomas Hallgren napisa?(a):
> Marek Lewczuk wrote:
> 
>> Hi,
>> I think that TriggerData class is missing getRelationID method - this 
>> should return  OID of the table on which the trigger fired. Can I get 
>> table's OID which fired the trigger in other way ?
> 
> The TriggerData.getTableName() will give you the name of the relation. 
True, but it returns only table's name, without schema name - table's
name can't be used as a true identifier of given table (because table
e.g. "pljavaexample" can exists in many schemas) and because of that
relation ID is needed.

> The TriggerData interface is designed to be as database agnostic as 
> possible (to allow other vendors to use the same interface) and the 
> relation OID is very PostgreSQL specific.
I understand, however that can lead to many other losts on the pljava's
functionality - PostgreSQL is very complex and it contains many unique
features, which are not available in other RDBMS.

> 
> We might add a method on the Oid class in the future. Something like:
>    public static Oid forRelationName(String relationName)
This will not help - you don't know the schema name (because 
getTableName() doesn't return schema name).

ML

 




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Re: the relation ID of the table on which the trigger occured.
  2005-05-25 07:40 [Pljava-dev] the relation ID of the table on which the trigger occured. 
  2005-05-25 07:50 ` [Pljava-dev] the relation ID of the table on which the trigger occured. 
  2005-05-25 08:32   ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
@ 2005-05-25 09:15     ` 
  2005-05-25 09:43       ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2005-05-25 09:15 UTC (permalink / raw)

Marek Lewczuk wrote:

> Thomas Hallgren napisa?(a):
>
>> The TriggerData.getTableName() will give you the name of the relation. 
>
> True, but it returns only table's name, without schema name - table's
> name can't be used as a true identifier of given table (because table
> e.g. "pljavaexample" can exists in many schemas) and because of that
> relation ID is needed.

That's a bug in that case. The table must of course be qualified.

>> The TriggerData interface is designed to be as database agnostic as 
>> possible (to allow other vendors to use the same interface) and the 
>> relation OID is very PostgreSQL specific.
>
> I understand, however that can lead to many other losts on the pljava's
> functionality - PostgreSQL is very complex and it contains many unique
> features, which are not available in other RDBMS.

No, there will be no functionality loss. Just a clear separation of 
concern. The idea is that if you want to write portable code, then stick 
with the public interfaces. If you want to do PostgreSQL specific stuff, 
use pljava.internal stuff.

Regards,
Thomas Hallgren






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Re: the relation ID of the table on which the trigger occured.
  2005-05-25 07:40 [Pljava-dev] the relation ID of the table on which the trigger occured. 
  2005-05-25 07:50 ` [Pljava-dev] the relation ID of the table on which the trigger occured. 
  2005-05-25 08:32   ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  2005-05-25 09:15     ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
@ 2005-05-25 09:43       ` 
  2005-05-25 09:47         ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  2005-05-25 10:57         ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  0 siblings, 2 replies; 7+ messages in thread

From:  @ 2005-05-25 09:43 UTC (permalink / raw)

Thomas Hallgren napisa?(a):
> Marek Lewczuk wrote:
> 
>> Thomas Hallgren napisa?(a):
>>
>>> The TriggerData.getTableName() will give you the name of the relation. 
> That's a bug in that case. The table must of course be qualified.
Note that plpgsql's TG_RELNAME variable contains the table name without 
schema...

Regards,
ML

 




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Re: the relation ID of the table on which the trigger occured.
  2005-05-25 07:40 [Pljava-dev] the relation ID of the table on which the trigger occured. 
  2005-05-25 07:50 ` [Pljava-dev] the relation ID of the table on which the trigger occured. 
  2005-05-25 08:32   ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  2005-05-25 09:15     ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  2005-05-25 09:43       ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
@ 2005-05-25 09:47         ` 
  1 sibling, 0 replies; 7+ messages in thread

From:  @ 2005-05-25 09:47 UTC (permalink / raw)

Marek Lewczuk wrote:

> Note that plpgsql's TG_RELNAME variable contains the table name 
> without schema...
>
Ok, so perhaps a getSchemaName() should be added to TriggerData then. 
And on the Oid class:

    public static Oid forRelation(String schemaName, String relationName);

Regards,
Thomas Hallgren






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Re: the relation ID of the table on which the trigger occured.
  2005-05-25 07:40 [Pljava-dev] the relation ID of the table on which the trigger occured. 
  2005-05-25 07:50 ` [Pljava-dev] the relation ID of the table on which the trigger occured. 
  2005-05-25 08:32   ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  2005-05-25 09:15     ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
  2005-05-25 09:43       ` [Pljava-dev] Re: the relation ID of the table on which the trigger occured. 
@ 2005-05-25 10:57         ` 
  1 sibling, 0 replies; 7+ messages in thread

From:  @ 2005-05-25 10:57 UTC (permalink / raw)

Thomas Hallgren napisa?(a):
> Marek Lewczuk wrote:
> 
>> Note that plpgsql's TG_RELNAME variable contains the table name 
>> without schema...
>>
> Ok, so perhaps a getSchemaName() should be added to TriggerData then. 
> And on the Oid class:
> 
>    public static Oid forRelation(String schemaName, String relationName);

Would be great. Should I fill "feature request" form ?

Best regards,
ML

 




^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2005-05-25 10:57 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-05-25 07:40 [Pljava-dev] the relation ID of the table on which the trigger occured. 
2005-05-25 07:50 ` 
2005-05-25 08:32   ` 
2005-05-25 09:15     ` 
2005-05-25 09:43       ` 
2005-05-25 09:47         ` 
2005-05-25 10:57         ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox