Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Andrew Chernow
On 6/3/2011 10:26 PM, Andrew Chernow wrote: I disagree -- I think the fix is a one-liner. line 446: if (tup_num == res->ntups&& !res->tuples[tup_num]) should just become if (tup_num == res->ntups) also the memset of the tuple slots when the slot array is expanded can be removed. (in addition,

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Andrew Chernow
I disagree -- I think the fix is a one-liner. line 446: if (tup_num == res->ntups&& !res->tuples[tup_num]) should just become if (tup_num == res->ntups) also the memset of the tuple slots when the slot array is expanded can be removed. (in addition, the array tuple array expansion should reall

Re: [HACKERS] Remove support for 'userlocks'?

2011-06-03 Thread Bruce Momjian
Josh Berkus wrote: > On 6/3/11 11:01 AM, Bruce Momjian wrote: > > According to our documentation, 'userlocks' were removed in PG 8.2: > > > > > > http://developer.postgresql.org/pgdocs/postgres/runtime-config-developer.html > > I take it this doesn't trace advisory locks, and trace_locks doe

Re: [HACKERS] Postmaster holding unlinked files for pg_largeobject table

2011-06-03 Thread Alvaro Herrera
Excerpts from Alexander Shulgin's message of vie jun 03 17:45:28 -0400 2011: > There were about 450 such (or similar) files, all of them having /2613 in the > filename. Since 2613 is a regclass of pg_largeobject and we are indeed > working with quite a few large objects in that DB so this is wh

Re: [HACKERS] creating CHECK constraints as NOT VALID

2011-06-03 Thread Alvaro Herrera
Excerpts from Thom Brown's message of vie jun 03 13:45:57 -0400 2011: > On 3 June 2011 17:58, Alvaro Herrera wrote: > > Excerpts from Thom Brown's message of vie jun 03 12:47:58 -0400 2011: > >> Nice work Alvaro :)  Shouldn't patches be sent to -hackers instead of > >> the obsolete -patches list?

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Andrew Chernow
On 6/3/2011 7:14 PM, Merlin Moncure wrote: On Fri, Jun 3, 2011 at 6:22 PM, Andrew Chernow wrote: Actually, the original idea, as I stated UT, was to allow adding tuples in any order as well as overwriting them. Obviously lost that while trying to get libpqtypes working, which only appends. W

[HACKERS] Next CF in < 2 weeks

2011-06-03 Thread Josh Berkus
Hackers, Our next commitfest begins June 15. I will be CF manager for this one. Currently we already have 40 patches in the queue. If you already have code for a 9.2 feature, please get it in now. If you submitted a patch for this CF, we'd really appreciate it if you would volunteer to review

Re: [HACKERS] Remove support for 'userlocks'?

2011-06-03 Thread Josh Berkus
On 6/3/11 11:01 AM, Bruce Momjian wrote: > According to our documentation, 'userlocks' were removed in PG 8.2: > > > http://developer.postgresql.org/pgdocs/postgres/runtime-config-developer.html I take it this doesn't trace advisory locks, and trace_locks does? If so, then by all means re

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Merlin Moncure
On Fri, Jun 3, 2011 at 6:22 PM, Andrew Chernow wrote: > Actually, the original idea, as I stated UT, was to allow adding tuples in > any order as well as overwriting them.  Obviously lost that while trying to > get libpqtypes working, which only appends. Well, that may or not be the case, but tha

[HACKERS] Re: [COMMITTERS] pgsql: Disallow SELECT FOR UPDATE/SHARE on sequences.

2011-06-03 Thread Tatsuo Ishii
> and even wrap around completely. Since the row lock is ignored by nextval > and setval, the usefulness of the operation is highly debatable anyway. As for pgpool, this is plain wrong. The reason why pgpool uses sequene row lock is to obtain sequence table lock like effect, which is not currentl

[HACKERS] Assert failure when rechecking an exclusion constraint

2011-06-03 Thread Noah Misch
Commit d2f60a3ab055fb61c8e1056a7c5652f1dec85e00 added an assert to indexam.c's RELATION_CHECKS to block use of an index while it's being rebuilt. This assert trips while rechecking an exclusion constraint after an ALTER TABLE rebuild: CREATE TABLE t ( c int,

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Andrew Chernow
On 6/3/2011 5:54 PM, Merlin Moncure wrote: On Fri, Jun 3, 2011 at 3:38 PM, Andrew Chernow wrote: Eeekks. Found an additional bug. PQsetvalue only allocates the actual tuple if the provided tup_num equals the number of tuples (append) and that slot is NULL. This is wrong. The original idea

Re: [HACKERS] SIREAD lock versus ACCESS EXCLUSIVE lock

2011-06-03 Thread Kevin Grittner
"Kevin Grittner" wrote: > Tuple locks should be safe from that because we use the tuple xmin > as part of the target key, but page and heap locks That should have read "page and relation locks". > I guess that tips the scales in favor of it being worth the extra > code. I think it's still i

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Merlin Moncure
On Fri, Jun 3, 2011 at 3:38 PM, Andrew Chernow wrote: > Eeekks.  Found an additional bug.  PQsetvalue only allocates the actual > tuple if the provided tup_num equals the number of tuples (append) and that > slot is NULL.  This is wrong.  The original idea behind PQsetvalue was you > can add tupl

[HACKERS] Postmaster holding unlinked files for pg_largeobject table

2011-06-03 Thread Alexander Shulgin
Hello Hackers, There is some strange behavior we're experiencing with one of the customer's DBs (8.4) We've noticed that free disk space went down heavily on a system, and after a short analysis determined that the reason was that postmaster was holding lots of unlinked files open. A sample o

Re: [HACKERS] Getting a bug tracker for the Postgres project

2011-06-03 Thread Christopher Browne
On Fri, Jun 3, 2011 at 8:42 PM, Bruce Momjian wrote: > Just to throw out a crazy idea, there has been talk of bug ids.  What if > a thread, made up of multiple message ids, was in fact the bug id, and > the first message in the thread (ignoring month boundaries) was the > definitive bug id, but an

Re: [HACKERS] Getting a bug tracker for the Postgres project

2011-06-03 Thread Peter Eisentraut
On fre, 2011-06-03 at 16:42 -0400, Bruce Momjian wrote: > Just to throw out a crazy idea, there has been talk of bug ids. What > if a thread, made up of multiple message ids, was in fact the bug id, > and the first message in the thread (ignoring month boundaries) was > the definitive bug id, but

Re: [HACKERS] SIREAD lock versus ACCESS EXCLUSIVE lock

2011-06-03 Thread Kevin Grittner
Heikki Linnakangas wrote: > On 03.06.2011 23:44, Kevin Grittner wrote: >> Hmm. As mentioned earlier in the thread, cleaning these up >> doesn't actually have any benefit beyond freeing space in the >> predicate locking collections. I'm not sure that benefit is >> enough to justify this much ne

Re: [HACKERS] SIREAD lock versus ACCESS EXCLUSIVE lock

2011-06-03 Thread Heikki Linnakangas
On 03.06.2011 23:44, Kevin Grittner wrote: Heikki Linnakangas wrote: I think you'll need to just memorize the lock deletion command in a backend-local list, and perform the deletion in a post-commit function. Hmm. As mentioned earlier in the thread, cleaning these up doesn't actually have a

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Andrew Chernow
At first glance (have not tested this theory), looks like pqAddTuple() doesn't zero the newly allocated tuples slots like PQsetvalue() does. PQsetvalue is depending on the unassigned tuple table slots to be NULL to detect when a tuple must be allocated. Around line 446 on fe-exec.c. I never t

Re: [HACKERS] Getting a bug tracker for the Postgres project

2011-06-03 Thread Bruce Momjian
Just to throw out a crazy idea, there has been talk of bug ids. What if a thread, made up of multiple message ids, was in fact the bug id, and the first message in the thread (ignoring month boundaries) was the definitive bug id, but any of the message ids could be used to represent the definitive

Re: [HACKERS] SIREAD lock versus ACCESS EXCLUSIVE lock

2011-06-03 Thread Kevin Grittner
Heikki Linnakangas wrote: > I think you'll need to just memorize the lock deletion command in > a backend-local list, and perform the deletion in a post-commit > function. Hmm. As mentioned earlier in the thread, cleaning these up doesn't actually have any benefit beyond freeing space in the

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Andrew Chernow
On 6/3/2011 4:06 PM, Andrew Chernow wrote: On 6/3/2011 3:03 PM, Pavel Golub wrote: Hello. Reproduced under Windows XP SP3 using Visual C++ 2008 and Delphi. If PQsetvalue is called with second parameter equals to PQntuples then memory corruption appears. But it should grow internal tuples array

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Merlin Moncure
On Fri, Jun 3, 2011 at 3:06 PM, Andrew Chernow wrote: > On 6/3/2011 3:03 PM, Pavel Golub wrote: >> >> Hello. >> >> Reproduced under Windows XP SP3 using Visual C++ 2008 and Delphi. If >> PQsetvalue is called with second parameter equals to PQntuples then >> memory corruption appears. But it should

Re: [HACKERS] Getting a bug tracker for the Postgres project

2011-06-03 Thread Bruce Momjian
Tom Lane wrote: > Peter Eisentraut writes: > > That doesn't mean that better integration cannot be worked on later, but > > this illusion that a bug tracker must have magical total awareness of > > the entire flow of information in the project from day one is an > > illusion and has blocked this b

Re: [HACKERS] Getting a bug tracker for the Postgres project

2011-06-03 Thread Bruce Momjian
Greg Stark wrote: > On Mon, May 30, 2011 at 6:52 PM, Robert Haas wrote: > > ?The number of people reading and replying to > > emails on pgsql-bugs is already insufficient, perhaps because of the > > (incorrect) perception that Tom does or will fix everything and no one > > else needs to care. ?So

Re: [HACKERS] Getting a bug tracker for the Postgres project

2011-06-03 Thread Bruce Momjian
Josh Berkus wrote: > All, > > Let me mention some of the reasons we as a project could use a bug > tracker which have nothing to do with actually fixing bugs. > > (1) Testing: a bug tracker could be used for beta testing instead of the > ad-hoc system I'm writing. Assuming it has the right featu

Re: [HACKERS] SIREAD lock versus ACCESS EXCLUSIVE lock

2011-06-03 Thread Kevin Grittner
Tom Lane wrote: > "Kevin Grittner" writes: >> Heikki Linnakangas wrote: >>> I think you'll need to just memorize the lock deletion command >>< in a backend-local list, and perform the deletion in a >>> post-commit function. Something similar to the PendingRelDelete >>> stuff in storage.c. In fac

Re: [HACKERS] Change 'pg_ctl: no server running' Exit Status to 3

2011-06-03 Thread Peter Eisentraut
On mån, 2011-05-23 at 20:50 -0400, Aaron W. Swenson wrote: > According to Linux Standard Base Core Specification 3.1 [1], the exit > status should be '3' when the server isn't running. > > I've attached a very simple patch that resolves this cosmetic issue, > which applies to all branches. If we'

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Merlin Moncure
On Fri, Jun 3, 2011 at 2:03 PM, Pavel Golub wrote: > Hello. > > Reproduced under Windows XP SP3 using Visual C++ 2008 and Delphi. If > PQsetvalue is called with second parameter equals to PQntuples then > memory corruption appears. But it should grow internal tuples array > and populate the last i

Re: [HACKERS] Error in PQsetvalue

2011-06-03 Thread Andrew Chernow
On 6/3/2011 3:03 PM, Pavel Golub wrote: Hello. Reproduced under Windows XP SP3 using Visual C++ 2008 and Delphi. If PQsetvalue is called with second parameter equals to PQntuples then memory corruption appears. But it should grow internal tuples array and populate the last item with provided dat

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Kevin Grittner
Tom Lane wrote: > A domain constraint is a constraint that is specified for a > domain. > It is applied to all columns that are based on that domain, and > to all values cast to that domain. > > If you take that literally, it means that domain constraints are > applied > (1) in an assignmen

Re: [HACKERS] SIREAD lock versus ACCESS EXCLUSIVE lock

2011-06-03 Thread Tom Lane
"Kevin Grittner" writes: > Heikki Linnakangas wrote: >> I think you'll need to just memorize the lock deletion command in >> a backend-local list, and perform the deletion in a post-commit >> function. Something similar to the PendingRelDelete stuff in >> storage.c. In fact, hooking into smgrDoPe

Re: [HACKERS] DOCS: SGML identifier may not exceed 44 characters

2011-06-03 Thread Peter Eisentraut
On tis, 2011-05-31 at 16:17 +1000, Brendan Jurd wrote: > Hi folks, > > I was working on a little docs patch today, and when I tried to > `make`, openjade choked on an identifier in information_schema.sgml, > which is very much unrelated to my changes: > > openjade:information_schema.sgml:828:60:Q

Re: [HACKERS] Vacuum, visibility maps and SKIP_PAGES_THRESHOLD

2011-06-03 Thread Bruce Momjian
Heikki Linnakangas wrote: > On 27.05.2011 16:52, Pavan Deolasee wrote: > > On closer inspection, I realized that we have > > deliberately put in this hook to ensure that we use visibility maps > > only when we see at least SKIP_PAGES_THRESHOLD worth of all-visible > > sequential pages to take advan

[HACKERS] Error in PQsetvalue

2011-06-03 Thread Pavel Golub
Hello. Reproduced under Windows XP SP3 using Visual C++ 2008 and Delphi. If PQsetvalue is called with second parameter equals to PQntuples then memory corruption appears. But it should grow internal tuples array and populate the last item with provided data. Please see the code: #include #inclu

Re: [HACKERS] SIREAD lock versus ACCESS EXCLUSIVE lock

2011-06-03 Thread Kevin Grittner
Heikki Linnakangas wrote: > On 03.06.2011 21:04, Kevin Grittner wrote: >> Also, if anyone has comments or hints about the placement of >> those calls, I'd be happy to receive them. > > heap_drop_with_catalog() schedules the relation for deletion at > the end of transaction, but it's still possibl

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Tom Lane
"Kevin Grittner" writes: > Another long-range nicety would be something which I have seen in > some other databases, and which is consistent with the inheritance > theme, is that you can't compare or assign dissimilar domains -- an > error is thrown. So if you try to join from the eye color column

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Tom Lane
BTW, a possibly relevant point here is that SQL:2008 says (in 4.12) The purpose of a domain is to constrain the set of valid values that can be stored in a column of a base table by various operations. and in 4.17.4 A domain constraint is a constraint that is spec

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Kevin Grittner
Robert Haas wrote: > The real crux of the issue here is: under what circumstances > should we look through the domain wrapper around an underlying > type, and under what circumstances should we refrain from doing > so? I don't know if this is the intent of domains in the SQL standard, but I fi

[HACKERS] permissions of external PID file

2011-06-03 Thread Peter Eisentraut
The external PID file, if configured, is currently generated with 600 permissions, which results from the umask setting in the postmaster. I think it would be nicer if we could make that 644. I have often dealt with scripts and such that look through PID files in /var/run, and it's always annoyin

Re: [HACKERS] SIREAD lock versus ACCESS EXCLUSIVE lock

2011-06-03 Thread Heikki Linnakangas
On 03.06.2011 21:04, Kevin Grittner wrote: Also, if anyone has comments or hints about the placement of those calls, I'd be happy to receive them. heap_drop_with_catalog() schedules the relation for deletion at the end of transaction, but it's still possible that the transaction aborts and th

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Tom Lane
Robert Haas writes: > The real crux of the issue here is: under what circumstances should we > look through the domain wrapper around an underlying type, and under > what circumstances should we refrain from doing so? That's half of it. The other half is: when we *do* look through the wrapper, i

Re: [HACKERS] Remove support for 'userlocks'?

2011-06-03 Thread Merlin Moncure
On Fri, Jun 3, 2011 at 1:01 PM, Bruce Momjian wrote: > According to our documentation, 'userlocks' were removed in PG 8.2: > >         > http://developer.postgresql.org/pgdocs/postgres/runtime-config-developer.html > >        trace_userlocks (boolean) > >        If on, emit information about user

Re: [HACKERS] Streaming solution and v3.1 protocol

2011-06-03 Thread Merlin Moncure
On Fri, Jun 3, 2011 at 12:04 PM, Heikki Linnakangas wrote: > On 03.06.2011 19:19, Radosław Smogura wrote: >> >> Hello, >> >> Sorry for short introduction about this, and plese as far as possible, >> disconnet it from LOBs, as it on top of LOB. >> >> Idea of streaming is to reduce memory copy mainl

[HACKERS] Re: reducing the overhead of frequent table locks - now, with WIP patch

2011-06-03 Thread Noah Misch
On Fri, Jun 03, 2011 at 09:17:08AM -0400, Robert Haas wrote: > As you can see, this works out to a bit more than a 4% improvement on > this two-core box. I also got access (thanks to Nate Boley) to a > 24-core box and ran the same test with scale factor 100 and > shared_buffers=8GB. Here are the

Re: [HACKERS] SIREAD lock versus ACCESS EXCLUSIVE lock

2011-06-03 Thread Kevin Grittner
On 1 May 2011 I wrote: > Consider this a WIP patch Just so people know where this stands... By 8 May 2011 I had the attached. I didn't post it because I was not confident I had placed the calls to the SSI functions for DROP TABLE and TRUNCATE TABLE correctly. Then came PGCon and also the r

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Robert Haas
On Fri, Jun 3, 2011 at 1:00 PM, David E. Wheeler wrote: > On Jun 3, 2011, at 8:22 AM, Robert Haas wrote: > >> Well, as Bill Clinton once said, "it depends on what the meaning of >> the word 'is' is".  I think of array types in PostgreSQL as meaning >> "the types whose monikers end in a pair of squ

[HACKERS] Remove support for 'userlocks'?

2011-06-03 Thread Bruce Momjian
According to our documentation, 'userlocks' were removed in PG 8.2: http://developer.postgresql.org/pgdocs/postgres/runtime-config-developer.html trace_userlocks (boolean) If on, emit information about user lock usage. Output is the same as for trace_lock

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Noah Misch
On Fri, Jun 03, 2011 at 10:42:01AM -0400, Tom Lane wrote: > Noah Misch writes: > > On Fri, Jun 03, 2011 at 12:27:35AM -0400, Robert Haas wrote: > >> and we > >> treat the call as a request to smash bar to the underlying array type. > > > No, there's no need to do that. The domain "is" an array,

Re: [HACKERS] creating CHECK constraints as NOT VALID

2011-06-03 Thread Thom Brown
On 3 June 2011 17:58, Alvaro Herrera wrote: > Excerpts from Thom Brown's message of vie jun 03 12:47:58 -0400 2011: >> On 2 June 2011 17:48, Alvaro Herrera wrote: > >> > Actually, it turns out that NOT VALID foreign keys were already buggy >> > here, and fixing them automatically fixes this case

Re: [HACKERS] Streaming solution and v3.1 protocol

2011-06-03 Thread Heikki Linnakangas
On 03.06.2011 19:19, Radosław Smogura wrote: Hello, Sorry for short introduction about this, and plese as far as possible, disconnet it from LOBs, as it on top of LOB. Idea of streaming is to reduce memory copy mainly during receiving and sending tuples. Currently receive works as follows 1. Re

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

2011-06-03 Thread Alvaro Herrera
Excerpts from Tom Lane's message of jue jun 02 15:49:53 -0400 2011: > Alexey Klyukin writes: > > - 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 > > the > > failure is due to the shmmax or

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

2011-06-03 Thread Alvaro Herrera
Excerpts from Robert Haas's message of vie jun 03 09:34:03 -0400 2011: > > Just a note that since Alvaro created a patch to provide similar > > functionality for constraints, I identified an issue with database > > dumps, which apparently affects invalid foreign keys too: > > http://archives.postg

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread David E. Wheeler
On Jun 3, 2011, at 8:22 AM, Robert Haas wrote: > Well, as Bill Clinton once said, "it depends on what the meaning of > the word 'is' is". I think of array types in PostgreSQL as meaning > "the types whose monikers end in a pair of square brackets". Man, range types are going to fuck with your br

Re: [HACKERS] creating CHECK constraints as NOT VALID

2011-06-03 Thread Alvaro Herrera
Excerpts from Thom Brown's message of vie jun 03 12:47:58 -0400 2011: > On 2 June 2011 17:48, Alvaro Herrera wrote: > > Actually, it turns out that NOT VALID foreign keys were already buggy > > here, and fixing them automatically fixes this case as well, because the > > fix involves touching pg_g

Re: [HACKERS] BLOB support

2011-06-03 Thread Radosław Smogura
Tom Lane Friday 03 of June 2011 18:08:56 > Robert Haas writes: > > On Thu, Jun 2, 2011 at 12:53 PM, Radosław Smogura > > > > wrote: > >> 1. No tracking of unused LO (you store just id of such object). You may > >> leak LO after row remove/update. User may write triggers for this, but > >> it i

Re: [HACKERS] creating CHECK constraints as NOT VALID

2011-06-03 Thread Thom Brown
On 2 June 2011 17:48, Alvaro Herrera wrote: > 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 ] >> >> Certai

Re: [HACKERS] reducing the overhead of frequent table locks - now, with WIP patch

2011-06-03 Thread Robert Haas
On Fri, Jun 3, 2011 at 10:13 AM, Kevin Grittner wrote: > Robert Haas wrote: > >> That's an improvement of about ~3.5x. > > Outstanding! > > I don't want to even peek at this until I've posted the two WIP SSI > patches (now both listed on the "Open Items" page), but will > definitely take a look a

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Ross J. Reedstrom
On Fri, Jun 03, 2011 at 11:22:34AM -0400, Robert Haas wrote: > On Fri, Jun 3, 2011 at 1:14 AM, Noah Misch wrote: > > No, there's no need to do that.  The domain "is" an array, not merely > > something > > that can be coerced to an array.  Therefore, it can be chosen as the > > polymorphic > > ty

Re: [HACKERS] Identifying no-op length coercions

2011-06-03 Thread Noah Misch
On Fri, Jun 03, 2011 at 10:43:17AM -0500, Jim Nasby wrote: > On Jun 3, 2011, at 10:11 AM, Alexey Klyukin wrote: > >> Is your interest in cheap varchar(N)->varchar(N+M) conversions > >> specifically, or > >> in some broader application of this facility? > > > > Exactly varchar conversions. > > Wh

[HACKERS] Streaming solution and v3.1 protocol

2011-06-03 Thread Radosław Smogura
Hello, Sorry for short introduction about this, and plese as far as possible, disconnet it from LOBs, as it on top of LOB. Idea of streaming is to reduce memory copy mainly during receiving and sending tuples. Currently receive works as follows 1. Read bytes of tuple (allocate x memory). 2. Eve

Re: [HACKERS] Identifying no-op length coercions

2011-06-03 Thread Robert Haas
On Fri, Jun 3, 2011 at 11:43 AM, Jim Nasby wrote: > On Jun 3, 2011, at 10:11 AM, Alexey Klyukin wrote: >>> Is your interest in cheap varchar(N)->varchar(N+M) conversions >>> specifically, or >>> in some broader application of this facility? >> >> Exactly varchar conversions. > > Why limit it to v

Re: [HACKERS] About bug #6049

2011-06-03 Thread Robert Haas
On Fri, Jun 3, 2011 at 12:13 PM, Tom Lane wrote: > Robert Haas writes: >> On Fri, Jun 3, 2011 at 11:25 AM, Tom Lane wrote: >>> But anyway, there are basically two things we could do here: either >>> allow the table alias to be referenced, or try to teach ruleutils.c >>> not to qualify the column

Re: [HACKERS] Change 'pg_ctl: no server running' Exit Status to 3

2011-06-03 Thread Robert Haas
On Mon, May 23, 2011 at 8:50 PM, Aaron W. Swenson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > According to Linux Standard Base Core Specification 3.1 [1], the exit > status should be '3' when the server isn't running. > > I've attached a very simple patch that resolves this cosm

Re: [HACKERS] About bug #6049

2011-06-03 Thread Tom Lane
Robert Haas writes: > On Fri, Jun 3, 2011 at 11:25 AM, Tom Lane wrote: >> But anyway, there are basically two things we could do here: either >> allow the table alias to be referenced, or try to teach ruleutils.c >> not to qualify the column reference.  The second looks pretty tricky >> and maybe

Re: [HACKERS] Identifying no-op length coercions

2011-06-03 Thread Kevin Grittner
Jim Nasby wrote: > The only challenge I see is numeric; we'd need to ensure that both > size and precision are not decreasing. To be picky, wouldn't that need to be "neither (precision - scale) nor scale is decreasing"? -Kevin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresq

Re: [HACKERS] BLOB support

2011-06-03 Thread Radosław Smogura
Tom Lane Friday 03 of June 2011 16:44:13 > Alvaro Herrera writes: > > Excerpts from Radosław Smogura's message of jue jun 02 15:26:29 -0400 2011: > >> So do I understand good should We think about create bettered TOAST to > >> support larger values then 30-bit length? I like this much more, > >

Re: [HACKERS] pg_basebackup

2011-06-03 Thread Robert Haas
On Wed, May 25, 2011 at 5:28 AM, Emanuel Calvo wrote: > Hi all, > > I'm seeing the results of pg_basebackup and I saw postmaster.opts. > Is not necessary, although is inoffensive. But has  the name of the > original cluster name inside. If it's only keep for information purposes, > maybe backup_la

Re: [HACKERS] BLOB support

2011-06-03 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 2, 2011 at 12:53 PM, Radosław Smogura > wrote: >> 1. No tracking of unused LO (you store just id of such object). You may leak >> LO after row remove/update. User may write triggers for this, but it is not >> argument - BLOB type is popular, and it's simplicity

Re: [HACKERS] About bug #6049

2011-06-03 Thread Robert Haas
On Fri, Jun 3, 2011 at 11:25 AM, Tom Lane wrote: > I looked into $SUBJECT, which complains about this: > > CREATE VIEW test_view AS VALUES (1), (2), (3) ORDER BY 1; > > This dumps like so: > > regression=# \d+ test_view >                View "public.test_view" >  Column  |  Type   | Modifiers | St

Re: [HACKERS] switch UNLOGGED to LOGGED

2011-06-03 Thread Robert Haas
On Tue, May 31, 2011 at 12:25 PM, Leonardo Francalanci wrote: >> Well, I  sort of assumed the design was OK, too, but the more we talk >> about this  WAL-logging stuff, the less convinced I am that I really >> understand the  problem.  :-( > > > I see. In fact, I think nobody thought about restart

Re: [HACKERS] BLOB support

2011-06-03 Thread Robert Haas
On Thu, Jun 2, 2011 at 12:53 PM, Radosław Smogura wrote: > 1. No tracking of unused LO (you store just id of such object). You may leak > LO after row remove/update. User may write triggers for this, but it is not > argument - BLOB type is popular, and it's simplicity of use is quite > important.

Re: [HACKERS] Identifying no-op length coercions

2011-06-03 Thread Jim Nasby
On Jun 3, 2011, at 10:11 AM, Alexey Klyukin wrote: >> Is your interest in cheap varchar(N)->varchar(N+M) conversions specifically, >> or >> in some broader application of this facility? > > Exactly varchar conversions. Why limit it to varchar? Shouldn't we be able to do this for any varlena? The

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Robert Haas
On Fri, Jun 3, 2011 at 1:14 AM, Noah Misch wrote: > No, there's no need to do that.  The domain "is" an array, not merely > something > that can be coerced to an array.  Therefore, it can be chosen as the > polymorphic > type directly.  Indeed, all released versions do this. Well, as Bill Clint

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

2011-06-03 Thread Alexey Klyukin
On Jun 2, 2011, at 10:49 PM, Tom Lane wrote: > 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 th

[HACKERS] About bug #6049

2011-06-03 Thread Tom Lane
I looked into $SUBJECT, which complains about this: CREATE VIEW test_view AS VALUES (1), (2), (3) ORDER BY 1; This dumps like so: regression=# \d+ test_view View "public.test_view" Column | Type | Modifiers | Storage | Description -+-+---+-+-

Re: [HACKERS] Identifying no-op length coercions

2011-06-03 Thread Alexey Klyukin
Hi, On Jun 2, 2011, at 10:22 PM, Noah Misch wrote: > Hi Alexey, > ... > Is your interest in cheap varchar(N)->varchar(N+M) conversions specifically, > or > in some broader application of this facility? Exactly varchar conversions. > > Thanks for volunteering to review; that will be a big hel

Re: [HACKERS] BLOB support

2011-06-03 Thread Tom Lane
Alvaro Herrera writes: > Excerpts from Radosław Smogura's message of jue jun 02 15:26:29 -0400 2011: >> So do I understand good should We think about create bettered TOAST to >> support >> larger values then 30-bit length? I like this much more, > Good :-) > (BTW while it'd be good to have lo

Re: [HACKERS] Domains versus polymorphic functions, redux

2011-06-03 Thread Tom Lane
Noah Misch writes: > On Fri, Jun 03, 2011 at 12:27:35AM -0400, Robert Haas wrote: >> and we >> treat the call as a request to smash bar to the underlying array type. > No, there's no need to do that. The domain "is" an array, not merely > something that can be coerced to an array. Therefore, it

Re: [HACKERS] BLOB support

2011-06-03 Thread Alvaro Herrera
Excerpts from Radosław Smogura's message of jue jun 02 15:26:29 -0400 2011: > So do I understand good should We think about create bettered TOAST to > support > larger values then 30-bit length? I like this much more, Good :-) (BTW while it'd be good to have longer-than-30 bit length words for

Re: [HACKERS] reducing the overhead of frequent table locks - now, with WIP patch

2011-06-03 Thread Kevin Grittner
Robert Haas wrote: > That's an improvement of about ~3.5x. Outstanding! I don't want to even peek at this until I've posted the two WIP SSI patches (now both listed on the "Open Items" page), but will definitely take a look after that. -Kevin -- Sent via pgsql-hackers mailing list (pgsql

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

2011-06-03 Thread Robert Haas
On Thu, Jun 2, 2011 at 5:34 PM, Thom Brown wrote: > 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-c

Re: [HACKERS] pg_upgrade automatic testing

2011-06-03 Thread Andrew Dunstan
On 05/25/2011 03:07 PM, 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. This has now been addressed: pg_upgrade accepts PGPORT setting

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

2011-06-03 Thread HuangQi
Thanks all for your ideas. Though wired, I reinstalled the Postgres and tried again. This error message disappears. The parser now works good. On 3 June 2011 01:13, Alvaro Herrera wrote: > Excerpts from HuangQi's message of jue jun 02 11:17:21 -0400 2011: > > Hi, thanks a lot for your ideas. But

[HACKERS] Cannot receive posts to pgsql-hackers through news server

2011-06-03 Thread MauMau
Hello, I'm reading the posts of pgsql-hackers through the news server news.postgresql.org using Windows Mail on Windows Vista, to avoid receiving many emails. I don't seem to be able to receive posts in June. All I could download are before June. But I could receive messages in June of other M

[HACKERS] WIP: Fast GiST index build

2011-06-03 Thread Alexander Korotkov
Hackers, WIP patch of fast GiST index build is attached. Code is dirty and comments are lacking, but it works. Now it is ready for first benchmarks, which should prove efficiency of selected technique. It's time to compare fast GiST index build with repeat insert build on large enough datasets (da

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

2011-06-03 Thread Heikki Linnakangas
On 03.06.2011 00:14, Kevin Grittner wrote: Attached is a comments-only patch for this, along with one correction to the comments you added and a couple other typos. Ok, committed. I'll submit a patch for the README-SSI file once I find a reference I like to a paper describing what Dan's proo

Re: [HACKERS] storing TZ along timestamps

2011-06-03 Thread Peter Eisentraut
On tor, 2011-06-02 at 22:58 -0500, Jim Nasby wrote: > I'm torn between whether the type should store the original time or > the original time converted to GMT. I believe you would have the most > accuracy if you stored the original time... but then indexing becomes > problematic. I don't know if th