Re: [HACKERS] Add socket dir to pg_config..?

2011-10-31 Thread Cédric Villemain
2011/10/30 Martijn van Oosterhout klep...@svana.org: On Sat, Oct 29, 2011 at 08:28:57PM +, Mr. Aaron W. Swenson wrote: If /tmp is the only decent place where to put the socket file on Unix when security and other concerns are considered, then sure, making distro life difficult is a good

Re: [HACKERS] unite recovery.conf and postgresql.conf

2011-10-31 Thread Fujii Masao
On Sat, Oct 29, 2011 at 7:54 PM, Simon Riggs si...@2ndquadrant.com wrote: On Fri, Sep 9, 2011 at 10:56 AM, Fujii Masao masao.fu...@gmail.com wrote: In previous discussion, we've reached the consensus that we should unite recovery.conf and postgresql.conf. The attached patch does that. The

[HACKERS] Clarification on item on Todo List

2011-10-31 Thread Tristan Wright
I am interested in this item on the list and its exact meaning: (Under Data Types) - Fix data types where equality comparison is not intuitive, e.g. box Can you elaborate on this item, I particularly fail to see what is non-intuitive about box comparisons (and I suppose other types where

Re: [HACKERS] unite recovery.conf and postgresql.conf

2011-10-31 Thread Simon Riggs
On Mon, Oct 31, 2011 at 7:38 AM, Fujii Masao masao.fu...@gmail.com wrote: In 9.2 the presence of recovery.conf can and therefore should continue to act as it does in 9.1. This means that recovery.conf is renamed to recovery.done at the end of recovery. IOW, all settings in recovery.conf are

Re: [HACKERS] Thoughts on SELECT * EXCLUDING (...) FROM ...?

2011-10-31 Thread Marcin Mańk
On Sun, Oct 30, 2011 at 8:50 PM, Eric Ridge eeb...@gmail.com wrote: Well, it's a display thing as much as any SELECT statement (especially via psql) is a display thing.  It's more like I want all 127 columns, except the giant ::xml column, and I'm too lazy to type each column name out by hand.

Re: [HACKERS] pgsql_fdw, FDW for PostgreSQL server

2011-10-31 Thread Pavel Stehule
2011/10/31 Shigeru Hanada shigeru.han...@gmail.com: (2011/10/30 11:34), Shigeru Hanada wrote: 2011/10/30 Tom Lanet...@sss.pgh.pa.us: I think we have to.  Even if we estimate that a given scan will return only a few rows, what happens if we're wrong?  We don't want to blow out memory on the

Re: [HACKERS] So, is COUNT(*) fast now?

2011-10-31 Thread Robert Haas
On Sun, Oct 30, 2011 at 8:02 AM, Kääriäinen Anssi anssi.kaariai...@thl.fi wrote: Table size is around 600MB, index size is around 350MB and VM on-disk size is 16kB with default fillfactor. With fillfactor = 10, the VM size is 104 KB, and table size is around 6GB.  The index size is the same.

Re: [HACKERS] Thoughts on SELECT * EXCLUDING (...) FROM ...?

2011-10-31 Thread Andrew Dunstan
On 10/30/2011 10:00 PM, Christopher Browne wrote: There is legitimate reason to reject this on the basis of nondeterminism. While we are surely obliged to hold our noses and support SELECT *, as: A) The SQL standard obliges us, and B) People already use it a lot, Neither of those factors

Re: [HACKERS] So, is COUNT(*) fast now?

2011-10-31 Thread Anssi Kääriäinen
On 10/31/2011 02:44 PM, Robert Haas wrote: What I think you're probably measuring here (oprofile would tell us for sure) is that once the size of the table goes beyond about half a gigabyte, it will have more than one page in the visibility map. The index-only scan code keeps the most recently

Re: [HACKERS] So, is COUNT(*) fast now?

2011-10-31 Thread Robert Haas
On Mon, Oct 31, 2011 at 9:51 AM, Anssi Kääriäinen anssi.kaariai...@thl.fi wrote: Stupid question, but why not keep the whole VM pinned? It might be that keeping more than one VM page pinned is a good idea, but we'd have to think carefully about it. For example, if we pin too many pages in

Re: [HACKERS] Clarification on item on Todo List

2011-10-31 Thread Tom Lane
Tristan Wright twrigh...@earlham.edu writes: I am interested in this item on the list and its exact meaning: (Under Data Types) - Fix data types where equality comparison is not intuitive, e.g. box Can you elaborate on this item, I particularly fail to see what is non-intuitive about box

[HACKERS] Multiple queries in transit

2011-10-31 Thread Mark Hills
We have a user interface which fetches and displays many small pieces of distinct information from a PostgreSQL database. * fetches are simple lookups across a diverse set of tables, in response to events on another data source * uses PQsendQuery() on a non-blocking socket But data fetches

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Heikki Linnakangas
On 31.10.2011 17:44, Mark Hills wrote: We have a user interface which fetches and displays many small pieces of distinct information from a PostgreSQL database. * fetches are simple lookups across a diverse set of tables, in response to events on another data source * uses PQsendQuery() on

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Marti Raudsepp
I have nothing of substance to add, but On Mon, Oct 31, 2011 at 17:44, Mark Hills mark.hi...@framestore.com wrote: Instead, it would be preferable to send multiple requests (down the TCP socket), and then receive multiple responses (in order). HTTP calls this pipelining. I think it's helpful

[HACKERS] warning in pg_upgrade

2011-10-31 Thread Kevin Grittner
I just noticed a warning in pg_upgrade: option.c: In function *parseCommandLine*: option.c:96:8: warning: ignoring return value of *getcwd*, declared with attribute warn_unused_result It looks like it might be worth testing the return value here for NULL, which would indicate an error

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 31.10.2011 17:44, Mark Hills wrote: Could libpq be reasonably modified to allow this? I believe it's doable in theory, no-one has just gotten around to it. Patches are welcome. Can't you do that today with a multi-command

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Heikki Linnakangas
On 31.10.2011 19:09, Tom Lane wrote: Heikki Linnakangasheikki.linnakan...@enterprisedb.com writes: On 31.10.2011 17:44, Mark Hills wrote: Could libpq be reasonably modified to allow this? I believe it's doable in theory, no-one has just gotten around to it. Patches are welcome. Can't you

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 12:09 PM, Tom Lane t...@sss.pgh.pa.us wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 31.10.2011 17:44, Mark Hills wrote: Could libpq be reasonably modified to allow this? I believe it's doable in theory, no-one has just gotten around to it.

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Mark Hills
On Mon, 31 Oct 2011, Tom Lane wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 31.10.2011 17:44, Mark Hills wrote: Could libpq be reasonably modified to allow this? I believe it's doable in theory, no-one has just gotten around to it. Patches are welcome.

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 12:49 PM, Mark Hills mark.hi...@framestore.com wrote: On Mon, 31 Oct 2011, Tom Lane wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 31.10.2011 17:44, Mark Hills wrote: Could libpq be reasonably modified to allow this? I believe it's doable

Re: [HACKERS] Your review of pg_receivexlog/pg_basebackup

2011-10-31 Thread Magnus Hagander
On Fri, Oct 28, 2011 at 08:46, Fujii Masao masao.fu...@gmail.com wrote: On Thu, Oct 27, 2011 at 11:14 PM, Magnus Hagander mag...@hagander.net wrote: Here's a version that does this. Turns out this requires a lot less code than what was previously in there, which is always nice. We still need

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 12:49 PM, Merlin Moncure mmonc...@gmail.com wrote: On Mon, Oct 31, 2011 at 12:09 PM, Tom Lane t...@sss.pgh.pa.us wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 31.10.2011 17:44, Mark Hills wrote: Could libpq be reasonably modified to allow

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 1:08 PM, Merlin Moncure mmonc...@gmail.com wrote: On Mon, Oct 31, 2011 at 12:49 PM, Merlin Moncure mmonc...@gmail.com wrote: On Mon, Oct 31, 2011 at 12:09 PM, Tom Lane t...@sss.pgh.pa.us wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 31.10.2011

Re: [HACKERS] unite recovery.conf and postgresql.conf

2011-10-31 Thread Josh Berkus
Simon, Everybody agrees a neater way of invoking standby mode would be good. I don't think this goes far enough. The whole recovery.conf/recovery.done thing is a serious problem for automated management of servers and automated failover. So it's not just a neater way would be good but using

[HACKERS] LDAP server docs

2011-10-31 Thread Magnus Hagander
So once again I forgot about the fact that you can specify multiple LDAP server in our ldapserver parameter (because both openldap and winldap accept a space separated list). Any objections to just applying the attached docs patch? --  Magnus Hagander  Me: http://www.hagander.net/  Work:

Re: [HACKERS] unite recovery.conf and postgresql.conf

2011-10-31 Thread Simon Riggs
On Mon, Oct 31, 2011 at 7:05 PM, Josh Berkus j...@agliodbs.com wrote: If it's possible to run a replica without having a recovery.conf file, then I'm fine with your solution.  If it's not, then I find your solution not to be a solution at all. Then you are fine with the solution - not mine

Re: [HACKERS] LDAP server docs

2011-10-31 Thread Robert Haas
On Mon, Oct 31, 2011 at 3:11 PM, Magnus Hagander mag...@hagander.net wrote: So once again I forgot about the fact that you can specify multiple LDAP server in our ldapserver parameter (because both openldap and winldap accept a space separated list). Any objections to just applying the

Re: [HACKERS] myProcLocks initialization

2011-10-31 Thread Robert Haas
On Sun, Oct 30, 2011 at 11:26 PM, Robert Haas robertmh...@gmail.com wrote: On Sun, Oct 30, 2011 at 11:13 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I'd like to propose the attached patch, which initializes each PGPROC's myProcLocks just once at postmaster

Re: [HACKERS] LDAP server docs

2011-10-31 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: So once again I forgot about the fact that you can specify multiple LDAP server in our ldapserver parameter (because both openldap and winldap accept a space separated list). Any objections to just applying the attached docs patch? space-separated

Re: [HACKERS] LDAP server docs

2011-10-31 Thread Magnus Hagander
On Mon, Oct 31, 2011 at 20:58, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: So once again I forgot about the fact that you can specify multiple LDAP server in our ldapserver parameter (because both openldap and winldap accept a space separated list). Any

Re: [HACKERS] myProcLocks initialization

2011-10-31 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Revised patch attached. I think it would be useful to assert this both at process startup time and at process shutdown, since it would really be much nicer to have the process that didn't clean up fail the assertion, rather than the new one that

Re: [HACKERS] myProcLocks initialization

2011-10-31 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: On Mon, Oct 31, 2011 at 7:54 PM, Robert Haas robertmh...@gmail.com wrote: Revised patch attached.  I think it would be useful to assert this both at process startup time and at process shutdown, since it would really be much nicer to have the process

Re: [HACKERS] myProcLocks initialization

2011-10-31 Thread Simon Riggs
On Mon, Oct 31, 2011 at 7:54 PM, Robert Haas robertmh...@gmail.com wrote: Revised patch attached.  I think it would be useful to assert this both at process startup time and at process shutdown, since it would really be much nicer to have the process that didn't clean up fail the assertion,

[HACKERS] Optimizing GetRunningTransactionLocks()

2011-10-31 Thread Simon Riggs
My list of things to do included optimising GetRunningTransactionLocks(), run once per checkpoint. I was thinking I needed to try harder to avoid acquiring LWlocks on all the lock partitions. ISTM that I don't need to do this - lwlocks on lock partitions are almost never contended now, so this

Re: [HACKERS] Optimizing GetRunningTransactionLocks()

2011-10-31 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: My list of things to do included optimising GetRunningTransactionLocks(), run once per checkpoint. I was thinking I needed to try harder to avoid acquiring LWlocks on all the lock partitions. ISTM that I don't need to do this - lwlocks on lock

[HACKERS] IDLE in transaction introspection

2011-10-31 Thread Scott Mead
Hey all, So, I'm dealing with a a big ol' java app that has multiple roads on the way to IDLE in transaction. We can reproduce the problem in a test environment, but the lead dev always asks can you just tell me the last query that it ran? So I wrote the attached patch, it just turns IDLE

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Dimitri Fontaine
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: I think a common use for this would be doing multiple inserts or updates on one go. Like, insert into a parent table, then more details into child tables. You don't care about getting the results back in that case, as long as you

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Magnus Hagander
On Mon, Oct 31, 2011 at 22:37, Scott Mead sco...@openscg.com wrote: Hey all,    So, I'm dealing with a a big ol' java app that has multiple roads on the way to IDLE in transaction.  We can reproduce the problem in a test environment, but the lead dev always asks can you just tell me the last

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Jaime Casanova
On Mon, Oct 31, 2011 at 4:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column, that holds the idle/in transaction/running status, instead of the tools having to parse the query text to get that information... if we are going

Re: [HACKERS] unite recovery.conf and postgresql.conf

2011-10-31 Thread Robert Treat
On Mon, Oct 31, 2011 at 3:19 PM, Simon Riggs si...@2ndquadrant.com wrote: On Mon, Oct 31, 2011 at 7:05 PM, Josh Berkus j...@agliodbs.com wrote: If it's possible to run a replica without having a recovery.conf file, then I'm fine with your solution.  If it's not, then I find your solution not

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Robert Haas
On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column, that holds the idle/in transaction/running status, instead of the tools having to parse the query text to get that information... +1 for doing it

Re: [HACKERS] Thoughts on SELECT * EXCLUDING (...) FROM ...?

2011-10-31 Thread Mark Mielke
On 10/31/2011 06:54 AM, Marcin Mańk wrote: On Sun, Oct 30, 2011 at 8:50 PM, Eric Ridgeeeb...@gmail.com wrote: Well, it's a display thing as much as any SELECT statement (especially via psql) is a display thing. It's more like I want all 127 columns, except the giant ::xml column, and I'm too

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Scott Mead
On Mon, Oct 31, 2011 at 6:13 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column, that holds the idle/in transaction/running status, instead of the

Re: [HACKERS] IDLE in transaction introspection

2011-10-31 Thread Scott Mead
On Mon, Oct 31, 2011 at 7:18 PM, Scott Mead sco...@openscg.com wrote: On Mon, Oct 31, 2011 at 6:13 PM, Robert Haas robertmh...@gmail.comwrote: On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander mag...@hagander.net wrote: Actually, for the future, it might be useful to have a state column,

Re: [HACKERS] psql expanded auto

2011-10-31 Thread Peter Eisentraut
I wrote: I have often found myself wanting that psql automatically switch between normal and \x mode depending on the width of the output. Would others find this useful? Attached is a crude demo patch. Enable with \pset expanded auto. Here is a finalized patch for this. The first hunk of

Re: [HACKERS] Your review of pg_receivexlog/pg_basebackup

2011-10-31 Thread Fujii Masao
On Tue, Nov 1, 2011 at 3:08 AM, Magnus Hagander mag...@hagander.net wrote: On Fri, Oct 28, 2011 at 08:46, Fujii Masao masao.fu...@gmail.com wrote: On Thu, Oct 27, 2011 at 11:14 PM, Magnus Hagander mag...@hagander.net wrote: Here's a version that does this. Turns out this requires a lot less

Re: [HACKERS] Multiple queries in transit

2011-10-31 Thread Jeroen Vermeulen
On 2011-11-01 00:53, Merlin Moncure wrote: On Mon, Oct 31, 2011 at 12:49 PM, Mark Hillsmark.hi...@framestore.com wrote: Furthermore, in most apps it'd be a serious PITA to keep track of which reply is for which query, so I doubt that such a feature is of general usefulness. In our UI case,

Re: [HACKERS]

2011-10-31 Thread Jeff Davis
On Sat, 2011-10-29 at 21:12 +0200, Erik Rijkers wrote: Would it be possible to remove of the double quotes in the daterange display of BC dates? select '[0001-10-29 BC,2011-10-29)'::daterange; daterange -- [0001-10-29 BC,2011-10-29) (1 row) It