![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have create a table with this structur CREATE TABLE import ( id1 integer NOT NULL, id2 integer NOT NULL, dataset oid NOT NULL, CONSTRAINT import_pk PRIMARY KEY (id1, id2), CONSTRAINT import_fk FOREIGN KEY (id1, id1) REFERENCES ... MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE ) WITH (OIDS=FALSE); I insert my blobs with JDBC and I can read / write them without problems. Must I delete explicite the blob, if I delete a row on my table "import" ? If yes, how? I would like to do this with a trigger on my table. |
#3
| |||
| |||
|
|
Philipp Kraus, 18.11.2009 15:01: Hi, I have create a table with this structur CREATE TABLE import ( id1 integer NOT NULL, id2 integer NOT NULL, dataset oid NOT NULL, CONSTRAINT import_pk PRIMARY KEY (id1, id2), CONSTRAINT import_fk FOREIGN KEY (id1, id1) REFERENCES ... MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE ) WITH (OIDS=FALSE); I insert my blobs with JDBC and I can read / write them without problems. Must I delete explicite the blob, if I delete a row on my table "import" ? If yes, how? I would like to do this with a trigger on my table. My understanding is that you need to take care of deleting the large objects yourself. |
#4
| |||
| |||
|
|
I understand that also, but how can I delete the binary data in a trigger function in the table? I would like to run a trigger on update / delete that delete the binary data (if it is required) |
#5
| |||
| |||
|
|
Philipp Kraus, 18.11.2009 15:42: I understand that also, but how can I delete the binary data in a trigger function in the table? I would like to run a trigger on update / delete that delete the binary data (if it is required) Maybe this helps: http://www.postgresql.org/docs/8.4/static/lo.html |
#6
| |||
| |||
|
|
Philipp Kraus, 18.11.2009 15:42: I understand that also, but how can I delete the binary data in a trigger function in the table? I would like to run a trigger on update / delete that delete the binary data (if it is required) Maybe this helps: http://www.postgresql.org/docs/8.4/static/lo.html Why don't you use bytea? Makes live a lot easier |
#7
| |||
| |||
|
|
I have take the example under 8.3 but it dosn't work CREATE TRIGGER t_raster BEFORE UPDATE OR DELETE ON image FOR EACH ROW EXECUTE PROCEDURE lo_manage(raster); The command "lo_manage" isn't known by the database Did you install the module? |
#8
| |||
| |||
|
|
Philipp Kraus, 18.11.2009 16:26: I have take the example under 8.3 but it dosn't work CREATE TRIGGER t_raster BEFORE UPDATE OR DELETE ON image FOR EACH ROW EXECUTE PROCEDURE lo_manage(raster); The command "lo_manage" isn't known by the database Did you install the module? |
#9
| |||
| |||
|
|
On 2009-11-18 16:48:55 +0100, Thomas Kellerer OTPXDAJCSJVU (AT) spammotel (DOT) com> said: Philipp Kraus, 18.11.2009 16:26: I have take the example under 8.3 but it dosn't work CREATE TRIGGER t_raster BEFORE UPDATE OR DELETE ON image FOR EACH ROW EXECUTE PROCEDURE lo_manage(raster); The command "lo_manage" isn't known by the database Did you install the module? I had installed the binary package for OSX and created the plpsql language into my database. Do I have forgot something? Yes, you need to install the contrib module "lo". |
#10
| |||
| |||
|
|
Philipp Kraus, 18.11.2009 16:55: On 2009-11-18 16:48:55 +0100, Thomas Kellerer OTPXDAJCSJVU (AT) spammotel (DOT) com> said: Philipp Kraus, 18.11.2009 16:26: I have take the example under 8.3 but it dosn't work CREATE TRIGGER t_raster BEFORE UPDATE OR DELETE ON image FOR EACH ROW EXECUTE PROCEDURE lo_manage(raster); The command "lo_manage" isn't known by the database Did you install the module? I had installed the binary package for OSX and created the plpsql language into my database. Do I have forgot something? Yes, you need to install the contrib module "lo". The script should be located in share/contrib |
![]() |
| Thread Tools | |
| Display Modes | |
| |