|
Ok, let me explain better! In my table example
I will store datas like
Considering the overlaps of emp_time and this
question: what is the salary of employee Rodrigo on 2006-apr-01 ??? This data
is inconsistent because the overlaps of time! So, I have to guarantee that this situation
doesn’t occur! But I don’t want to use triggers because this check
must be done on almost all tables that uses the type: CREATE TYPE time_interval ( Tbegin date, Tend date ) And be easy to the user. For example, any table
that is created using this type garantees that the overlaps will not occur! To
do this I have to get access for the past data of the table, and so, I have to
know wich table is using the type and have data being inserted! Is that a way of doing this? -----Mensagem original----- " > So, when I execute an INSERT operation on this table,
the functions that > deals with this type need the id or name of the table that the
data was > inserted! Why? Your example datatype doesn't seem to require any such
thing. > How can I get this ID or NAME inside this functions???
You can't. The question itself is bogus because it assumes that
data values only exist within tables. You could not have a transient
value of the datatype (eg, a function result) because that is not stored in any table. regards,
tom lane ---------------------------(end of
broadcast)--------------------------- TIP 4: Have you searched our list archives?
http://archives.postgresql.org |