Re: [HACKERS] Command Triggers, v16

2012-03-16 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: Multi-word type names are a serious pain in the ass; they require hackery in a lot of places. We support the ones that the SQL spec requires us to, but I will object in the strongest terms to inventing any that are not required by spec. I object in even

Re: [HACKERS] Command Triggers, v16

2012-03-16 Thread Robert Haas
On Fri, Mar 16, 2012 at 7:42 AM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: I don’t know if this was a problem before that I didn’t spot (probably), but triggers for both ANY COMMAND and ALTER FOREIGN TABLE show a command tag of ALTER TABLE for ALTER FOREIGN TABLE statements where the

Re: [HACKERS] Command Triggers, v16

2012-03-16 Thread Dimitri Fontaine
Robert Haas robertmh...@gmail.com writes: there has to be some way to do that without breaking command triggers. Sure, special case the switch branch in utility.c so as to return a different command tag for ALTER TABLE and ALTER FOREIGN TABLE. For precedents, see

Re: [HACKERS] Command Triggers, v16

2012-03-16 Thread Tom Lane
Dimitri Fontaine dimi...@2ndquadrant.fr writes: Tom Lane t...@sss.pgh.pa.us writes: If you think cmdtrigger isn't a good name maybe you should have picked a different one to start with. Well, I think it's a good internal name. I'm not too sure about exposing it, the only reason why it's a

Re: [HACKERS] Command Triggers, v16

2012-03-16 Thread Thom Brown
On 16 March 2012 16:26, Tom Lane t...@sss.pgh.pa.us wrote: Dimitri Fontaine dimi...@2ndquadrant.fr writes: Tom Lane t...@sss.pgh.pa.us writes: If you think cmdtrigger isn't a good name maybe you should have picked a different one to start with. Well, I think it's a good internal name. I'm

Re: [HACKERS] Command Triggers, patch v11

2012-03-16 Thread Tom Lane
Andres Freund and...@anarazel.de writes: [ ctas-01.patch ] I'm starting to look at this now. For a patch that's supposed to de-complicate things, it seems pretty messy :-( One thing I soon found is that it lacks support for EXPLAIN SELECT INTO. That used to work, but now you get regression=#

Re: [HACKERS] Command Triggers, patch v11

2012-03-16 Thread Andres Freund
On Friday, March 16, 2012 09:54:47 PM Tom Lane wrote: Andres Freund and...@anarazel.de writes: [ ctas-01.patch ] I'm starting to look at this now. Great! For a patch that's supposed to de-complicate things, it seems pretty messy :-( Yea. It started out simple but never stopped getting

Re: [HACKERS] Command Triggers, patch v11

2012-03-16 Thread Tom Lane
Andres Freund and...@anarazel.de writes: One more thing I disliked quite a bit was the duplication of the EXECUTE handling. Do you see a way to deduplicate that? Yeah, that's what's bugging me, too. I think a chunk of the problem is that you're insisting on having control come back to

Re: [HACKERS] Command Triggers, patch v11

2012-03-16 Thread Andres Freund
On Friday, March 16, 2012 10:31:57 PM Tom Lane wrote: Andres Freund and...@anarazel.de writes: One more thing I disliked quite a bit was the duplication of the EXECUTE handling. Do you see a way to deduplicate that? Yeah, that's what's bugging me, too. I think a chunk of the problem is

Re: [HACKERS] Command Triggers, patch v11

2012-03-16 Thread Tom Lane
Andres Freund and...@anarazel.de writes: On Friday, March 16, 2012 10:31:57 PM Tom Lane wrote: I'm thinking that if the table creation were to be moved into the tuple receiver's startup routine, we could avoid needing to get control back between ExecutorStartup and ExecutorRun, and then all

Re: [HACKERS] Command Triggers, patch v11

2012-03-16 Thread Andres Freund
On Friday, March 16, 2012 10:52:55 PM Tom Lane wrote: Andres Freund and...@anarazel.de writes: On Friday, March 16, 2012 10:31:57 PM Tom Lane wrote: I'm thinking that if the table creation were to be moved into the tuple receiver's startup routine, we could avoid needing to get control

Re: [HACKERS] Command Triggers, patch v11

2012-03-15 Thread Thom Brown
On 14 March 2012 21:33, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Ok, I've implemented that. No patch attached because I need to merge with master again and I'm out to sleep now, it sometimes ring when being on-call… Curious people might have a look at my github repository where the

Re: [HACKERS] Command Triggers, v16

2012-03-15 Thread Thom Brown
On 15 March 2012 18:13, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, I guess it's time to start a new thread here. Please find attached version 16 of the command trigger patch, with augmented documentation and “magic variable” support (TG_WHEN, TG_OBJECTID and such). The current

Re: [HACKERS] Command Triggers, v16

2012-03-15 Thread Dimitri Fontaine
Thanks for testing this new version (again). A quick answer now, I'll send another patch tomorrow. Thom Brown thombr...@gmail.com writes: I don’t understand how functions can return a type of “command trigger”. This certainly works, but I’ve never seen a type consisting of more than one

Re: [HACKERS] Command Triggers, v16

2012-03-15 Thread Dimitri Fontaine
Dimitri Fontaine dimi...@2ndquadrant.fr writes: At this moment in time, CTAS is still outstanding. Is the plan to try to get that in for this release, or as an enhancement in 9.3? The plan is to get CTAS as a utility command in 9.2 then update the command trigger patch to benefit from the

Re: [HACKERS] Command Triggers, v16

2012-03-15 Thread Thom Brown
On 15 March 2012 22:06, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Dimitri Fontaine dimi...@2ndquadrant.fr writes: At this moment in time, CTAS is still outstanding.  Is the plan to try to get that in for this release, or as an enhancement in 9.3? The plan is to get CTAS as a utility

Re: [HACKERS] Command Triggers, patch v11

2012-03-14 Thread Dimitri Fontaine
Robert Haas robertmh...@gmail.com writes: On Tue, Mar 13, 2012 at 5:06 PM, Andres Freund and...@anarazel.de wrote: Generally, uppon rereading, I have to say that I am not very happy with the decision that ANY triggers are fired from other places than the specific triggers. That seams to be a

Re: [HACKERS] Command Triggers, patch v11

2012-03-14 Thread Robert Haas
On Wed, Mar 14, 2012 at 4:27 AM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Also, when calling the user's procedure from the same place in case of an ANY command trigger or a specific one it's then possible to just hand them over the exact same set of info (object id, name, schema name).

Re: [HACKERS] Command Triggers, patch v11

2012-03-14 Thread Dimitri Fontaine
Robert Haas robertmh...@gmail.com writes: Also, when calling the user's procedure from the same place in case of an ANY command trigger or a specific one it's then possible to just hand them over the exact same set of info (object id, name, schema name). Yes, I think that's an essential

Re: [HACKERS] Command Triggers, patch v11

2012-03-13 Thread Andres Freund
Hi, I did a short review of what I found after merging master (b4af1c25bbc636379efc5d2ffb9d420765705b8a) to what I currently fetched from your repo (d63df64580114de4d83cfe8eb45eb630724b8b6f). - I still find it strange not to fire on cascading actions - I dislike the missing locking leading to

Re: [HACKERS] Command Triggers, patch v11

2012-03-13 Thread Alvaro Herrera
Excerpts from Andres Freund's message of mar mar 13 08:22:26 -0300 2012: - I think list_command_triggers should do a heap_lock_tuple(LockTupleShared) on the command trigger tuple. But then again just about nothing else does :( If you want to do something like that, I think it's probably more

Re: [HACKERS] Command Triggers, patch v11

2012-03-13 Thread Dimitri Fontaine
Hi, Andres Freund and...@anarazel.de writes: I did a short review of what I found after merging master Thanks! - I still find it strange not to fire on cascading actions We don't build statement for cascading so we don't fire command triggers. The user view is that there was no drop command

Re: [HACKERS] Command Triggers, patch v11

2012-03-13 Thread Andres Freund
On Tuesday, March 13, 2012 09:07:32 PM Dimitri Fontaine wrote: Hi, Andres Freund and...@anarazel.de writes: I did a short review of what I found after merging master Thanks! - I still find it strange not to fire on cascading actions We don't build statement for cascading so we

Re: [HACKERS] Command Triggers, patch v11

2012-03-13 Thread Robert Haas
On Tue, Mar 13, 2012 at 5:06 PM, Andres Freund and...@anarazel.de wrote: Generally, uppon rereading, I have to say that I am not very happy with the decision that ANY triggers are fired from other places than the specific triggers. That seams to be a rather dangerous/confusing route to me. I

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Thom Brown
On 9 March 2012 00:28, Thom Brown t...@linux.com wrote: On 8 March 2012 22:24, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: We're getting there. :) It was late last night and I forgot to get around to testing pg_dump, which isn't working correctly: -- -- Name:

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Robert Haas
On Wed, Mar 7, 2012 at 4:53 PM, Thom Brown t...@linux.com wrote: I've also since found that if I issue a VACUUM, CLUSTER or REINDEX on a read-only standby, the BEFORE ANY COMMAND trigger fires.  I don't think any trigger should fire on a read-only standby. Why ever not? -- Robert Haas

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Thom Brown
On 9 March 2012 14:09, Robert Haas robertmh...@gmail.com wrote: On Wed, Mar 7, 2012 at 4:53 PM, Thom Brown t...@linux.com wrote: I've also since found that if I issue a VACUUM, CLUSTER or REINDEX on a read-only standby, the BEFORE ANY COMMAND trigger fires.  I don't think any trigger should

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Robert Haas
On Fri, Mar 9, 2012 at 9:22 AM, Thom Brown t...@linux.com wrote: On 9 March 2012 14:09, Robert Haas robertmh...@gmail.com wrote: On Wed, Mar 7, 2012 at 4:53 PM, Thom Brown t...@linux.com wrote: I've also since found that if I issue a VACUUM, CLUSTER or REINDEX on a read-only standby, the

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Thom Brown
On 9 March 2012 14:30, Robert Haas robertmh...@gmail.com wrote: On Fri, Mar 9, 2012 at 9:22 AM, Thom Brown t...@linux.com wrote: On 9 March 2012 14:09, Robert Haas robertmh...@gmail.com wrote: On Wed, Mar 7, 2012 at 4:53 PM, Thom Brown t...@linux.com wrote: I've also since found that if I

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Robert Haas
On Fri, Mar 9, 2012 at 9:35 AM, Thom Brown t...@linux.com wrote: I see your point.  My suggestion to Dimitri in another email was either enable triggers for all commands or none.  At the moment it's only available on utility commands. Yeah, that's clearly not the best of all possible worlds.

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Thom Brown
On 9 March 2012 14:47, Robert Haas robertmh...@gmail.com wrote: On Fri, Mar 9, 2012 at 9:35 AM, Thom Brown t...@linux.com wrote: I see your point.  My suggestion to Dimitri in another email was either enable triggers for all commands or none.  At the moment it's only available on utility

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Mar 9, 2012 at 9:22 AM, Thom Brown t...@linux.com wrote: Sorry, I meant any command trigger.  It's because none of the commands can be run on a standby, so the triggers don't seem appropriate. I'm not convinced. Right now, it's fairly useless

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Thom Brown
On 9 March 2012 15:05, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Fri, Mar 9, 2012 at 9:22 AM, Thom Brown t...@linux.com wrote: Sorry, I meant any command trigger.  It's because none of the commands can be run on a standby, so the triggers don't seem

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Robert Haas
On Fri, Mar 9, 2012 at 10:05 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Fri, Mar 9, 2012 at 9:22 AM, Thom Brown t...@linux.com wrote: Sorry, I meant any command trigger.  It's because none of the commands can be run on a standby, so the triggers don't

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Dimitri Fontaine
Robert Haas robertmh...@gmail.com writes: I'm not convinced. Right now, it's fairly useless - all the triggers could possibly do is throw an error, and an error is going to get thrown anyway, so it's only a question of which error message the user will see. But we discussed before the idea

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Dimitri Fontaine
Robert Haas robertmh...@gmail.com writes: I think we had better look seriously at postponing this patch to 9.3. I understand why you're drawing that conclusion, but I don't think that's the best we can do here, by a long shot. Your reviewing is obviously moving things forward rapidly, but I

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Robert Haas
On Fri, Mar 9, 2012 at 12:51 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Robert Haas robertmh...@gmail.com writes: I think we had better look seriously at postponing this patch to 9.3. I understand why you're drawing that conclusion, but I don't think that's the best we can do here, by

Re: [HACKERS] Command Triggers, patch v11

2012-03-09 Thread Thom Brown
On 9 March 2012 21:38, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, Please find attached v15 of the patch, addressing all known issues apart from the trigger function argument passing style. Expect a new patch with that taken care of early next week.  (The github branch too, should

Re: [HACKERS] Command Triggers, patch v11

2012-03-08 Thread Dimitri Fontaine
Hi, Thom Brown t...@linux.com writes: The message returned by creating a command trigger after create index is still problematic: Fixed. I'm attaching an incremental patch here, the github branch is updated too. CREATE VIEW doesn't return schema: Fixed, and as an added bonus I fixed the

Re: [HACKERS] Command Triggers, patch v11

2012-03-08 Thread Thom Brown
On 8 March 2012 22:24, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: We're getting there. :) Hi, Thom Brown t...@linux.com writes: The message returned by creating a command trigger after create index is still problematic: Fixed.  I'm attaching an incremental patch here, the github

Re: [HACKERS] Command Triggers, patch v11

2012-03-07 Thread Thom Brown
On 6 March 2012 23:25, Thom Brown t...@linux.com wrote: On 6 March 2012 21:18, Thom Brown t...@linux.com wrote: On 6 March 2012 21:04, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: [CASCADE will not run the command triggers for cascaded objects] If these are all expected, does it in any way

Re: [HACKERS] Command Triggers, patch v11

2012-03-06 Thread Thom Brown
On 6 March 2012 21:04, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: [CASCADE will not run the command triggers for cascaded objects] If these are all expected, does it in any way compromise the effectiveness of DDL triggers in major use-cases? I don't think so.  When replicating the replica

Re: [HACKERS] Command Triggers, patch v11

2012-03-06 Thread Thom Brown
On 6 March 2012 21:18, Thom Brown t...@linux.com wrote: On 6 March 2012 21:04, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: [CASCADE will not run the command triggers for cascaded objects] If these are all expected, does it in any way compromise the effectiveness of DDL triggers in major

Re: [HACKERS] Command Triggers, patch v11

2012-03-05 Thread Dimitri Fontaine
Hi, Thanks for the extensive testing. I'm adding your tests to the regression suite, and keep wondering if you saw that lots of them were already covered? Did you try make installcheck? Thom Brown t...@linux.com writes: Creating a command trigger using ANY COMMAND results in oid, schemaname,

Re: [HACKERS] Command Triggers, patch v11

2012-03-05 Thread Andres Freund
On Monday, March 05, 2012 09:42:00 PM Dimitri Fontaine wrote: Still no command triggers firing for CREATE TABLE AS: Yes, Andres made CTAS a utility command, he didn't add the code that make them fire command triggers. I would expect his patch to get in first, so I don't expect him to be

Re: [HACKERS] Command Triggers, patch v11

2012-03-05 Thread Robert Haas
On Sat, Mar 3, 2012 at 2:25 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Kevin Grittner kevin.gritt...@wicourts.gov writes: Right.  What I thought I was agreeing with was the notion that you should need to specify more than the trigger name to drop the trigger.  Rather like how you can

Re: [HACKERS] Command Triggers, patch v11

2012-03-05 Thread Thom Brown
On 5 March 2012 20:42, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, Thanks for the extensive testing.  I'm adding your tests to the regression suite, and keep wondering if you saw that lots of them were already covered?  Did you try make installcheck? Yes, but I felt it better that I

Re: [HACKERS] Command Triggers, patch v11

2012-03-04 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: FWIW, I agree with Thom on this. If we do it as you suggest, I confidently predict that it will be less than a year before we seriously regret it. Given all the discussion around this, it's borderline insane to believe that the set of parameters to be

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Dimitri Fontaine
Robert Haas robertmh...@gmail.com writes:       CREATE COMMAND TRIGGER name ... properties ...;       DROP COMMAND TRIGGER name; full stop.  If you want to run the same trigger function on some more commands, add another trigger name. +1 +1. I suggested the same thing a while back.

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Thom Brown
On 3 March 2012 13:45, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Robert Haas robertmh...@gmail.com writes:       CREATE COMMAND TRIGGER name ... properties ...;       DROP COMMAND TRIGGER name; full stop.  If you want to run the same trigger function on some more commands, add another

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Dimitri Fontaine
Thom Brown t...@linux.com writes: And having tried building it, it appears to fail. Sorry about that, my compiler here was happy building the source (and I had been doing make clean install along the way) and make installcheck passed, here. Now fixed on my github's branch, including docs. I'll

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Dimitri Fontaine
Thom Brown t...@linux.com writes: problem. It was the DROP COMMAND TRIGGER statement that garnered comment, as it makes more sense to drop the entire trigger than individual commands for that trigger. What you're saying here is that a single command could have more than one command attached

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Thom Brown
On 3 March 2012 14:26, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thom Brown t...@linux.com writes: And having tried building it, it appears to fail. Sorry about that, my compiler here was happy building the source (and I had been doing make clean install along the way) and make

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Thom Brown
On 3 March 2012 14:34, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thom Brown t...@linux.com writes: problem.  It was the DROP COMMAND TRIGGER statement that garnered comment, as it makes more sense to drop the entire trigger than individual commands for that trigger. What you're saying

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Kevin Grittner
Thom Brown wrote: Dimitri Fontaine wrote: Thom Brown writes: problem. It was the DROP COMMAND TRIGGER statement that garnered comment, as it makes more sense to drop the entire trigger than individual commands for that trigger. What you're saying here is that a single command could have

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Thom Brown
On 3 March 2012 16:12, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Thom Brown  wrote: Dimitri Fontaine  wrote: Thom Brown  writes: problem. It was the DROP COMMAND TRIGGER statement that garnered comment, as it makes more sense to drop the entire trigger than individual commands for

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Kevin Grittner
Thom Brown wrote: Don't you mean shouldn't need to specify more than the trigger name? You are right, that's what I meant to say. -Kevin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Dimitri Fontaine
Kevin Grittner kevin.gritt...@wicourts.gov writes: Right. What I thought I was agreeing with was the notion that you should need to specify more than the trigger name to drop the trigger. Rather like how you can create a trigger AFTER INSERT OR UPDATE OR DELETE, but you don't need to specify

Re: [HACKERS] Command Triggers, patch v11

2012-03-03 Thread Thom Brown
On 3 March 2012 19:25, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Kevin Grittner kevin.gritt...@wicourts.gov writes: Right.  What I thought I was agreeing with was the notion that you should need to specify more than the trigger name to drop the trigger.  Rather like how you can create a

Re: [HACKERS] Command Triggers, patch v11

2012-03-02 Thread Thom Brown
On 2 March 2012 22:32, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, Please find attached v13 of the command trigger patch, fixing most of known items and rebased against master. Two important items remain to be done, but I figured I should keep you posted in the meantime. Thanks

Re: [HACKERS] Command Triggers, patch v11

2012-03-02 Thread Thom Brown
On 2 March 2012 23:33, Thom Brown t...@linux.com wrote: On 2 March 2012 22:32, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: test=# CREATE TABLE badname (id int, a int, b text); ERROR:  invalid relation name: badname test=# CREATE TABLE badname AS SELECT 1::int id, 1::int a, ''::text b;

Re: [HACKERS] Command Triggers, patch v11

2012-03-02 Thread Robert Haas
On Tue, Feb 28, 2012 at 10:09 AM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Tom Lane t...@sss.pgh.pa.us wrote: This seems over-complicated.  Triggers on tables do not have alterable properties, why should command triggers?  I vote for       CREATE COMMAND TRIGGER name ... properties

Re: [HACKERS] Command Triggers, patch v11

2012-03-02 Thread anara...@anarazel.de
anara...@anarazel.de and...@anarazel.de schrieb: Thom Brown t...@linux.com schrieb: On 2 March 2012 23:33, Thom Brown t...@linux.com wrote: On 2 March 2012 22:32, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: test=# CREATE TABLE badname (id int, a int, b text); ERROR:  invalid relation

Re: [HACKERS] Command Triggers, patch v11

2012-03-02 Thread Thom Brown
On 3 March 2012 00:08, Thom Brown t...@linux.com wrote: On 2 March 2012 23:33, Thom Brown t...@linux.com wrote: On 2 March 2012 22:32, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: test=# CREATE TABLE badname (id int, a int, b text); ERROR:  invalid relation name: badname test=# CREATE TABLE

Re: [HACKERS] Command Triggers, patch v11

2012-02-28 Thread Thom Brown
On 27 February 2012 19:37, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thom Brown t...@linux.com writes: CREATE COMMAND TRIGGER test_cmd_trg BEFORE CREATE SCHEMA,   CREATE OPERATOR,   CREATE COLLATION,   CREATE CAST EXECUTE PROCEDURE my_func(); I couldn't drop it completely unless I

Re: [HACKERS] Command Triggers, patch v11

2012-02-28 Thread Thom Brown
On 28 February 2012 11:43, Thom Brown t...@linux.com wrote: On 27 February 2012 19:37, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thom Brown t...@linux.com writes: CREATE COMMAND TRIGGER test_cmd_trg BEFORE CREATE SCHEMA,   CREATE OPERATOR,   CREATE COLLATION,   CREATE CAST EXECUTE

Re: [HACKERS] Command Triggers, patch v11

2012-02-28 Thread Tom Lane
Thom Brown t...@linux.com writes: Well the problem is that you can add commands to a trigger en masse, but you can only remove them one at a time. Couldn't we at least allow the removal of multiple commands at the same time? The docs you wrote suggest you can do this, but you can't. This

Re: [HACKERS] Command Triggers, patch v11

2012-02-28 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: This seems over-complicated. Triggers on tables do not have alterable properties, why should command triggers? I vote for CREATE COMMAND TRIGGER name ... properties ...; DROP COMMAND TRIGGER name; full stop. If you want to run the same

Re: [HACKERS] Command Triggers, patch v11

2012-02-28 Thread Thom Brown
On 28 February 2012 15:03, Tom Lane t...@sss.pgh.pa.us wrote: Thom Brown t...@linux.com writes: Well the problem is that you can add commands to a trigger en masse, but you can only remove them one at a time.  Couldn't we at least allow the removal of multiple commands at the same time?  The

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread Dimitri Fontaine
Thom Brown t...@linux.com writes: test=# CREATE TABLE badname AS SELECT 1::int id, 1::int a, ''::text b; SELECT 1 This doesn't even get picked up by ANY COMMAND. You won't believe it: CTAS is not implemented as a DDL. Andres did some work about that and sent a patch that received positive

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread Dimitri Fontaine
Thom Brown t...@linux.com writes: SELECT * INTO badname FROM goodname; Again, see Andres' patch about that. -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread Thom Brown
On 27 February 2012 19:19, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thom Brown t...@linux.com writes: test=# CREATE TABLE badname AS SELECT 1::int id, 1::int a, ''::text b; SELECT 1 This doesn't even get picked up by ANY COMMAND. You won't believe it:  CTAS is not implemented as a

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread Dimitri Fontaine
Thom Brown t...@linux.com writes: I've got a question regarding the function signatures required for command triggers, and apologies if it's already been discussed to death (I didn't see all the original conversations around this). These differ from regular trigger functions which don't

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread Dimitri Fontaine
Thom Brown t...@linux.com writes: CREATE COMMAND TRIGGER test_cmd_trg BEFORE CREATE SCHEMA, CREATE OPERATOR, CREATE COLLATION, CREATE CAST EXECUTE PROCEDURE my_func(); I couldn't drop it completely unless I specified all of those commands. Why? Because I couldn't find a nice enough

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread Andres Freund
On Monday, February 27, 2012 08:30:31 PM Thom Brown wrote: On 27 February 2012 19:19, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thom Brown t...@linux.com writes: test=# CREATE TABLE badname AS SELECT 1::int id, 1::int a, ''::text b; SELECT 1 This doesn't even get picked up by ANY

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread Tom Lane
Dimitri Fontaine dimi...@2ndquadrant.fr writes: Thom Brown t...@linux.com writes: I've got a question regarding the function signatures required for command triggers, and apologies if it's already been discussed to death (I didn't see all the original conversations around this). These differ

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: FWIW, I agree with Thom on this. If we do it as you suggest, I confidently predict that it will be less than a year before we seriously regret it. Given all the discussion around this, it's borderline insane to believe that the set of parameters to be

Re: [HACKERS] Command Triggers

2012-02-27 Thread Andres Freund
On Sunday, December 04, 2011 02:09:08 AM Andres Freund wrote: First, does anybody think it would be worth getting rid of the duplication from OpenIntoRel (formerly from execMain.c) in regard to DefineRelation()? I noticed that there already is some diversion between both. E.g. CREATE TABLE

Re: [HACKERS] Command Triggers

2012-02-27 Thread Tom Lane
Andres Freund and...@anarazel.de writes: Sorry for letting this slide. Is it worth adding this bit to OpenIntoRel? Not sure if there is danger in allowing anyone to create shared tables /* In all cases disallow placing user relations in pg_global */ if (tablespaceId ==

Re: [HACKERS] Command Triggers

2012-02-27 Thread Andres Freund
On Tuesday, February 28, 2012 12:30:36 AM Tom Lane wrote: Andres Freund and...@anarazel.de writes: Sorry for letting this slide. Is it worth adding this bit to OpenIntoRel? Not sure if there is danger in allowing anyone to create shared tables /* In all cases disallow placing

Re: [HACKERS] Command Triggers

2012-02-27 Thread Andres Freund
On Tuesday, February 28, 2012 12:30:36 AM Tom Lane wrote: Andres Freund and...@anarazel.de writes: Sorry for letting this slide. Is it worth adding this bit to OpenIntoRel? Not sure if there is danger in allowing anyone to create shared tables /* In all cases disallow placing

Re: [HACKERS] Command Triggers

2012-02-27 Thread Tom Lane
Andres Freund and...@anarazel.de writes: On Tuesday, February 28, 2012 12:30:36 AM Tom Lane wrote: Ugh ... if that's currently allowed, we definitely need to fix it. Btw, whats the danger youre seing? Well, I'm not sure that it would actively break anything, but we definitely meant to

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread Tom Lane
Andres Freund and...@anarazel.de writes: I refreshed the patch so it works again on current HEAD. Basically some trivial fixes and dfd26f9c5f371437f243249025863ea9911aacaa. The latter doesn't seem necessary to me after the changes, so I simply ditched it. Am I missing something? No, that

Re: [HACKERS] Command Triggers, patch v11

2012-02-27 Thread anara...@anarazel.de
Tom Lane t...@sss.pgh.pa.us schrieb: Andres Freund and...@anarazel.de writes: I refreshed the patch so it works again on current HEAD. Basically some trivial fixes and dfd26f9c5f371437f243249025863ea9911aacaa. The latter doesn't seem necessary to me after the changes, so I simply ditched

Re: [HACKERS] Command Triggers

2012-02-27 Thread Alvaro Herrera
Excerpts from Tom Lane's message of lun feb 27 20:54:41 -0300 2012: Andres Freund and...@anarazel.de writes: On Tuesday, February 28, 2012 12:30:36 AM Tom Lane wrote: Ugh ... if that's currently allowed, we definitely need to fix it. Btw, whats the danger youre seing? Well, I'm not

Re: [HACKERS] Command Triggers, patch v11

2012-02-26 Thread Dimitri Fontaine
Thanks for your further testing! Thom Brown t...@linux.com writes: Further testing reveals a problem with FTS configurations when using the example function provided in the docs: Could you send me your tests so that I add them to the proper regression test? I've been lazy on one or two object

Re: [HACKERS] Command Triggers, patch v11

2012-02-26 Thread Thom Brown
On 26 February 2012 14:12, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thanks for your further testing! Thom Brown t...@linux.com writes: Further testing reveals a problem with FTS configurations when using the example function provided in the docs: Could you send me your tests so that I

Re: [HACKERS] Command Triggers, patch v11

2012-02-26 Thread Thom Brown
On 26 February 2012 19:49, Thom Brown t...@linux.com wrote: On 26 February 2012 14:12, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thanks for your further testing! Thom Brown t...@linux.com writes: Further testing reveals a problem with FTS configurations when using the example function

Re: [HACKERS] Command Triggers, patch v11

2012-02-25 Thread Thom Brown
On 24 February 2012 23:43, Thom Brown t...@linux.com wrote: On 24 February 2012 23:01, Thom Brown t...@linux.com wrote: On 24 February 2012 22:39, Thom Brown t...@linux.com wrote: On 24 February 2012 22:32, Thom Brown t...@linux.com wrote: On 24 February 2012 22:04, Dimitri Fontaine

Re: [HACKERS] Command Triggers, patch v11

2012-02-25 Thread Thom Brown
On 25 February 2012 12:00, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: D'oh, just as I sent some more queries... Thom Brown t...@linux.com writes: Is there any reason why the list of commands that command triggers can be used with isn't in alphabetical order?  Also it appears to show Any

Re: [HACKERS] Command Triggers, patch v11

2012-02-25 Thread Thom Brown
On 25 February 2012 12:07, Thom Brown t...@linux.com wrote: On 25 February 2012 12:00, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: D'oh, just as I sent some more queries... Thom Brown t...@linux.com writes: Is there any reason why the list of commands that command triggers can be used

Re: [HACKERS] Command Triggers, patch v11

2012-02-25 Thread Thom Brown
On 25 February 2012 12:42, Thom Brown t...@linux.com wrote: On 25 February 2012 12:07, Thom Brown t...@linux.com wrote: On 25 February 2012 12:00, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: D'oh, just as I sent some more queries... Thom Brown t...@linux.com writes: Is there any reason

Re: [HACKERS] Command Triggers, patch v11

2012-02-25 Thread Thom Brown
On 25 February 2012 13:15, Thom Brown t...@linux.com wrote: On 25 February 2012 12:42, Thom Brown t...@linux.com wrote: On 25 February 2012 12:07, Thom Brown t...@linux.com wrote: On 25 February 2012 12:00, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: D'oh, just as I sent some more

Re: [HACKERS] Command Triggers, patch v11

2012-02-25 Thread Thom Brown
On 25 February 2012 13:28, Thom Brown t...@linux.com wrote: On 25 February 2012 13:15, Thom Brown t...@linux.com wrote: On 25 February 2012 12:42, Thom Brown t...@linux.com wrote: On 25 February 2012 12:07, Thom Brown t...@linux.com wrote: On 25 February 2012 12:00, Dimitri Fontaine

Re: [HACKERS] Command Triggers, patch v11

2012-02-25 Thread Thom Brown
On 25 February 2012 14:30, Thom Brown t...@linux.com wrote: On 25 February 2012 13:28, Thom Brown t...@linux.com wrote: On 25 February 2012 13:15, Thom Brown t...@linux.com wrote: On 25 February 2012 12:42, Thom Brown t...@linux.com wrote: On 25 February 2012 12:07, Thom Brown t...@linux.com

Re: [HACKERS] Command Triggers, patch v11

2012-02-25 Thread Thom Brown
On 25 February 2012 16:36, Thom Brown t...@linux.com wrote: On 25 February 2012 14:30, Thom Brown t...@linux.com wrote: On 25 February 2012 13:28, Thom Brown t...@linux.com wrote: On 25 February 2012 13:15, Thom Brown t...@linux.com wrote: On 25 February 2012 12:42, Thom Brown t...@linux.com

Re: [HACKERS] Command Triggers, patch v11

2012-02-24 Thread Thom Brown
On 24 February 2012 22:04, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, Please find attached the latest version of the command triggers patch, in context diff format, with support for 79 commands and documentation about why only those, and with some limitations explained. I also

Re: [HACKERS] Command Triggers, patch v11

2012-02-24 Thread Thom Brown
On 24 February 2012 22:32, Thom Brown t...@linux.com wrote: On 24 February 2012 22:04, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, Please find attached the latest version of the command triggers patch, in context diff format, with support for 79 commands and documentation about why

Re: [HACKERS] Command Triggers, patch v11

2012-02-24 Thread Thom Brown
On 24 February 2012 22:39, Thom Brown t...@linux.com wrote: On 24 February 2012 22:32, Thom Brown t...@linux.com wrote: On 24 February 2012 22:04, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, Please find attached the latest version of the command triggers patch, in context diff format,

Re: [HACKERS] Command Triggers, patch v11

2012-02-24 Thread Thom Brown
On 24 February 2012 23:01, Thom Brown t...@linux.com wrote: On 24 February 2012 22:39, Thom Brown t...@linux.com wrote: On 24 February 2012 22:32, Thom Brown t...@linux.com wrote: On 24 February 2012 22:04, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, Please find attached the latest

<    1   2   3   4   >