Re: [HACKERS] Notes about fixing regexes and UTF-8 (yet again)

2012-02-17 Thread Tom Lane
I wrote: > The answer, on a reasonably new desktop machine (2.0GHz Xeon E5503) > running Fedora 16 in en_US.utf8 locale, is that 64K iterations of > pg_wc_isalpha or sibling functions requires a shade under 2ms. > So this definitely justifies caching the values to avoid computing > them more than o

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Don Baccus
On Feb 17, 2012, at 4:12 PM, Josh Berkus wrote: > On 2/17/12 12:04 PM, Robert Haas wrote: >> The argument isn't about whether the user made the right design >> choices; it's about whether he should be forced to insert an explicit >> type cast to get the query to do what it is unambiguously intend

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Josh Berkus
On 2/17/12 12:04 PM, Robert Haas wrote: > The argument isn't about whether the user made the right design > choices; it's about whether he should be forced to insert an explicit > type cast to get the query to do what it is unambiguously intended to > do. I don't find INTEGER LIKE '1%' to be unam

Re: [HACKERS] elog and MemoryContextSwitchTo

2012-02-17 Thread Tom Lane
Gaetano Mendola writes: > or do I have to ripristinate the oldContext before to issue the elog ? No. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-ha

[HACKERS] elog and MemoryContextSwitchTo

2012-02-17 Thread Gaetano Mendola
Hi all, Is the following code well formed? oldContext = MemoryContextSwitchTo(newContext); if (something_bad) { elog(ERROR, ...); } ... MemoryContextSwitchTo(oldContext); or do I have to ripristinate the oldContext before to issue the elog ? Regards Gaetano Mendola -- Sent via pgsq

Re: [HACKERS] Notes about fixing regexes and UTF-8 (yet again)

2012-02-17 Thread Tom Lane
Robert Haas writes: > On Fri, Feb 17, 2012 at 10:19 AM, Tom Lane wrote: >> Before going much further with this, we should probably do some timings >> of 64K calls of iswupper and friends, just to see how bad a dumb >> implementation will be. > Can't hurt. The answer, on a reasonably new desktop

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Jaime Casanova
On Fri, Feb 17, 2012 at 4:46 PM, Tom Lane wrote: > > Has anybody stopped to look at the SQL standard for this?  In-line > trigger definitions are actually what they intend, IIRC. > this is what i found there ::=   CREATE TRIGGER       ON [ REFERENCING ]       ::=   [ FOR EACH { ROW | ST

Re: [HACKERS] 16-bit page checksums for 9.2

2012-02-17 Thread Simon Riggs
On Thu, Feb 16, 2012 at 1:53 PM, Robert Haas wrote: > On Thu, Feb 16, 2012 at 6:16 AM, Simon Riggs wrote: >> v8 attached > > It's hard to believe that this version has been tested terribly > thoroughly, because it doesn't compile. I'm just back home from a few days off grid. It's possible it do

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Tom Lane
Dimitri Fontaine writes: > Tom Lane writes: >> Has anybody stopped to look at the SQL standard for this? In-line >> trigger definitions are actually what they intend, IIRC. > In which language? Do we need to include PL/PSM to be compliant, and > use that by default? Darn if I know. But let's

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Dimitri Fontaine
Tom Lane writes: > Has anybody stopped to look at the SQL standard for this? In-line > trigger definitions are actually what they intend, IIRC. In which language? Do we need to include PL/PSM to be compliant, and use that by default? In that case we might want to force people to spell out LANG

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Tom Lane
Andrew Dunstan writes: > On 02/17/2012 03:58 PM, Thom Brown wrote: >> On 17 February 2012 20:40, Dimitri Fontaine wrote: >>> I'm not so sure about other function properties (SET, COST, ROWS, >>> SECURITY DEFINER etc) because applying default and punting users to go >>> use the full CREATE FUNCTIO

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Thom Brown
On 17 February 2012 21:07, Andrew Dunstan wrote: > > > On 02/17/2012 03:58 PM, Thom Brown wrote: >> >> On 17 February 2012 20:40, Dimitri Fontaine >>  wrote: >>> >>> Thom Brown  writes: And thinking about it, DO is a bit nonsense here, so maybe we'd just have something like: >>

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Andrew Dunstan
On 02/17/2012 03:58 PM, Thom Brown wrote: On 17 February 2012 20:40, Dimitri Fontaine wrote: Thom Brown writes: And thinking about it, DO is a bit nonsense here, so maybe we'd just have something like: CREATE TRIGGER... AS $$ BEGIN END; $$; i.e. the same as a function. I like that. How

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Thom Brown
On 17 February 2012 20:40, Dimitri Fontaine wrote: > Thom Brown writes: >> And thinking about it, DO is a bit nonsense here, so maybe we'd just >> have something like: >> >> CREATE TRIGGER... >> AS $$ >> BEGIN >> END; >> $$; >> >> i.e. the same as a function. > > I like that.  How do you tell whi

Re: [HACKERS] Designing an extension for feature-space similarity search

2012-02-17 Thread Jay Levitt
Alexander Korotkov wrote: On Fri, Feb 17, 2012 at 11:32 PM, Jay Levitt Ah, yes, exactly the same problem. So what led you to add a flag instead of using the range NULL..NULL? I'm on the fence about choosing. At first, range bounds can't be NULL :) At second, if we have range (a;b)+"c

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Dimitri Fontaine
Thom Brown writes: > And thinking about it, DO is a bit nonsense here, so maybe we'd just > have something like: > > CREATE TRIGGER... > AS $$ > BEGIN > END; > $$; > > i.e. the same as a function. I like that. How do you tell which language the trigger is written in? I'm not so sure about other

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Andrew Dunstan
On 02/17/2012 02:52 PM, Robert Haas wrote: If we really believed that implicit casts any form were evil, we would have removed them entirely instead of trimming them back. I don't see why it's heretical to suggest that the 8.3 casting changes brought us to exactly that point in the universe w

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 2:44 PM, Andrew Dunstan wrote: > Strings of digits used that way should not be stored in numeric fields at > all, IMNSHO, just as zip codes and phone numbers should not be. They should > be text in the first place, and if the OP had done that he wouldn't have had > any diff

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Tom Lane
Andrew Dunstan writes: > Assuming we had the cast, What would "intval like '1%'" mean? You're > going to match 1, 10..19, 100..199, 1000..1999 ... > Now maybe there's a good use for such a test, but I'm have a VERY hard > time imagining what it might be. Yeah, that's another point worth asking

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 1:21 PM, Andrew Dunstan wrote: > Assuming we had the cast, What would "intval like '1%'" mean? You're going > to match 1, 10..19, 100..199, 1000..1999 ... Yep. > Now maybe there's a good use for such a test, but I'm have a VERY hard time > imagining what it might be. Dun

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Andrew Dunstan
On 02/17/2012 02:28 PM, Christopher Browne wrote: On Fri, Feb 17, 2012 at 1:21 PM, Andrew Dunstan wrote: Assuming we had the cast, What would "intval like '1%'" mean? You're going to match 1, 10..19, 100..199, 1000..1999 ... Now maybe there's a good use for such a test, but I'm have a VERY h

Re: [HACKERS] Designing an extension for feature-space similarity search

2012-02-17 Thread Alexander Korotkov
On Fri, Feb 17, 2012 at 11:32 PM, Jay Levitt wrote: > Alexander Korotkov wrote: > >> On Fri, Feb 17, 2012 at 11:00 PM, Jay Levitt > > wrote: >> >> At first I thought this posed a challenge for union; if I have these > points: > >> >>(1,2) >>(2,1) >>(1,

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Don Baccus
On Feb 17, 2012, at 11:28 AM, Christopher Browne wrote: > And I have *zero* confidence that for PostgreSQL to rule out "LIKE > '1%'" is preventing those designs from getting built... > > When confronted by a difficult problem, solve it by reducing it to the > question, "How would the Lone Ranger

Re: [HACKERS] Designing an extension for feature-space similarity search

2012-02-17 Thread Jay Levitt
Alexander Korotkov wrote: On Fri, Feb 17, 2012 at 11:00 PM, Jay Levitt mailto:jay.lev...@gmail.com>> wrote: At first I thought this posed a challenge for union; if I have these points: (1,2) (2,1) (1,NULL) what's the union? I think the answer is to treat NULL box coordina

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Christopher Browne
On Fri, Feb 17, 2012 at 1:21 PM, Andrew Dunstan wrote: > Assuming we had the cast, What would "intval like '1%'" mean? You're going > to match 1, 10..19, 100..199, 1000..1999 ... > > Now maybe there's a good use for such a test, but I'm have a VERY hard time > imagining what it might be. Well, I

Re: [HACKERS] Designing an extension for feature-space similarity search

2012-02-17 Thread Alexander Korotkov
On Fri, Feb 17, 2012 at 11:00 PM, Jay Levitt wrote: > Tom Lane wrote: > >> Jay Levitt writes: >> >>> - Does KNN-GiST run into problems when<-> returns values that don't >>> "make >>> >>> sense" in the physical world? >>> >> >> If the indexed entities are records, it would be >> entirely your ow

Re: [HACKERS] Simulating Clog Contention

2012-02-17 Thread Robert Haas
On Mon, Jan 30, 2012 at 12:26 PM, Robert Haas wrote: >> I was thinking the opposite.  That -i should only print progress >> indication when -d is given.  Or at least knock an order of magnitude >> or two off of how often it does so. > > I'd be in all in favor of having -i emit progress reports 10x

Re: [HACKERS] Designing an extension for feature-space similarity search

2012-02-17 Thread Jay Levitt
Tom Lane wrote: Jay Levitt writes: - Does KNN-GiST run into problems when<-> returns values that don't "make sense" in the physical world? If the indexed entities are records, it would be entirely your own business how you handled individual fields being NULL. This turns out to be a bit ch

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Jeff MacDonald
Greetings, > > My biggest concern is whether we > > might "paint ourselves into a corner" by including such an > > extension. It might shut off avenues for other cool features > > because anyone using the extension would have conflicts. Perhaps > > such a thing would be more appropriate on PGXN

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Andrew Dunstan
On 02/17/2012 12:59 PM, Robert Haas wrote: On Fri, Feb 17, 2012 at 12:14 PM, Tom Lane wrote: I don't know whether a similar improvement is possible in this area, but we're certainly not going to get there by labeling the user's expectations as unreasonable. I don't think they are, and the pe

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 12:14 PM, Tom Lane wrote: >> I don't know whether a similar improvement is >> possible in this area, but we're certainly not going to get there by >> labeling the user's expectations as unreasonable.  I don't think they >> are, and the people who wrote MySQL and Oracle evid

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Thom Brown
On 17 February 2012 17:26, Peter Eisentraut wrote: > On fre, 2012-02-17 at 13:22 +, Thom Brown wrote: >> So instead of >> >> CREATE TRIGGER... >> EXECUTE PROCEDURE functioname(); >> >> you'd have: >> >> CREATE TRIGGER... >> DO $$ >> ... >> $$; > > I had wished for this many times and was about

Re: [HACKERS] Command Triggers

2012-02-17 Thread Dimitri Fontaine
Robert Haas writes: > On Fri, Feb 17, 2012 at 10:42 AM, Dimitri Fontaine > wrote: >> Done.  Of course at the time the command trigger is created you can't >> distinguish if the CREATE INDEX command will be run CONCURRENTLY or not, >> so I've decided to issue a WARNING about it. > > That seems ick

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Pavel Stehule
2012/2/17 Kevin Grittner : > Robert Haas wrote: > >> As far as I know, the fact that LIKE is another spelling for ~~ is > a >> PostgreSQL implementation detail with which users ought not to be >> burdened. > > +1 > > LIKE is well defined by the standard, and the ~~ operator is not > mentioned ther

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Kevin Grittner
Robert Haas wrote: > As far as I know, the fact that LIKE is another spelling for ~~ is a > PostgreSQL implementation detail with which users ought not to be > burdened. +1 LIKE is well defined by the standard, and the ~~ operator is not mentioned there anywhere. On the other hand, LIKE is

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Peter Eisentraut
On fre, 2012-02-17 at 13:22 +, Thom Brown wrote: > So instead of > > CREATE TRIGGER... > EXECUTE PROCEDURE functioname(); > > you'd have: > > CREATE TRIGGER... > DO $$ > ... > $$; I had wished for this many times and was about to propose something similar. We might wish to review the SQL

Re: [HACKERS] Displaying accumulated autovacuum cost

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 5:04 AM, Fujii Masao wrote: > Here are review comments: > > The document about EXPLAIN needs to be updated. > > You forgot to add the long-integer-valued property of > shared/local_blks_dirtied. > So when I ran EXPLAIN and used json as a format, no information about > blks

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Tom Lane
Robert Haas writes: > I remember there was a time when you couldn't say "SELECT a x FROM > foo" in PostgreSQL. We told people that it was because our syntax was > more flexible - we have postfix operators, or something. Which it was, and yes that was the reason. We eventually thought of a kluge

Re: [HACKERS] Notes about fixing regexes and UTF-8 (yet again)

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 10:19 AM, Tom Lane wrote: >> What if you did this ONCE and wrote the results to a file someplace? > > That's still a cache, you've just defaulted on your obligation to think > about what conditions require the cache to be flushed. Yep. Unfortunately, I don't have a good i

Re: [HACKERS] Copyright notice for contrib/cube?

2012-02-17 Thread Tom Lane
Jay Levitt writes: > Marti Raudsepp wrote: >> Please don't add that, just change 2011 to 2012. This is what the wiki says: >> Q: May I add my own copyright notice where appropriate? > To clarify, this is for an extension to be distributed separately on PGXN > and GitHub, not for a contribution t

Re: [HACKERS] Command Triggers

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 10:42 AM, Dimitri Fontaine wrote: > Done.  Of course at the time the command trigger is created you can't > distinguish if the CREATE INDEX command will be run CONCURRENTLY or not, > so I've decided to issue a WARNING about it. That seems icky. Whatever warnings need to b

Re: [HACKERS] Command Triggers

2012-02-17 Thread Dimitri Fontaine
Dimitri Fontaine writes: I think it would be better to bail on trying to use CREATE TRIGGER and DROP TRIGGER as a basis for this functionality, and instead create completely new toplevel statements CREATE COMMAND TRIGGER and DROP COMMAND TRIGGER.  Then, you could decide that al

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Andrew Dunstan
On 02/17/2012 11:46 AM, Thom Brown wrote: On 17 February 2012 16:43, Andrew Dunstan wrote: On 02/17/2012 11:29 AM, David E. Wheeler wrote: On Feb 17, 2012, at 5:22 AM, Thom Brown wrote: The purpose being to only have a single statement to set up the trigger rather than setting up a separa

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 10:27 AM, Tom Lane wrote: > Robert Haas writes: >> I understand why it's a bad idea to rely on integer = text doing >> anything sane - is that text equality or numeric equality? > >> And in theory the same issue could exist here if there were another >> meaning for LIKE.  

Re: [HACKERS] Copyright notice for contrib/cube?

2012-02-17 Thread Jay Levitt
Marti Raudsepp wrote: On Fri, Feb 17, 2012 at 17:42, Jay Levitt wrote: Should it be something like Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group Portions Copyright (c) 2012, TipTap Inc. Please don't add that, just change 2011 to 2012. This is what the wiki says: Q: M

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Thom Brown
On 17 February 2012 16:43, Andrew Dunstan wrote: > > > On 02/17/2012 11:29 AM, David E. Wheeler wrote: >> >> On Feb 17, 2012, at 5:22 AM, Thom Brown wrote: >> >>> The purpose being to only have a single statement to set up the >>> trigger rather than setting up a separate trigger function which wi

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Thom Brown
On 17 February 2012 16:29, David E. Wheeler wrote: > On Feb 17, 2012, at 5:22 AM, Thom Brown wrote: > >> The purpose being to only have a single statement to set up the >> trigger rather than setting up a separate trigger function which will >> unlikely be re-used by other triggers... or is this o

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread Andrew Dunstan
On 02/17/2012 11:29 AM, David E. Wheeler wrote: On Feb 17, 2012, at 5:22 AM, Thom Brown wrote: The purpose being to only have a single statement to set up the trigger rather than setting up a separate trigger function which will unlikely be re-used by other triggers... or is this of dubious b

Re: [HACKERS] Copyright notice for contrib/cube?

2012-02-17 Thread Marti Raudsepp
On Fri, Feb 17, 2012 at 17:42, Jay Levitt wrote: > Should it be something like > > Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group > Portions Copyright (c) 2012, TipTap Inc. Please don't add that, just change 2011 to 2012. This is what the wiki says: Q: May I add my own cop

Re: [HACKERS] Triggers with DO functionality

2012-02-17 Thread David E. Wheeler
On Feb 17, 2012, at 5:22 AM, Thom Brown wrote: > The purpose being to only have a single statement to set up the > trigger rather than setting up a separate trigger function which will > unlikely be re-used by other triggers... or is this of dubious > benefit? +1, though I imagine it would just g

[HACKERS] Copyright notice for contrib/cube?

2012-02-17 Thread Jay Levitt
I'm basing an extension off contrib/cube. I'm going to open-source it under the existing PostgreSQL license, but I'm not sure how the copyright notice should look - there isn't one at the moment. (In fact, there's no LICENSE or COPYRIGHT file at all.) Should it be something like Portions Copy

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Tom Lane
Robert Haas writes: > I understand why it's a bad idea to rely on integer = text doing > anything sane - is that text equality or numeric equality? > And in theory the same issue could exist here if there were another > meaning for LIKE. But there isn't. Really? LIKE is just a different spelli

Re: [HACKERS] Notes about fixing regexes and UTF-8 (yet again)

2012-02-17 Thread Tom Lane
Robert Haas writes: > On Fri, Feb 17, 2012 at 3:48 AM, Heikki Linnakangas > wrote: >> Recompiling is expensive, but if you cache the results for the session, it >> would probably be acceptable. > What if you did this ONCE and wrote the results to a file someplace? That's still a cache, you've j

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 2:45 AM, Heikki Linnakangas wrote: > Of course, the best fix would be to change your queries. It's quite sloppy > to rely on "integer LIKE text" without an explicit cast in the query. Why? I understand why it's a bad idea to rely on integer = text doing anything sane - is

Re: [HACKERS] Notes about fixing regexes and UTF-8 (yet again)

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 3:48 AM, Heikki Linnakangas wrote: > Here's a wild idea: keep the class of each codepoint in a hash table. > Initialize it with all codepoints up to 0x. After that, whenever a > string contains a character that's not in the hash table yet, query the > class of that char

Re: [HACKERS] Notes about fixing regexes and UTF-8 (yet again)

2012-02-17 Thread Andrew Dunstan
On 02/17/2012 09:39 AM, Tom Lane wrote: Heikki Linnakangas writes: Here's a wild idea: keep the class of each codepoint in a hash table. Initialize it with all codepoints up to 0x. After that, whenever a string contains a character that's not in the hash table yet, query the class of that

Re: [HACKERS] Notes about fixing regexes and UTF-8 (yet again)

2012-02-17 Thread Tom Lane
Heikki Linnakangas writes: > Here's a wild idea: keep the class of each codepoint in a hash table. > Initialize it with all codepoints up to 0x. After that, whenever a > string contains a character that's not in the hash table yet, query the > class of that character, and add it to the hash

Re: [HACKERS] Command Triggers

2012-02-17 Thread Marko Kreen
On Fri, Feb 17, 2012 at 4:04 PM, Dimitri Fontaine wrote: > Marko Kreen writes: >> Btw, we already have a GUC for triggers: session_replication_role, >> how will the command triggers follow that? > > Note that the replica here in my mind would have been an Hot Standby > node, and having the standb

Re: [HACKERS] Command Triggers

2012-02-17 Thread Robert Haas
On Fri, Feb 17, 2012 at 3:54 AM, Dimitri Fontaine wrote: > Robert Haas writes: >>> Wait, we already have ALTER TRIGGER bob ON ANY COMMAND SET DISABLED; >> >> Eh, so what happens then if someone sets a command trigger on ALTER TRIGGER? > > We should remove support for command triggers on alter com

Re: [HACKERS] Command Triggers

2012-02-17 Thread Dimitri Fontaine
Marko Kreen writes: > Btw, we already have a GUC for triggers: session_replication_role, > how will the command triggers follow that? Note that the replica here in my mind would have been an Hot Standby node, and having the standby run the replica/always command triggers is not implemented yet, b

Re: [HACKERS] Command Triggers

2012-02-17 Thread Marko Kreen
On Fri, Feb 17, 2012 at 10:54 AM, Dimitri Fontaine wrote: > Robert Haas writes: >>> Wait, we already have ALTER TRIGGER bob ON ANY COMMAND SET DISABLED; >> >> Eh, so what happens then if someone sets a command trigger on ALTER TRIGGER? > > We should remove support for command triggers on alter co

Re: [HACKERS] Command Triggers

2012-02-17 Thread Dimitri Fontaine
Alvaro Herrera writes: > I didn't like the new cmdtrigger.h file. It's included by a lot of > other headers, and it's also itself including execnodes.h and It turns around that this file does not need including execnode.h, I've cleaned that up now (compile ok, make installcheck ok). Regards, --

[HACKERS] Triggers with DO functionality

2012-02-17 Thread Thom Brown
Hi, This may have already been discussed before, but I can't find any mention of it. Would it be desirable to add support for triggers that contain their own anonymous functions (i.e. DO)? So instead of CREATE TRIGGER... EXECUTE PROCEDURE functioname(); you'd have: CREATE TRIGGER... DO $$ ...

Re: [HACKERS] Command Triggers

2012-02-17 Thread Dimitri Fontaine
Alvaro Herrera writes: > ... after looking at it more closely, I think only this line needs to be > in a separate file: > > typedef struct CommandContextData *CommandContext; Files like src/backend/commands/tablecmds.c and others need both the structure and the pointer, so we need both. What abou

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread Andrew Dunstan
On 02/17/2012 04:22 AM, premanand wrote: Hi, Thanks for the reply. It is not possible to change the query in our environment. So we need to do casting. I'm a new bee, so it will be more helpful if you give me some simple examples. That's not what this list is for, You should be asking in pg

Re: [HACKERS] pgsql_fdw, FDW for PostgreSQL server

2012-02-17 Thread Albe Laurenz
Shigeru Hanada wrote: >> - Since a rescan is done by rewinding the cursor, is it necessary >>to have any other remote isolation level than READ COMMITED? >>There is only one query issued per transaction. > > If multiple foreign tables on a foreign server is used in a local query, > multipl

Re: [HACKERS] Displaying accumulated autovacuum cost

2012-02-17 Thread Fujii Masao
On Sat, Nov 26, 2011 at 10:10 AM, Robert Haas wrote: > On Fri, Nov 25, 2011 at 11:39 AM, Alvaro Herrera > wrote: >> I'm going to push this now anyway, thanks. > > This patch adds a count of the number of buffers dirtied to VACUUM, > but it strikes me that it would be useful to add similar trackin

Re: [HACKERS] MySQL search query is not executing in Postgres DB

2012-02-17 Thread premanand
Hi, Thanks for the reply. It is not possible to change the query in our environment. So we need to do casting. I'm a new bee, so it will be more helpful if you give me some simple examples. -- View this message in context: http://postgresql.1045698.n5.nabble.com/MySQL-search-query-is-not-executi

Re: Scaling XLog insertion (was Re: [HACKERS] Moving more work outside WALInsertLock)

2012-02-17 Thread Heikki Linnakangas
On 16.02.2012 13:31, Fujii Masao wrote: On Thu, Feb 16, 2012 at 6:15 PM, Fujii Masao wrote: BTW, when I ran the test on my Ubuntu, I could not reproduce the problem. I could reproduce the problem only in MacOS. + nextslot = Insert->nextslot; + if (NextSlotNo(nextslot) == lastslot)

Re: [HACKERS] Command Triggers

2012-02-17 Thread Dimitri Fontaine
Robert Haas writes: >> Wait, we already have ALTER TRIGGER bob ON ANY COMMAND SET DISABLED; > > Eh, so what happens then if someone sets a command trigger on ALTER TRIGGER? We should remove support for command triggers on alter command triggers. Well I could also go with the GUC idea, it's only t

Re: [HACKERS] Notes about fixing regexes and UTF-8 (yet again)

2012-02-17 Thread Heikki Linnakangas
On 16.02.2012 01:06, Tom Lane wrote: In bug #6457 it's pointed out that we *still* don't have full functionality for locale-dependent regexp behavior with UTF8 encoding. The reason is that there's old crufty code in regc_locale.c that only considers character codes up to 255 when searching for ch

Re: [HACKERS] Bug in intarray?

2012-02-17 Thread Guillaume Lelarge
On Thu, 2012-02-16 at 19:27 -0500, Tom Lane wrote: > Guillaume Lelarge writes: > > This query: > > SELECT ARRAY[-1,3,1] & ARRAY[1, 2]; > > should give {1} as a result. > > > But, on HEAD (and according to his tests, on 9.0.6 and 9.1.2), it > > appears to give en empty array. > > Definitely a b

Re: [HACKERS] Regex code versus Unicode chars beyond codepoint 255

2012-02-17 Thread David Smith
on 2010-11-24 at 15:56, Tom Lane wrote: > Bug #5766 points out that we're still not there yet in terms of having > sane behavior for locale-specific regex operations in Unicode > encoding. The reason it's not working is that regc_locale does this to > expand the set of characters that are conside