Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Pavel Golub
Hello, Andrew. You wrote: AC> On 6/2/2011 11:02 AM, Alvaro Herrera wrote: >> Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: >> Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course th

Re: [HACKERS] Estimating total amount of shared memory required by postmaster

2011-06-02 Thread Heikki Linnakangas
On 02.06.2011 21:58, Alexey Klyukin wrote: Hello, We've recently come across the task of estimating the size of shared memory required for PostgreSQL to start. This comes from the problem of validating postgresql.conf files (http://archives.postgresql.org/pgsql-hackers/2011-03/msg01831.php), i.e

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-02 Thread Noah Misch
On Fri, Jun 03, 2011 at 12:27:35AM -0400, Robert Haas wrote: > But in this case I really don't quite understand why you don't like > the proposed behavior. AIUI, the case we're talking about is a > function foo that takes, say, anyarray, and returns anyarray. > > Now, let us say we attempt to cal

Re: [HACKERS] how to get the max value in an array

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 10:52 PM, fanngyuan wrote: > hi guys: >    I'm using int[] in postgrsql to store int array. I want to get max value > of each row . While I can't find any function to get it(max function will > get max array in one column) . Even I could write a sql function to get the > max

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 8:25 PM, Noah Misch wrote: > I don't doubt that's usable, and folks would find the behavior of their > applications acceptable given that approach.  However, it's an arbitrary (from > the user's perspective) difference in behavior compared to the interaction of > polymorphic

Re: [HACKERS] Estimating total amount of shared memory required by postmaster

2011-06-02 Thread Alvaro Herrera
Excerpts from Tom Lane's message of jue jun 02 15:49:53 -0400 2011: > The results of such a test wouldn't be worth the electrons they're > written on anyway: you're ignoring the likelihood that two instances of > shared memory would overrun the kernel's SHMALL limit, when a single > instance would

Re: [HACKERS] storing TZ along timestamps

2011-06-02 Thread Jim Nasby
On Jun 2, 2011, at 7:48 PM, Jeff Davis wrote: > On Thu, 2011-06-02 at 20:28 -0400, Robert Haas wrote: >> But that doesn't seem like enough, because if someone adds '1 day', >> knowing the offset isn't sufficient to figure out the answer. You >> have to know where the DST boundary is. > > Good poi

[HACKERS] how to get the max value in an array

2011-06-02 Thread fanngyuan
hi guys: I'm using int[] in postgrsql to store int array. I want to get max value of each row . While I can't find any function to get it(max function will get max array in one column) . Even I could write a sql function to get the max value. I still think a native funtion is better . Can

Re: [HACKERS] vacuum and row type

2011-06-02 Thread Tom Lane
I wrote: > What I was thinking last night is that it'd be smart to move all this > logic into the typcache, instead of repeating all the work each time we > make the check. Attached is a proposed patch that does it that way. I haven't finished poking around to see if there are any other places be

Re: [HACKERS] Online base backup from the hot-standby

2011-06-02 Thread Jun Ishiduka
>>> I don't much like that approach. The standby would need to be able to >>> write the backup history file to the archive at the end of backup, and >>> we'd have to reintroduce the code to fetch it from archive and, when >>> streaming, from the master. At the moment, the archiver doesn't even run

[HACKERS] Re: patch review : Add ability to constrain backend temporary file space

2011-06-02 Thread Mark Kirkwood
On 03/06/11 12:33, Cédric Villemain wrote: 2011/6/2 Mark Kirkwood: On 01/06/11 09:24, Cédric Villemain wrote: * I am not sure it is better to add a fileSize like you did or use relationgetnumberofblock() when file is about to be truncated or unlinked, this way the seekPos should be enough to in

Re: [HACKERS] storing TZ along timestamps

2011-06-02 Thread Jeff Davis
On Thu, 2011-06-02 at 20:28 -0400, Robert Haas wrote: > But that doesn't seem like enough, because if someone adds '1 day', > knowing the offset isn't sufficient to figure out the answer. You > have to know where the DST boundary is. Good point, I guess the timezone itself needs to be stored. Tha

Re: [HACKERS] storing TZ along timestamps

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 3:02 PM, Jeff Davis wrote: > On Thu, 2011-06-02 at 18:46 +, Christopher Browne wrote: >> > 1. How would the time-zone be defined in this composite? Offset from GMT? >> > Timezone (well, link thereto) with all DST rules intact? Would "extract" >> > need to be modified to

Re: [HACKERS] patch review : Add ability to constrain backend temporary file space

2011-06-02 Thread Cédric Villemain
2011/6/2 Mark Kirkwood : > On 01/06/11 09:24, Cédric Villemain wrote: >> * I am not sure it is better to add a fileSize like you did or use >> relationgetnumberofblock() when file is about to be truncated or >> unlinked, this way the seekPos should be enough to increase the global >> counter. >> >

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-02 Thread Noah Misch
On Thu, Jun 02, 2011 at 06:56:02PM -0400, Tom Lane wrote: > Noah Misch writes: > > On Tue, May 24, 2011 at 02:00:54PM -0400, Noah Misch wrote: > >> I took your lack of any response as non-acceptance of the plan I outlined. > >> Alas, the wrong conclusion. I'll send a patch this week. > > > See a

Re: [HACKERS] Minor issues with docs

2011-06-02 Thread Bruce Momjian
Marco Nenciarini wrote: > While I was working on automatic translation of PostgreSQL's > documentation from SGML to XML, I found some minor issues. > > In the file doc/src/sgml/ecpg.sgml there are many lines of C code > containing unescaped '<' characters. > > In the file doc/src/sgml/array.sgml

Re: [HACKERS] pg_upgrade automatic testing

2011-06-02 Thread Bruce Momjian
Noah Misch wrote: > On Wed, May 25, 2011 at 10:07:45PM +0300, Peter Eisentraut wrote: > > On ons, 2011-04-27 at 18:14 -0400, Noah Misch wrote: > > > Enthusiastic +1 for this concept. There's at least one rough edge: it > > > fails if > > > you have another postmaster running on port 5432. > > >

Re: [HACKERS] Re: patch review : Add ability to constrain backend temporary file space

2011-06-02 Thread Mark Kirkwood
On 02/06/11 18:34, Jaime Casanova wrote: - the patch adds this to serial_schedule but no test has been added... diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule index bb654f9..325cb3d 100644 --- a/src/test/regress/serial_schedule +++ b/src/test/regress/serial_sc

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-02 Thread Tom Lane
Noah Misch writes: > On Tue, May 24, 2011 at 02:00:54PM -0400, Noah Misch wrote: >> I took your lack of any response as non-acceptance of the plan I outlined. >> Alas, the wrong conclusion. I'll send a patch this week. > See attached arrdom1v1-polymorphism.patch. This currently adds one syscach

Re: [HACKERS] Re: patch review : Add ability to constrain backend temporary file space

2011-06-02 Thread Mark Kirkwood
On 03/06/11 02:36, Tom Lane wrote: Robert Haas writes: So I'm not sure work_disk is a great name. I agree. Maybe something along the lines of "temp_file_limit"? Also, once you free yourself from the analogy to work_mem, you could adopt some more natural unit than KB. I'd think MB would be a

Re: 9.2 branch and 9.1beta2 timing (was Re: [HACKERS] InitProcGlobal cleanup)

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 5:35 PM, Kevin Grittner wrote: > Robert Haas wrote: > >> It appears that the open items list is a bit stale: >> >> http://wiki.postgresql.org/wiki/PostgreSQL_9.1_Open_Items >> >> The first item listed there is, I believe, fixed. > > That was "SSI HOT chain traversal issue"

Re: [HACKERS] SSI predicate locking on heap -- tuple or row?

2011-06-02 Thread Dan Ports
On Thu, Jun 02, 2011 at 01:01:05PM -0500, Kevin Grittner wrote: > If we're going to put this into the README-SSI as the proof of the > validity of this optimization, I'd like to have a footnote pointing > to a paper describing the "first commit in the cycle" aspect of a > dangerous structure. Got

Re: 9.2 branch and 9.1beta2 timing (was Re: [HACKERS] InitProcGlobal cleanup)

2011-06-02 Thread Kevin Grittner
Robert Haas wrote: > It appears that the open items list is a bit stale: > > http://wiki.postgresql.org/wiki/PostgreSQL_9.1_Open_Items > > The first item listed there is, I believe, fixed. That was "SSI HOT chain traversal issue" -- which was fixed. I just moved it to "Resolved Issues". >

Re: [HACKERS] ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

2011-06-02 Thread Thom Brown
On 8 February 2011 03:50, Robert Haas wrote: > On Thu, Feb 3, 2011 at 11:00 PM, Robert Haas wrote: >> On Fri, Jan 14, 2011 at 6:15 AM, Simon Riggs wrote: >>> Patch to implement the proposed feature attached, for CFJan2011. >>> >>> 2 sub-command changes: >>> >>> ALTER TABLE foo ADD FOREIGN KEY fk

Re: [HACKERS] SSI predicate locking on heap -- tuple or row?

2011-06-02 Thread Kevin Grittner
Heikki Linnakangas wrote: > On 30.05.2011 17:10, Kevin Grittner wrote: >> Heikki Linnakangas wrote: >>> * XXX: for an anomaly to occur, T2 must've committed >>> * before W. Couldn't we easily check that here, or does >>> * the fact that W committed already somehow imply it? >>

Re: 9.2 branch and 9.1beta2 timing (was Re: [HACKERS] InitProcGlobal cleanup)

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 4:42 PM, Tom Lane wrote: > Robert Haas writes: >> I'll commit this to 9.2 after we branch.  (When are we doing that, BTW?) > > Sometime in the next two weeks I guess ;-).  At the PGCon meeting we > said 1 June, but seeing that we still have a couple of open beta2 issues > I

Re: [HACKERS] BLOB support

2011-06-02 Thread Ross J. Reedstrom
On Thu, Jun 02, 2011 at 01:43:16PM -0400, Tom Lane wrote: > =?utf-8?q?Rados=C5=82aw_Smogura?= writes: > > Tom Lane Thursday 02 of June 2011 16:42:42 > >> Yes. I think the appropriate problem statement is "provide streaming > >> access to large field values, as an alternative to just fetching/sto

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-02 Thread Tom Lane
Robert Haas writes: > On Tue, May 24, 2011 at 2:54 PM, Tom Lane wrote: >> I'm starting to think that maybe we should separate the two cases after >> all.  If we force a downcast for ANYARRAY matching, we will fix the loss >> of functionality induced by the bug #5717 patch, and it doesn't seem >>

Re: [HACKERS] BLOB support

2011-06-02 Thread Tomas Vondra
Dne 2.6.2011 15:18, k...@rice.edu napsal(a): > On Thu, Jun 02, 2011 at 02:58:52PM +0200, Pavel Stehule wrote: >> 2011/6/2 Peter Eisentraut : >>> Superficially, this looks like a reimplementation of TOAST. What >>> functionality exactly do you envision that the BLOB and CLOB types would >>> need to

9.2 branch and 9.1beta2 timing (was Re: [HACKERS] InitProcGlobal cleanup)

2011-06-02 Thread Tom Lane
Robert Haas writes: > I'll commit this to 9.2 after we branch. (When are we doing that, BTW?) Sometime in the next two weeks I guess ;-). At the PGCon meeting we said 1 June, but seeing that we still have a couple of open beta2 issues I'm not in a hurry. I think a reasonable plan would be to f

Re: [HACKERS] BLOB support

2011-06-02 Thread Tomas Vondra
Dne 2.6.2011 15:49, Pavel Stehule napsal(a): > 2011/6/2 Pavel Golub : >> Hello, Pavel. >> >> You wrote: >> >> PS> 2011/6/2 Peter Eisentraut : On ons, 2011-06-01 at 22:00 +0200, Radosław Smogura wrote: > I partialy implemented following missing LOBs types. Requirement for this > was >>

Re: [HACKERS] InitProcGlobal cleanup

2011-06-02 Thread Tom Lane
Robert Haas writes: > OK, here's a version with more comments. Looks OK to me, assuming you've checked that the right number of PGPROCs are getting created (in particular the AV launcher is no longer accounted for explicitly). regards, tom lane -- Sent via pgsql-hackers

Re: [HACKERS] Identifying no-op length coercions

2011-06-02 Thread Noah Misch
Hi Alexey, On Thu, Jun 02, 2011 at 05:08:51PM +0300, Alexey Klyukin wrote: > Looks like this thread has silently died out. Is there an agreement on the > syntax and implementation part? We (CMD) have a customer, who is interested in > pushing this through, so, if we have a patch, I'd be happy to a

Re: [HACKERS] InitProcGlobal cleanup

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 3:13 PM, Tom Lane wrote: > Robert Haas writes: >> OK, here's a version with more comments. > > Looks OK to me, assuming you've checked that the right number of PGPROCs > are getting created (in particular the AV launcher is no longer > accounted for explicitly). That shoul

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-02 Thread Robert Haas
On Tue, May 24, 2011 at 2:54 PM, Tom Lane wrote: > "David E. Wheeler" writes: >> On May 24, 2011, at 11:30 AM, Tom Lane wrote: >>> I guess that the question that's immediately at hand is sort of a >>> variant of that, because using a polymorphic function declared to take >>> ANYARRAY on a domain-

Re: [HACKERS] BLOB support

2011-06-02 Thread Radosław Smogura
Tom Lane Thursday 02 of June 2011 19:43:16 > =?utf-8?q?Rados=C5=82aw_Smogura?= writes: > > Tom Lane Thursday 02 of June 2011 16:42:42 > > > >> Yes. I think the appropriate problem statement is "provide streaming > >> access to large field values, as an alternative to just fetching/storing > >>

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Tom Lane
Robert Haas writes: > On Wed, Jun 1, 2011 at 6:53 PM, Tom Lane wrote: >> Please note also that what pgpool users have got right now is a time >> bomb, which is not better than immediately-visible breakage.  I would >> prefer to try to get this change out ahead of widespread adoption of the >> bro

Re: [HACKERS] Estimating total amount of shared memory required by postmaster

2011-06-02 Thread Tom Lane
Alexey Klyukin writes: > We've recently come across the task of estimating the size of shared memory > required for PostgreSQL to start. > ... > - Try to actually allocate the shared memory in a way postmaster does this > nowadays, if the process fails - analyze the error code to check whether

Re: [HACKERS] storing TZ along timestamps

2011-06-02 Thread Merlin Moncure
On Thu, Jun 2, 2011 at 12:55 PM, Alvaro Herrera wrote: >> >> > One of our customers is interested in being able to store original >> >> > timezone along with a certain timestamp. >> >> >> >> I assume that you're talking about a new data type, not augmenting the >> >> current types, correct? >> > >

Re: [HACKERS] InitProcGlobal cleanup

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 1:53 PM, Tom Lane wrote: > Robert Haas writes: >> While working on my patch to reduce the overhead of frequent table >> locks, I had cause to monkey with InitProcGlobal() and noticed that >> it's sort of a mess.  For reasons that are not clear to me, it >> allocates one of

Re: [HACKERS] storing TZ along timestamps

2011-06-02 Thread Jeff Davis
On Fri, 2011-05-27 at 16:43 -0400, Alvaro Herrera wrote: > One of our customers is interested in being able to store original > timezone along with a certain timestamp. Another thing to consider is that this will eliminate any useful total order. You could define an arbitrary total order, of cour

[HACKERS] Re: patch review : Add ability to constrain backend temporary file space

2011-06-02 Thread Greg Stark
On Thu, Jun 2, 2011 at 7:36 AM, Tom Lane wrote: > Also, once you free yourself from the analogy to work_mem, you could > adopt some more natural unit than KB.  I'd think MB would be a practical > unit size, and would avoid (at least for the near term) the need to make > the parameter a float. As

Re: [HACKERS] storing TZ along timestamps

2011-06-02 Thread Christopher Browne
On Thu, Jun 2, 2011 at 6:06 PM, Steve Crawford wrote: > On 06/01/2011 05:18 PM, Alvaro Herrera wrote: >> >> Excerpts from Jeff Davis's message of mié jun 01 19:57:40 -0400 2011: >>> >>> On Fri, 2011-05-27 at 16:43 -0400, Alvaro Herrera wrote: Hi, One of our customers is interes

Re: [HACKERS] storing TZ along timestamps

2011-06-02 Thread Jeff Davis
On Thu, 2011-06-02 at 18:46 +, Christopher Browne wrote: > > 1. How would the time-zone be defined in this composite? Offset from GMT? > > Timezone (well, link thereto) with all DST rules intact? Would "extract" > > need to be modified to include the ability to grab the timezone? > > That does

[HACKERS] Estimating total amount of shared memory required by postmaster

2011-06-02 Thread Alexey Klyukin
Hello, We've recently come across the task of estimating the size of shared memory required for PostgreSQL to start. This comes from the problem of validating postgresql.conf files (http://archives.postgresql.org/pgsql-hackers/2011-03/msg01831.php), i.e. checking that the server will be able to st

Re: [HACKERS] Hacking gram.y Error syntax error at or near "MERGEJOIN"

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 11:17 AM, HuangQi wrote: > Hi, thanks a lot for your ideas. But I've done all these things. I've > checked the gram.y and kwlist.h files many times but can not find what's > wrong. So is there any possibility that the problem comes from something > after parser, though it se

Re: [HACKERS] SSI predicate locking on heap -- tuple or row?

2011-06-02 Thread Kevin Grittner
Dan Ports wrote: > On Wed, Jun 01, 2011 at 05:09:09PM -0500, Kevin Grittner wrote: >> Published papers have further proven that the transaction which >> appears to have executed last of these three must actually commit >> before either of the others for an anomaly to occur. > > We can actually

Re: [HACKERS] BLOB support

2011-06-02 Thread Tom Lane
=?utf-8?q?Rados=C5=82aw_Smogura?= writes: > Tom Lane Thursday 02 of June 2011 16:42:42 >> Yes. I think the appropriate problem statement is "provide streaming >> access to large field values, as an alternative to just fetching/storing >> the entire value at once". I see no good reason to import

Re: [HACKERS] storing TZ along timestamps

2011-06-02 Thread Alvaro Herrera
Excerpts from Merlin Moncure's message of mié jun 01 21:36:32 -0400 2011: > On Wed, Jun 1, 2011 at 8:18 PM, Alvaro Herrera > wrote: > > Excerpts from Jeff Davis's message of mié jun 01 19:57:40 -0400 2011: > >> On Fri, 2011-05-27 at 16:43 -0400, Alvaro Herrera wrote: > >> > Hi, > >> > > >> > One o

Re: [HACKERS] storing TZ along timestamps

2011-06-02 Thread Steve Crawford
On 06/01/2011 05:18 PM, Alvaro Herrera wrote: Excerpts from Jeff Davis's message of mié jun 01 19:57:40 -0400 2011: On Fri, 2011-05-27 at 16:43 -0400, Alvaro Herrera wrote: Hi, One of our customers is interested in being able to store original timezone along with a certain timestamp. I assume

[HACKERS] \d missing tab completion for composite types

2011-06-02 Thread Peter Eisentraut
Tab completion for \d currently does not complete composite types, even though \d works for composite types. That's easy to be fixed, but I have two more general questions: Since \d is happy to describe any kind of pg_class entry, should we also remove the relkind restriction in what tab-complete

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Tom Lane
Marko Kreen writes: > On Thu, Jun 2, 2011 at 7:20 PM, Andrew Dunstan wrote: >> Then maybe we need to use "#ifndef WIN32" in those places. That's what we do >> for similar cases. > No, that would be a bad idea - uglifies code for no good reason. > The function is referenced undef IS_AF_UNIX() ch

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Marko Kreen
On Thu, Jun 2, 2011 at 7:31 PM, Alvaro Herrera wrote: > Excerpts from Andrew Dunstan's message of jue jun 02 11:59:02 -0400 2011: >> On 06/02/2011 11:29 AM, Marko Kreen wrote: >> > As there was no going back now, I even touched msvc.pm. >> >> Why? Windows doesn't have Unix domain sockets at all. >

Re: [HACKERS] InitProcGlobal cleanup

2011-06-02 Thread Tom Lane
Robert Haas writes: > While working on my patch to reduce the overhead of frequent table > locks, I had cause to monkey with InitProcGlobal() and noticed that > it's sort of a mess. For reasons that are not clear to me, it > allocates one of the three PGPROC arrays using ShemInitStruct() and > th

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Marko Kreen
On Thu, Jun 2, 2011 at 7:44 PM, Tom Lane wrote: > Marko Kreen writes: >> On Thu, Jun 2, 2011 at 7:20 PM, Andrew Dunstan wrote: >>> Then maybe we need to use "#ifndef WIN32" in those places. That's what we do >>> for similar cases. > >> No, that would be a bad idea - uglifies code for no good rea

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Alvaro Herrera
Excerpts from Marko Kreen's message of jue jun 02 12:45:04 -0400 2011: > On Thu, Jun 2, 2011 at 7:31 PM, Alvaro Herrera > wrote: > > Excerpts from Andrew Dunstan's message of jue jun 02 11:59:02 -0400 2011: > >> On 06/02/2011 11:29 AM, Marko Kreen wrote: > >> > As there was no going back now, I ev

Re: [HACKERS] Hacking gram.y Error syntax error at or near "MERGEJOIN"

2011-06-02 Thread Alvaro Herrera
Excerpts from HuangQi's message of jue jun 02 11:17:21 -0400 2011: > Hi, thanks a lot for your ideas. But I've done all these things. I've > checked the gram.y and kwlist.h files many times but can not find what's > wrong. So is there any possibility that the problem comes from something > after pa

Re: [HACKERS] creating CHECK constraints as NOT VALID

2011-06-02 Thread Alvaro Herrera
Excerpts from Alvaro Herrera's message of mié jun 01 20:56:12 -0400 2011: > Excerpts from Thom Brown's message of mié jun 01 19:48:44 -0400 2011: > > > Is this expected? > > [ pg_dump fails to preserve not-valid status of constraints ] > > Certainly not. > > > Shouldn't the constraint be dumped

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Alvaro Herrera
Excerpts from Andrew Dunstan's message of jue jun 02 11:59:02 -0400 2011: > > On 06/02/2011 11:29 AM, Marko Kreen wrote: > > > > As there was no going back now, I even touched msvc.pm. > > Why? Windows doesn't have Unix domain sockets at all. So much for being thorough :-P -- Álvaro Herrera T

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Andrew Dunstan
On 06/02/2011 01:04 PM, Alvaro Herrera wrote: Excerpts from Marko Kreen's message of jue jun 02 12:45:04 -0400 2011: On Thu, Jun 2, 2011 at 7:31 PM, Alvaro Herrera wrote: Excerpts from Andrew Dunstan's message of jue jun 02 11:59:02 -0400 2011: On 06/02/2011 11:29 AM, Marko Kreen wrote: A

Re: [HACKERS] vacuum and row type

2011-06-02 Thread Tom Lane
Teodor Sigaev writes: >> I think we could just let this code assume success for type RECORD. It >> won't affect VACUUM/ANALYZE, since there are (for reasons that should >> now be obvious) no table or index columns of anonymous composite types. > Of course, it's impossible to store anonymous comp

[HACKERS] InitProcGlobal cleanup

2011-06-02 Thread Robert Haas
While working on my patch to reduce the overhead of frequent table locks, I had cause to monkey with InitProcGlobal() and noticed that it's sort of a mess. For reasons that are not clear to me, it allocates one of the three PGPROC arrays using ShemInitStruct() and the other two using ShmemAlloc().

Re: [HACKERS] Re: patch review : Add ability to constrain backend temporary file space

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 10:58 AM, Cédric Villemain wrote: > I am not specially attached to a name, idea was not to use work_disk > but backend_work_disk. I agree with you anyway, and suggestion from > Tom is fine for me (temp_file_limit). Yeah, I like that too. -- Robert Haas EnterpriseDB: http:

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Tom Lane
Marko Kreen writes: >> -1 ... why would you think that a conditional substitution is trouble? >> We have plenty of others. > Because it required touching autoconf. ;) > So now I did it. I hope it was that simple. Applied with minor adjustments --- notably, I didn't agree with removing the speci

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Marko Kreen
On Thu, Jun 2, 2011 at 6:59 PM, Andrew Dunstan wrote: > On 06/02/2011 11:29 AM, Marko Kreen wrote: >> As there was no going back now, I even touched msvc.pm. > > Why? Windows doesn't have Unix domain sockets at all. Because the function is still referenced in the code. -- marko -- Sent via pg

Re: [HACKERS] BLOB support

2011-06-02 Thread Radosław Smogura
Tom Lane Thursday 02 of June 2011 16:42:42 > Robert Haas writes: > > But these problems can be fixed without inventing a completely new > > system, I think. Or at least we should try. I can see the point of a > > data type that is really a pointer to a LOB, and the LOB gets deleted > > when the

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Marko Kreen
On Thu, Jun 2, 2011 at 7:20 PM, Andrew Dunstan wrote: > On 06/02/2011 12:04 PM, Marko Kreen wrote: >> On Thu, Jun 2, 2011 at 6:59 PM, Andrew Dunstan >>  wrote: >>> On 06/02/2011 11:29 AM, Marko Kreen wrote: As there was no going back now, I even touched msvc.pm. >>> >>> Why? Windows doesn't h

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Merlin Moncure
On Thu, Jun 2, 2011 at 10:57 AM, Alvaro Herrera wrote: > Excerpts from Merlin Moncure's message of jue jun 02 11:33:28 -0400 2011: >> On Thu, Jun 2, 2011 at 10:02 AM, Alvaro Herrera >> wrote: > >> > Seems pretty wasteful if you want to delete a single tuple from a large >> > result.  I think if y

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 10:47 AM, Tom Lane wrote: > Robert Haas writes: >> Ugh.  We are already stuck supporting all kinds of backward >> compatibility cruft in tablecmds.c as a result of the fact that you >> used to have to use ALTER TABLE to operate on views and sequences. >> The whole thing is

Re: [HACKERS] vacuum and row type

2011-06-02 Thread Teodor Sigaev
I think we could just let this code assume success for type RECORD. It won't affect VACUUM/ANALYZE, since there are (for reasons that should now be obvious) no table or index columns of anonymous composite types. Of course, it's impossible to store anonymous composite type anywhere, but we still

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Andrew Chernow
On 6/2/2011 11:02 AM, Alvaro Herrera wrote: Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course there's no big deal with their absence but let's be

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Tom Lane
Andrew Dunstan writes: > On 06/02/2011 12:04 PM, Marko Kreen wrote: >> On Thu, Jun 2, 2011 at 6:59 PM, Andrew Dunstan wrote: >>> On 06/02/2011 11:29 AM, Marko Kreen wrote: As there was no going back now, I even touched msvc.pm. >>> Why? Windows doesn't have Unix domain sockets at all. >> Bec

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Andrew Dunstan
On 06/02/2011 12:04 PM, Marko Kreen wrote: On Thu, Jun 2, 2011 at 6:59 PM, Andrew Dunstan wrote: On 06/02/2011 11:29 AM, Marko Kreen wrote: As there was no going back now, I even touched msvc.pm. Why? Windows doesn't have Unix domain sockets at all. Because the function is still referenced

Re: [HACKERS] BLOB support

2011-06-02 Thread Pavel Stehule
2011/6/2 Tom Lane : > Robert Haas writes: >> But these problems can be fixed without inventing a completely new >> system, I think.  Or at least we should try.  I can see the point of a >> data type that is really a pointer to a LOB, and the LOB gets deleted >> when the pointer is removed, but I d

Re: [HACKERS] Hacking gram.y Error syntax error at or near "MERGEJOIN"

2011-06-02 Thread HuangQi
Hi, thanks a lot for your ideas. But I've done all these things. I've checked the gram.y and kwlist.h files many times but can not find what's wrong. So is there any possibility that the problem comes from something after parser, though it seems it should comes from parser? On 2 June 2011 21:14, H

Re: [HACKERS] vacuum and row type

2011-06-02 Thread Tom Lane
Teodor Sigaev writes: >> isn't really specific to ANALYZE. I'm inclined to think that the most >> reasonable fix is to make get_sort_group_operators() and related > Hm, patch is in attach but it doesn't solve all problems. Initial bug is > still > here for array of row type, but when I tried t

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Merlin Moncure
On Thu, Jun 2, 2011 at 10:02 AM, Alvaro Herrera wrote: > Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: > >> > Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, >> > PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course >> > there's no big deal with

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Alvaro Herrera
Excerpts from Tom Lane's message of jue jun 02 11:10:00 -0400 2011: > Alvaro Herrera writes: > > Excerpts from Tom Lane's message of jue jun 02 10:31:58 -0400 2011: > >> That's a lot of work for a purely cosmetic issue, though. What would be > >> trivial is to let this work: > >> regression=# loc

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Andrew Dunstan
On 06/02/2011 11:29 AM, Marko Kreen wrote: As there was no going back now, I even touched msvc.pm. Why? Windows doesn't have Unix domain sockets at all. cheers andrew -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.p

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Alvaro Herrera
Excerpts from Merlin Moncure's message of jue jun 02 11:33:28 -0400 2011: > On Thu, Jun 2, 2011 at 10:02 AM, Alvaro Herrera > wrote: > > Seems pretty wasteful if you want to delete a single tuple from a large > > result.  I think if you desired to compact the result to free some > > memory after

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Marko Kreen
On Thu, Jun 2, 2011 at 5:49 PM, Tom Lane wrote: > Marko Kreen writes: >> Here's my attempt for it.  As conditional port module seems trouble, >> I set up an unconditional pgGetpeereid() that is always defined. > > -1 ... why would you think that a conditional substitution is trouble? > We have pl

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Pavel Golub
Hello, Alvaro. You wrote: AH> Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: >> > Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, >> > PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course >> > there's no big deal with their absence but let's be

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Alvaro Herrera
Excerpts from Tom Lane's message of jue jun 02 10:31:58 -0400 2011: > Robert Haas writes: > > On Wed, Jun 1, 2011 at 7:47 PM, Alvaro Herrera > > wrote: > >> Yeah -- why is LOCK SEQUENCE foo_seq not allowed? Seems a simple thing > >> to have. > > > It cause a grammar conflict. > > That's a lot o

Re: [HACKERS] vacuum and row type

2011-06-02 Thread Teodor Sigaev
isn't really specific to ANALYZE. I'm inclined to think that the most reasonable fix is to make get_sort_group_operators() and related Hm, patch is in attach but it doesn't solve all problems. Initial bug is still here for array of row type, but when I tried to change that with recursive call

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 10:31 AM, Tom Lane wrote: > Robert Haas writes: >> On Wed, Jun 1, 2011 at 7:47 PM, Alvaro Herrera >> wrote: >>> Yeah -- why is LOCK SEQUENCE foo_seq not allowed?  Seems a simple thing >>> to have. > >> It cause a grammar conflict. > > That's a lot of work for a purely cosm

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Tom Lane
Alvaro Herrera writes: > Excerpts from Tom Lane's message of jue jun 02 10:31:58 -0400 2011: >> That's a lot of work for a purely cosmetic issue, though. What would be >> trivial is to let this work: >> regression=# lock table s1; >> ERROR: "s1" is not a table > Yeah, though it'd be nice to avo

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Marko Kreen
On Wed, Jun 1, 2011 at 1:03 AM, Tom Lane wrote: > Marko Kreen writes: >> My suggestion would be to use getpeereid() everywhere. >> And just have compat getpeereid() implementation on non-BSD >> platforms.  This would minimize ifdeffery in core core. > > Hm, maybe.  I'd be for this if we had more

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Alvaro Herrera
Excerpts from Andrew Chernow's message of jue jun 02 10:12:40 -0400 2011: > > Andrew, why we have PQmakeEmptyPGresult, PQcopyResult, > > PQsetResultAttrs, PQsetvalue and PQresultAlloc in this case? Of course > > there's no big deal with their absence but let's be consistent. > > I'm not entirely

Re: [HACKERS] pg_listener in 9.0

2011-06-02 Thread Dave Page
On Wed, Jun 1, 2011 at 3:02 PM, Steve Singer wrote: > On 11-06-01 09:30 AM, Christopher Browne wrote: >> >> On Wed, Jun 1, 2011 at 8:29 AM, Dave Page  wrote: >>> >>> On Wed, Jun 1, 2011 at 12:27 PM, Andrew Dunstan >>>  wrote: The whole point of the revamp was that pg_listener was a major

Re: [HACKERS] Re: patch review : Add ability to constrain backend temporary file space

2011-06-02 Thread Cédric Villemain
2011/6/2 Robert Haas : > On Wed, Jun 1, 2011 at 7:35 PM, Mark Kirkwood > wrote: >> Done - 'work_disk' it is to match 'work_mem'. > > I guess I'm bikeshedding here, but I'm not sure I really buy this > parallel.  work_mem is primarily a query planner parameter; it says, > if you're going to need mo

Re: [HACKERS] Please test peer (socket ident) auth on *BSD

2011-06-02 Thread Tom Lane
Marko Kreen writes: > Here's my attempt for it. As conditional port module seems trouble, > I set up an unconditional pgGetpeereid() that is always defined. -1 ... why would you think that a conditional substitution is trouble? We have plenty of others. regards, tom lane

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Tom Lane
Robert Haas writes: > Ugh. We are already stuck supporting all kinds of backward > compatibility cruft in tablecmds.c as a result of the fact that you > used to have to use ALTER TABLE to operate on views and sequences. > The whole thing is confusing and a mess. [ shrug... ] I don't find it so.

Re: [HACKERS] BLOB support

2011-06-02 Thread Tom Lane
Robert Haas writes: > But these problems can be fixed without inventing a completely new > system, I think. Or at least we should try. I can see the point of a > data type that is really a pointer to a LOB, and the LOB gets deleted > when the pointer is removed, but I don't think that should req

Re: [HACKERS] Re: patch review : Add ability to constrain backend temporary file space

2011-06-02 Thread Tom Lane
Robert Haas writes: > So I'm not sure work_disk is a great name. I agree. Maybe something along the lines of "temp_file_limit"? Also, once you free yourself from the analogy to work_mem, you could adopt some more natural unit than KB. I'd think MB would be a practical unit size, and would avoi

Re: [HACKERS] Bad UI design: pg_ctl and data_directory

2011-06-02 Thread Robert Haas
On Wed, Jun 1, 2011 at 7:07 PM, Tom Lane wrote: > Alvaro Herrera writes: >> Excerpts from Robert Haas's message of mié jun 01 18:22:56 -0400 2011: >>> ISTM that it would be useful to run postgres in a mode where it >>> doesn't actually try to start up the database, but parses >>> postgresql.conf

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Andrew Chernow
AC> IMHO, this should be handled by the application. You could track tuples AC> removed in an int[] or copy the result set into an application defined AC> array of C structures. I've always been under the impression that AC> PGresult objects are immutable once delivered to the application. Andre

Re: [HACKERS] PQdeleteTuple function in libpq

2011-06-02 Thread Pavel Golub
Hello, Andrew. You wrote: AC> On 6/2/2011 4:28 AM, Pavel Golub wrote: >> Hello, Andrew. >> >> You wrote: >> >> AC> On 6/1/2011 11:43 AM, Pavel Golub wrote: Hello. I'm some kind of PQdeleteTuple function will be very usefull in libpq. Because right now after deleting some reco

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Tom Lane
Robert Haas writes: > On Wed, Jun 1, 2011 at 7:47 PM, Alvaro Herrera > wrote: >> Yeah -- why is LOCK SEQUENCE foo_seq not allowed?  Seems a simple thing >> to have. > It cause a grammar conflict. That's a lot of work for a purely cosmetic issue, though. What would be trivial is to let this wor

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Robert Haas
On Wed, Jun 1, 2011 at 6:53 PM, Tom Lane wrote: > Please note also that what pgpool users have got right now is a time > bomb, which is not better than immediately-visible breakage.  I would > prefer to try to get this change out ahead of widespread adoption of the > broken pgpool version. Hmm, I

Re: [HACKERS] pgpool versus sequences

2011-06-02 Thread Robert Haas
On Wed, Jun 1, 2011 at 7:47 PM, Alvaro Herrera wrote: > Excerpts from Tatsuo Ishii's message of mié jun 01 19:08:16 -0400 2011: >> What pgpool really wanted to do was locking sequence tables, not >> locking rows in sequences. I wonder why the former is not allowed. > > Yeah -- why is LOCK SEQUENCE

  1   2   >