Re: [HACKERS] pg_trgm

2010-05-28 Thread Peter Eisentraut
On fre, 2010-05-28 at 10:04 +0900, Tatsuo Ishii wrote: I think the problem at hand has nothing at all to do with agglutination or CJK-specific issues. You will get the same problem with other languages *if* you set a locale that does not adequately support the characters in use. E.g.,

[HACKERS] Patch submission deadline for CommitFest 2010-07

2010-05-28 Thread Fujii Masao
Hi, When is the patch submission deadline for CommitFest 2010-07? July 14? or June 14 (before review fest)? Sorry, I'm not sure what is actually different between CF and RF. Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center -- Sent via

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Heikki Linnakangas
On 27/05/10 22:55, Tom Lane wrote: Peter Eisentrautpete...@gmx.net writes: How about select myfunc(a := 7, b := 6); ? Hey, that's a thought. We couldn't have used that notation before because we didn't have := as a separate token, but since I hacked that in for plpgsql's benefit, I think it

Re: [HACKERS] Patch submission deadline for CommitFest 2010-07

2010-05-28 Thread Heikki Linnakangas
On 28/05/10 09:26, Fujii Masao wrote: When is the patch submission deadline for CommitFest 2010-07? July 14? or June 14 (before review fest)? Sorry, I'm not sure what is actually different between CF and RF. July 14. But if you finish the patch before June 14, it will get reviewed earlier,

Re: [HACKERS] Idea for getting rid of VACUUM FREEZE on cold pages

2010-05-28 Thread Heikki Linnakangas
On 27/05/10 22:56, Robert Haas wrote: On Thu, May 27, 2010 at 3:52 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Robert Haasrobertmh...@gmail.com wrote: On Thu, May 27, 2010 at 3:15 PM, Kevin Grittner (a) The tuples were written within the same transaction which created or

Re: [HACKERS] tsvector pg_stats seems quite a bit off.

2010-05-28 Thread Jan Urbański
On 28/05/10 04:47, Tom Lane wrote: =?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= wulc...@wulczer.org writes: On 19/05/10 21:01, Jesper Krogh wrote: In practice, just cranking the statistics estimate up high enough seems to solve the problem, but doesn't there seem to be something wrong in how the

Re: [HACKERS] Patch submission deadline for CommitFest 2010-07

2010-05-28 Thread Fujii Masao
On Fri, May 28, 2010 at 4:08 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 28/05/10 09:26, Fujii Masao wrote: When is the patch submission deadline for CommitFest 2010-07? July 14? or June 14 (before review fest)? Sorry, I'm not sure what is actually different between

[HACKERS] Failback with log shipping

2010-05-28 Thread Heikki Linnakangas
At PGCon, several people asked me about restarting an old master as a standby after failover has happened. And it wasn't the first time people ask me about it, even before 9.0. We have no mention of that in the docs, which is a pretty serious oversight. What can we say about it? I believe the

Re: [HACKERS] Working with PostgreSQL enums in C code

2010-05-28 Thread Robert Haas
On Fri, May 28, 2010 at 12:07 AM, Joseph Adams joeyadams3.14...@gmail.com wrote: I learned that to return an enum value from C, one needs to return the OID of the right row of the pg_enum table.  I eventually managed to write the code below, which is mostly based on the enum_in function in

Re: [HACKERS] mingw initdb failure on HEAD

2010-05-28 Thread Andrew Dunstan
Takahiro Itagaki wrote: Andrew Dunstan and...@dunslane.net wrote: Several buildfarm mingw members are getting failures like this, when running initdb: http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=dawn_batdt=2010-05-27%2019:45:18 Could it have been caused by the

[HACKERS] Re: [COMMITTERS] pgsql: Mark PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 with PGDLLEXPORT

2010-05-28 Thread Heikki Linnakangas
On 27/05/10 10:59, Takahiro Itagaki wrote: Log Message: --- Mark PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 with PGDLLEXPORT independently from BUILDING_DLL. It is always __declspec(dllexport). It looks like the Windows buildfarm members are not happy about this change... -- Heikki

Re: [HACKERS] Specification for Trusted PLs?

2010-05-28 Thread Sam Mason
On Thu, May 27, 2010 at 11:09:26PM -0400, Tom Lane wrote: David Fetter da...@fetter.org writes: I don't know about a *good* idea, but here's the one I've got. 1. Make a whitelist. This is what needs to work in order for a language to be a fully functional trusted PL. Well, I pretty

Re: [HACKERS] Specification for Trusted PLs?

2010-05-28 Thread Peter Eisentraut
On fre, 2010-05-28 at 13:03 +0100, Sam Mason wrote: That's not normally a problem. The conventional way would be to place the interpreter in its own sandbox, similar to how Chrome has each tab running in its own process. These processes are protected in a way so that the code running inside

Re: [HACKERS] Specification for Trusted PLs?

2010-05-28 Thread Andrew Dunstan
Sam Mason wrote: On Thu, May 27, 2010 at 11:09:26PM -0400, Tom Lane wrote: David Fetter da...@fetter.org writes: I don't know about a *good* idea, but here's the one I've got. 1. Make a whitelist. This is what needs to work in order for a language to be a fully functional

Re: [HACKERS] Failback with log shipping

2010-05-28 Thread Dimitri Fontaine
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Assuming controlled shutdown and that the standby received all WAL from the old master before it was promoted, I think you can simply create a recovery.conf in the old master's data directory to turn it into a standby server, and

Re: [HACKERS] Failback with log shipping

2010-05-28 Thread Heikki Linnakangas
On 28/05/10 16:11, Dimitri Fontaine wrote: Heikki Linnakangasheikki.linnakan...@enterprisedb.com writes: Assuming controlled shutdown and that the standby received all WAL from the old master before it was promoted, I think you can simply create a recovery.conf in the old master's data

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Peter Eisentrautpete...@gmx.net writes: How about select myfunc(a := 7, b := 6); If we go with that, should we make some preparations to allow = in the future? Like provide an alternative operator name for hstore's =, and add

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Bruce Momjian
Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: There are functions pg_stat_get_backend_client_addr and pg_stat_get_backend_client_port, which are exposed through the pg_stat_activity view, but there is no straightforward way to get the server-side address and port of a

Re: [HACKERS] Working with PostgreSQL enums in C code

2010-05-28 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, May 28, 2010 at 12:07 AM, Joseph Adams joeyadams3.14...@gmail.com wrote: I learned that to return an enum value from C, one needs to return the OID of the right row of the pg_enum table.  I eventually managed to write the code below, which is

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Pavel Stehule
2010/5/28 Tom Lane t...@sss.pgh.pa.us: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Peter Eisentrautpete...@gmx.net  writes: How about select myfunc(a := 7, b := 6); If we go with that, should we make some preparations to allow = in the future? Like provide an alternative

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Tom Lane wrote: ... indeed. Is it worth burdening the pg_stats mechanism with this? The use case seems vanishingly thin. I am confused how this is different from inet_server_addr() and inet_server_port(). I think the point is to let someone find out

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: ... indeed. Is it worth burdening the pg_stats mechanism with this? The use case seems vanishingly thin. I am confused how this is different from inet_server_addr() and inet_server_port(). I think the point

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Andrew Dunstan
Tom Lane wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Peter Eisentrautpete...@gmx.net writes: How about select myfunc(a := 7, b := 6); If we go with that, should we make some preparations to allow = in the future? Like provide an alternative

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Peter Eisentraut
On fre, 2010-05-28 at 10:21 -0400, Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: ... indeed. Is it worth burdening the pg_stats mechanism with this? The use case seems vanishingly thin. I am confused how this is different from

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Bruce Momjian
Peter Eisentraut wrote: On fre, 2010-05-28 at 10:21 -0400, Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: ... indeed. Is it worth burdening the pg_stats mechanism with this? The use case seems vanishingly thin. I am confused

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Josh Berkus
What's poor about it? It probably comes from PLSQL which in turn got it from Ada, so they aren't just making this up. I agree it's inconvenient for us, but that's a different issue. Further, the ( parameter := value ) notation is not only consistent with what is used inside pl/pgsql, it's

[HACKERS] How to pass around collation information

2010-05-28 Thread Peter Eisentraut
I have been thinking about this collation support business a bit. Ignoring for the moment where we would get the actual collation routines from, I wonder how we are going to pass this information around in the system. Someone declares a collation on a column in a table, and somehow this

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Bruce Momjian
Josh Berkus wrote: Since former SQL Server / Sybase apps are the most likely to use named parameter notation in PostgreSQL, having a syntax which could be ported using only sed would be nice. Relevant to the whole discussion, though ... is the conflicting SQL standard syntax something

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Andrew Dunstan
Bruce Momjian wrote: Josh Berkus wrote: Since former SQL Server / Sybase apps are the most likely to use named parameter notation in PostgreSQL, having a syntax which could be ported using only sed would be nice. Relevant to the whole discussion, though ... is the conflicting SQL

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread alvherre
Excerpts from Peter Eisentraut's message of vie may 28 12:27:52 -0400 2010: Option 2, invent some new mechanism that accompanies a datum or a type whereever it goes. Kind of like typmod, but not really. Then the collation information would presumably be made available to functions through

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Heikki Linnakangas
On 28/05/10 19:27, Peter Eisentraut wrote: I have been thinking about this collation support business a bit. Ignoring for the moment where we would get the actual collation routines from, I wonder how we are going to pass this information around in the system. Someone declares a collation on a

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Heikki Linnakangas
On 28/05/10 19:19, Josh Berkus wrote: ( parameter := value ) notation is not only consistent with what is used inside pl/pgsql, it's also more consistent than AS with SQL Server's named parameter notation, which is: EXEC dbo.GetItemPrice @ItemCode = 'GXKP', @PriceLevel = 5 Since former SQL

Re: [HACKERS] [BUGS] dividing money by money

2010-05-28 Thread Andy Balholm
I'm not quite sure how to go about changing it from an add-on function to a built-in one. So if you want to do that, go ahead. If you'd rather I did, just tell me how it's done. Andy Balholm (509) 276-2065 a...@balholm.com On May 26, 2010, at 11:18 AM, Kevin Grittner wrote: Hi Andy, Do

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Peter Eisentraut
On fre, 2010-05-28 at 20:22 +0300, Heikki Linnakangas wrote: It's also fundamentally wrong, collation is not a property of a datum but of the operation. One way to approach this is to realize that it's already possible to use multiple collations in a database. You just have to define

Re: [HACKERS] VPATH docs

2010-05-28 Thread Bruce Momjian
Patch applied. Thanks. --- David Fetter wrote: Folks, Andrew Dunstan posted some instructions on his blog, and I'm thinking they clarify things a great deal for people who want to learn how to do VPATH builds.

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: Since former SQL Server / Sybase apps are the most likely to use named parameter notation in PostgreSQL, having a syntax which could be ported using only sed would be nice. I fear you're vastly overestimating the ability of sed to distinguish between =

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: Yeah. Whether or not we ever implement it really doesn't matter, IMO. We should not be in the business of taking an SQL standard piece of syntax and using it for some other purpose. Evidently the 201x SQL standard has blindsided us twice: first by

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: So while it's true that the collation is used by the operations ( and ORDER BY), the information which collation to use comes with the data values. It's basically saying, a is in language de, so sort it like that unless told otherwise. There is also

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Robert Haas
On Fri, May 28, 2010 at 2:48 PM, Tom Lane t...@sss.pgh.pa.us wrote: Peter Eisentraut pete...@gmx.net writes: So while it's true that the collation is used by the operations ( and ORDER BY), the information which collation to use comes with the data values.  It's basically saying, a is in

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Robert Haas
On Fri, May 28, 2010 at 10:08 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2010/5/28 Tom Lane t...@sss.pgh.pa.us: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Peter Eisentrautpete...@gmx.net  writes: How about select myfunc(a := 7, b := 6); If we go with that, should

Re: [HACKERS] Failback with log shipping

2010-05-28 Thread Dimitri Fontaine
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Not shipped before the first failover you mean? No, if any WAL records were created in the old master that were not shipped to the standby before failover, the corresponding changes to the data files might've been flushed to disk

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Peter Eisentraut
On fre, 2010-05-28 at 15:03 -0400, Robert Haas wrote: I think we need to think of the comparison operators as ternary, and the COLLATE syntax applied to columns or present in queries as various ways of setting defaults or explicit overrides for what the third argument will end up being. How

Re: [HACKERS] [COMMITTERS] pgsql: PGDLLEXPORT is __declspec (dllexport) only on MSVC, but is

2010-05-28 Thread Tom Lane
itag...@postgresql.org (Takahiro Itagaki) writes: Log Message: --- PGDLLEXPORT is __declspec (dllexport) only on MSVC, but is __declspec (dllimport) on other compilers because cygwin and mingw don't like dllexport. That probably explains why the code was the way it was before ...

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Peter Eisentraut
On fre, 2010-05-28 at 14:48 -0400, Tom Lane wrote: SELECT * FROM test WHERE a COLLATE en 'baz' ORDER BY b COLLATE sv; That seems fairly bizarre. What does this mean: WHERE a COLLATE en b COLLATE de ? If it's an error, why is this not an error WHERE a COLLATE en b

Re: [HACKERS] functional call named notation clashes with SQL feature

2010-05-28 Thread Dimitri Fontaine
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 28/05/10 19:19, Josh Berkus wrote: EXEC dbo.GetItemPrice @ItemCode = 'GXKP', @PriceLevel = 5 Once you solve the problem of finding the '='s in the source, replacing them is exactly the same effort regardless of what you replace

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Dimitri Fontaine
Hi, Peter Eisentraut pete...@gmx.net writes: On fre, 2010-05-28 at 20:22 +0300, Heikki Linnakangas wrote: USING operator syntax). The behavior is exactly what we want, it's just completely inpractical, so we need something to do the same in a less cumbersome way. For an example, here is

Re: [HACKERS] tsvector pg_stats seems quite a bit off.

2010-05-28 Thread Jan Urbański
On 28/05/10 04:47, Tom Lane wrote: I re-scanned that paper and realized that there is indeed something wrong with the way we are doing it. The paper says (last sentence in the definition of the algorithm, section 4.2): When a user requests a list of items with threshold s, we output

Re: [HACKERS] [PATCH] Add SIGCHLD catch to psql

2010-05-28 Thread Tom Lane
Stephen Frost sfr...@snowman.net writes: * Tom Lane (t...@sss.pgh.pa.us) wrote: I thought it might be about that simple once you went at it the right way ;-). However, I'd suggest checking ferror(pset.queryFout) as well as the fflush result. Sure, I can add the ferror() check. Patch

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Robert Haas
On Fri, May 28, 2010 at 3:20 PM, Peter Eisentraut pete...@gmx.net wrote: On fre, 2010-05-28 at 15:03 -0400, Robert Haas wrote: I think we need to think of the comparison operators as ternary, and the COLLATE syntax applied to columns or present in queries as various ways of setting defaults or

Re: [HACKERS] tsvector pg_stats seems quite a bit off.

2010-05-28 Thread Tom Lane
=?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= wulc...@wulczer.org writes: We follow the algorithm as written, the trouble starts when we want to output the result. The paper says which items from the D structure should be returned when the user asks for items that have frequencies higher than a threshold

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Pavel Stehule
2010/5/28 alvherre alvhe...@commandprompt.com: Excerpts from Peter Eisentraut's message of vie may 28 12:27:52 -0400 2010: Option 2, invent some new mechanism that accompanies a datum or a type whereever it goes.  Kind of like typmod, but not really.  Then the collation information would

Re: [HACKERS] List traffic

2010-05-28 Thread Josh Berkus
On 5/27/10 5:42 PM, Tom Lane wrote: Josh Berkus j...@agliodbs.com writes: We do not have a problem. The lists are fine the way they are. +1 ... wasn't the point I thought you were trying to make, but I'm good with not changing things. Yeah, that's because I was responding to the

Re: [HACKERS] Failback with log shipping

2010-05-28 Thread Heikki Linnakangas
On 28/05/10 22:20, Dimitri Fontaine wrote: Heikki Linnakangasheikki.linnakan...@enterprisedb.com writes: Not shipped before the first failover you mean? No, if any WAL records were created in the old master that were not shipped to the standby before failover, the corresponding changes to the

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Heikki Linnakangas
On 28/05/10 23:15, Robert Haas wrote: On Fri, May 28, 2010 at 3:20 PM, Peter Eisentrautpete...@gmx.net wrote: On fre, 2010-05-28 at 15:03 -0400, Robert Haas wrote: I think we need to think of the comparison operators as ternary, and the COLLATE syntax applied to columns or present in queries

Re: [HACKERS] List traffic

2010-05-28 Thread Jaime Casanova
On Fri, May 28, 2010 at 3:44 PM, Josh Berkus j...@agliodbs.com wrote: On 5/27/10 5:42 PM, Tom Lane wrote: Josh Berkus j...@agliodbs.com writes: We do not have a problem.   The lists are fine the way they are. +1 ... wasn't the point I thought you were trying to make, but I'm good with not

Re: [HACKERS] How to pass around collation information

2010-05-28 Thread Martijn van Oosterhout
On Fri, May 28, 2010 at 10:32:34PM +0300, Peter Eisentraut wrote: On fre, 2010-05-28 at 14:48 -0400, Tom Lane wrote: SELECT * FROM test WHERE a COLLATE en 'baz' ORDER BY b COLLATE sv; That seems fairly bizarre. What does this mean: WHERE a COLLATE en b COLLATE de ? If

Re: [HACKERS] tsvector pg_stats seems quite a bit off.

2010-05-28 Thread Jan Urbański
On 28/05/10 22:22, Tom Lane wrote: The idea that I was toying with is to assume a Zipfian distribution of the input (with some reasonable parameter), and use that to estimate what the frequency of the K'th element will be, where K is the target number of MCV entries or perhaps a bit more.

Re: [HACKERS] psql's is_select_command is naive

2010-05-28 Thread Bruce Momjian
Robert Haas wrote: On Wed, May 26, 2010 at 10:35 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: It knows that queries beginning with select or values are select commands, but it seems not to be clued in about table and with. What we really ought to do

Re: [HACKERS] Clearing psql's input buffer after auto-reconnect

2010-05-28 Thread Bruce Momjian
Tom Lane wrote: We determined that $SUBJECT would be a good idea in this thread: http://archives.postgresql.org/pgsql-bugs/2010-05/msg00159.php I looked a bit at what it would take to make this happen. The difficulty is that the input buffer is a local variable in MainLoop(), and so are a

Re: [HACKERS] Exposing the Xact commit order to the user

2010-05-28 Thread Bruce Momjian
Jan Wieck wrote: Reading the entire WAL just to find all COMMIT records, then go back to the origin database to get the actual replication log you're looking for is simpler and more efficient? I don't think so. Agreed, but I think I've not explained myself well enough. I proposed

Re: [HACKERS] Exposing the Xact commit order to the user

2010-05-28 Thread Robert Haas
On May 28, 2010, at 7:19 PM, Bruce Momjian br...@momjian.us wrote: Jan Wieck wrote: Reading the entire WAL just to find all COMMIT records, then go back to the origin database to get the actual replication log you're looking for is simpler and more efficient? I don't think so. Agreed, but

Re: [HACKERS] small exclusion constraints patch

2010-05-28 Thread Bruce Momjian
Tom Lane wrote: Jeff Davis pg...@j-davis.com writes: Currently, the check for exclusion constraints performs a sanity check that's slightly too strict -- it assumes that a tuple will conflict with itself. That is not always the case: the operator might be , in which case it's perfectly

Re: [HACKERS] Failback with log shipping

2010-05-28 Thread Fujii Masao
On Fri, May 28, 2010 at 7:58 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: At PGCon, several people asked me about restarting an old master as a standby after failover has happened. And it wasn't the first time people ask me about it, even before 9.0. We have no mention of