Re: [HACKERS] Further news on Clang - spurious warnings

2011-08-04 Thread Tom Lane
Peter Geoghegan pe...@2ndquadrant.com writes: On 3 August 2011 21:03, Tom Lane t...@sss.pgh.pa.us wrote: I mean that it's unclear what you'll get if status has a bitpattern equivalent to a negative integer.  If the compiler implements the comparison as signed, the test will yield TRUE; if

Re: [HACKERS] Transient plans versus the SPI API

2011-08-04 Thread Simon Riggs
On Wed, Aug 3, 2011 at 8:33 PM, Tom Lane t...@sss.pgh.pa.us wrote: Simon Riggs si...@2ndquadrant.com writes: I think its possible to tell automatically whether we need to replan always or not based upon the path we take through selectivity functions. I don't really believe that, or at least

Re: [HACKERS] cataloguing NOT NULL constraints

2011-08-04 Thread Dean Rasheed
On 3 August 2011 22:26, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Dean Rasheed's message of sáb jul 23 04:37:06 -0400 2011: On 22 July 2011 22:28, Robert Haas robertmh...@gmail.com wrote: mine was that we need a command such as ALTER TABLE foo ALTER COLUMN bar SET NOT

Re: [HACKERS] cataloguing NOT NULL constraints

2011-08-04 Thread Nikhil Sontakke
So after writing the code to handle named NOT NULL constraints for tables, I'm thinking that dumpConstraints needs to be fixed thusly: @@ -12888,6 +12968,27 @@ dumpConstraint(Archive *fout, ConstraintInfo *coninfo)                         NULL, NULL);        }    } +   else if

Re: [HACKERS] Further news on Clang - spurious warnings

2011-08-04 Thread Peter Geoghegan
On 4 August 2011 07:08, Tom Lane t...@sss.pgh.pa.us wrote: Peter Geoghegan pe...@2ndquadrant.com writes: On 3 August 2011 21:03, Tom Lane t...@sss.pgh.pa.us wrote: I mean that it's unclear what you'll get if status has a bitpattern equivalent to a negative integer.  If the compiler implements

Re: [HACKERS] WIP: Fast GiST index build

2011-08-04 Thread Alexander Korotkov
Uhh, my bad, really stupid bug. Many thanks. -- With best regards, Alexander Korotkov. On Wed, Aug 3, 2011 at 8:31 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 03.08.2011 11:18, Alexander Korotkov wrote: I found that in previous version of patch I missed

Re: [HACKERS] Postgres / plpgsql equivalent to python's getattr() ?

2011-08-04 Thread Florian Pflug
On Aug4, 2011, at 00:48 , Tom Lane wrote: James Robinson jlrob...@socialserve.com writes: Python's getattr() allows for dynamic lookup of attributes on an object, as in: inst = MyClass(x=12, y=24) v = getattr(inst, 'x') assert v == 12 Oftentimes in writing data

Re: [HACKERS] cataloguing NOT NULL constraints

2011-08-04 Thread Dean Rasheed
On 4 August 2011 09:23, Nikhil Sontakke nikkh...@gmail.com wrote: So after writing the code to handle named NOT NULL constraints for tables, I'm thinking that dumpConstraints needs to be fixed thusly: @@ -12888,6 +12968,27 @@ dumpConstraint(Archive *fout, ConstraintInfo *coninfo)            

Re: [HACKERS] error: could not find pg_class tuple for index 2662

2011-08-04 Thread daveg
On Wed, Aug 03, 2011 at 11:18:20AM -0400, Tom Lane wrote: Evidently not, if it's not logging anything, but now the question is why. One possibility is that for some reason RelationGetNumberOfBlocks is persistently lying about the file size. (We've seen kernel bugs before that resulted in

Re: [HACKERS] SYNONYMS (again)

2011-08-04 Thread Boszormenyi Zoltan
2011-06-23 20:44 keltezéssel, Gurjeet Singh írta: On Wed, Jun 22, 2011 at 3:37 PM, Joshua D. Drake j...@commandprompt.com mailto:j...@commandprompt.com wrote: Per: http://archives.postgresql.org/pgsql-hackers/2010-11/msg02043.php It seems we did come up with a use case in the

Re: [HACKERS] Transient plans versus the SPI API

2011-08-04 Thread Yeb Havinga
On 2011-08-03 21:19, Tom Lane wrote: Robert Haasrobertmh...@gmail.com writes: This seems like a good design. Now what would be really cool is if you could observe a stream of queries like this: SELECT a, b FROM foo WHERE c = 123 SELECT a, b FROM foo WHERE c = 97 SELECT a, b FROM foo WHERE c =

Re: [HACKERS] Postgres / plpgsql equivalent to python's getattr() ?

2011-08-04 Thread Pavel Stehule
2011/8/4 Florian Pflug f...@phlo.org: On Aug4, 2011, at 00:48 , Tom Lane wrote: James Robinson jlrob...@socialserve.com writes: Python's getattr() allows for dynamic lookup of attributes on an object, as in:      inst = MyClass(x=12, y=24)      v = getattr(inst, 'x')      assert v == 12

[HACKERS] TRUE/FALSE vs true/false

2011-08-04 Thread Boszormenyi Zoltan
Hi, I looked at b4fbe392f8ff6ff1a66b488eb7197eef9e1770a4 and I noticed that it's using TRUE, FALSE, true and false inconsistently: @@ -248,6 +249,7 @@ CreateSharedInvalidationState(void) shmInvalBuffer-procState[i].nextMsgNum = 0;/* meaningless */

Re: [HACKERS] TRUE/FALSE vs true/false

2011-08-04 Thread Robert Haas
2011/8/4 Boszormenyi Zoltan z...@cybertec.at: Shouldn't these get fixed to be consistent? I believe I already did. See commit 85b436f7b1f06a6ffa8d2f29b03d6e440de18784. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers

Re: [HACKERS] TRUE/FALSE vs true/false

2011-08-04 Thread Boszormenyi Zoltan
2011-08-04 14:32 keltezéssel, Robert Haas írta: 2011/8/4 Boszormenyi Zoltan z...@cybertec.at: Shouldn't these get fixed to be consistent? I believe I already did. See commit 85b436f7b1f06a6ffa8d2f29b03d6e440de18784. I meant a mass sed -e 's/TRUE/true/g' -e 's/FALSE/false/g' run so all the

Re: [HACKERS] TRUE/FALSE vs true/false

2011-08-04 Thread Robert Haas
On Thu, Aug 4, 2011 at 8:44 AM, Boszormenyi Zoltan z...@cybertec.at wrote: 2011-08-04 14:32 keltezéssel, Robert Haas írta: 2011/8/4 Boszormenyi Zoltan z...@cybertec.at: Shouldn't these get fixed to be consistent? I believe I already did.  See commit 85b436f7b1f06a6ffa8d2f29b03d6e440de18784.

[HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Hannu Krosing
Hi I have been helping some people to debug a SIGALARM related crash induced by using pl/perlu http get functionality I have been so far able to repeat the crash only on Debian 64 bit computers. DB create script and instructions for reproducing the crash attached The crash is related to

Re: [HACKERS] TRUE/FALSE vs true/false

2011-08-04 Thread Peter Geoghegan
On 4 August 2011 13:57, Robert Haas robertmh...@gmail.com wrote: Oh, I see.  Well, I don't care either way, so I'll let others weigh in.  The way it is doesn't bother me, but fixing it doesn't bother me either. Idiomatic win32 code uses BOOL and TRUE/FALSE. They are macros defined somewhere or

Re: [HACKERS] Compressing the AFTER TRIGGER queue

2011-08-04 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: On Wed, Aug 3, 2011 at 6:05 PM, Jim Nasby j...@nasby.net wrote: Not sure how much this relates to this discussion, but I have often wished we had AFTER FOR EACH STATEMENT triggers that provided OLD and NEW recordsets you could make use of. Sometimes

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Andrew Dunstan
On 08/04/2011 09:07 AM, Hannu Krosing wrote: Hi I have been helping some people to debug a SIGALARM related crash induced by using pl/perlu http get functionality I have been so far able to repeat the crash only on Debian 64 bit computers. DB create script and instructions for reproducing

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Hannu Krosing
On Thu, 2011-08-04 at 15:07 +0200, Hannu Krosing wrote: Hi I have been helping some people to debug a SIGALARM related crash induced by using pl/perlu http get functionality I have been so far able to repeat the crash only on Debian 64 bit computers. DB create script and instructions for

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Hannu Krosing
On Thu, 2011-08-04 at 09:42 -0400, Andrew Dunstan wrote: On 08/04/2011 09:07 AM, Hannu Krosing wrote: Hi I have been helping some people to debug a SIGALARM related crash induced by using pl/perlu http get functionality I have been so far able to repeat the crash only on Debian 64

Re: [HACKERS] Postgres / plpgsql equivalent to python's getattr() ?

2011-08-04 Thread Hannu Krosing
On Wed, 2011-08-03 at 18:48 -0400, Tom Lane wrote: James Robinson jlrob...@socialserve.com writes: Python's getattr() allows for dynamic lookup of attributes on an object, as in: inst = MyClass(x=12, y=24) v = getattr(inst, 'x') assert v == 12 Oftentimes in writing

Re: [HACKERS] Postgres / plpgsql equivalent to python's getattr() ?

2011-08-04 Thread James Robinson
On Aug 4, 2011, at 4:55 AM, Florian Pflug wrote: @OP: Here's my implementation of the feature you desire as a set of C-language functions: https://github.com/fgp/pg_record_inspect. Other people did code up similar things in the past, but I currently cannot find any links to their

Re: [HACKERS] cataloguing NOT NULL constraints

2011-08-04 Thread Alvaro Herrera
Excerpts from Nikhil Sontakke's message of jue ago 04 04:23:59 -0400 2011: Some nit-picking. AFAICS above, we seem to be only using 'tbinfo' to identify the object type here - 'table' visavis 'domain'. We could probably reduce the above two elses to a single one and use the check of tbinfo

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Alvaro Herrera
Excerpts from Hannu Krosing's message of jue ago 04 09:53:40 -0400 2011: On Thu, 2011-08-04 at 09:42 -0400, Andrew Dunstan wrote: On 08/04/2011 09:07 AM, Hannu Krosing wrote: I have been helping some people to debug a SIGALARM related crash induced by using pl/perlu http get

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Tom Lane
Hannu Krosing ha...@krosing.net writes: On Thu, 2011-08-04 at 09:42 -0400, Andrew Dunstan wrote: On 08/04/2011 09:07 AM, Hannu Krosing wrote: The crash is related to something leaving begind a bad SIGALARM handler, So doesn't this look like a bug in the perl module that sets the signal

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Andrew Dunstan
On 08/04/2011 09:53 AM, Hannu Krosing wrote: What happens if you wrap the calls to the module like this?: { local $SIG{ALRM}; # do LWP stuff here } return 'OK'; That should restore the old handler on exit from the block. I think if you use a perl

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Alexey Klyukin
On Aug 4, 2011, at 5:25 PM, Alvaro Herrera wrote: Excerpts from Hannu Krosing's message of jue ago 04 09:53:40 -0400 2011: On Thu, 2011-08-04 at 09:42 -0400, Andrew Dunstan wrote: On 08/04/2011 09:07 AM, Hannu Krosing wrote: I have been helping some people to debug a SIGALARM related

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Andrew Dunstan
On 08/04/2011 10:28 AM, Tom Lane wrote: How can anything like that possibly work with any reliability whatsoever? If the signal comes in, you don't know whether it was triggered by the event Postgres expected, or the event the perl module expected, and hence there's no way to deliver it to

Re: [HACKERS] Postgres / plpgsql equivalent to python's getattr() ?

2011-08-04 Thread Merlin Moncure
On Wed, Aug 3, 2011 at 4:19 PM, James Robinson jlrob...@socialserve.com wrote: Hackers, Python's getattr() allows for dynamic lookup of attributes on an object, as in:        inst = MyClass(x=12, y=24)        v = getattr(inst, 'x')        assert v == 12 Oftentimes in writing data

Re: [HACKERS] lazy vxid locks, v3

2011-08-04 Thread Jeff Davis
On Mon, 2011-08-01 at 12:12 -0400, Robert Haas wrote: I guess you could look at that way. It just seemed like the obvious way to write the code: we do LockRefindAndRelease() only if we have a fast-path lock that someone else has pushed into the main table. OK, looks good to me. Marked ready

Re: [HACKERS] WAL logging volume and CREATE TABLE

2011-08-04 Thread Bruce Momjian
Patch applied. --- Bruce Momjian wrote: Alvaro Herrera wrote: Excerpts from Bruce Momjian's message of mar ago 02 22:46:55 -0400 2011: I have created a documentation patch to clarify this, and to mention CREATE

Re: [HACKERS] error: could not find pg_class tuple for index 2662

2011-08-04 Thread Tom Lane
daveg da...@sonic.net writes: Summary: the failing process reads 0 rows from 0 blocks from the OLD relfilenode. Hmm. This seems to mean that we're somehow missing a relation mapping invalidation message, or perhaps not processing it soon enough during some complex set of invalidations. I did

Re: [HACKERS] lazy vxid locks, v3

2011-08-04 Thread Robert Haas
On Thu, Aug 4, 2011 at 11:29 AM, Jeff Davis pg...@j-davis.com wrote: On Mon, 2011-08-01 at 12:12 -0400, Robert Haas wrote: I guess you could look at that way.  It just seemed like the obvious way to write the code: we do LockRefindAndRelease() only if we have a fast-path lock that someone else

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Hannu Krosing
On Thu, 2011-08-04 at 10:28 -0400, Tom Lane wrote: Hannu Krosing ha...@krosing.net writes: On Thu, 2011-08-04 at 09:42 -0400, Andrew Dunstan wrote: On 08/04/2011 09:07 AM, Hannu Krosing wrote: The crash is related to something leaving begind a bad SIGALARM handler, So doesn't this look

Re: [HACKERS] cataloguing NOT NULL constraints

2011-08-04 Thread Peter Eisentraut
On tis, 2011-08-02 at 23:40 -0400, Alvaro Herrera wrote: Thanks. I've done the other changes you suggested, but I don't see that it's desirable to have gram.y emit AT_AddConstraint directly. It seems cleaner to be able to turn a NOT NULL constraint into AT_SetNotNull in parse_utilcmd

Re: [HACKERS] TRUE/FALSE vs true/false

2011-08-04 Thread Peter Eisentraut
On tor, 2011-08-04 at 14:44 +0200, Boszormenyi Zoltan wrote: 2011-08-04 14:32 keltezéssel, Robert Haas írta: 2011/8/4 Boszormenyi Zoltan z...@cybertec.at: Shouldn't these get fixed to be consistent? I believe I already did. See commit 85b436f7b1f06a6ffa8d2f29b03d6e440de18784. I meant

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-08-04 Thread Phil Sorber
On Tue, Aug 2, 2011 at 5:05 PM, Tom Lane t...@sss.pgh.pa.us wrote: Phil Sorber p...@omniti.com writes: I have included two patches in this email. The first (dump_user_config_last_with_set_role.patch) is an extension of my first patch. In addition to moving the ALTER ROLE statements after the

Re: [HACKERS] mosbench revisited

2011-08-04 Thread Robert Haas
On Wed, Aug 3, 2011 at 9:16 PM, Robert Haas robertmh...@gmail.com wrote: Spinlocks seem to have a very ugly tipping point. And on that note, here are oprofile results from pgbench -n -T 300 -S -c 64 -j 64 -M prepared on the latest master branch, compiled with -O2 -fno-omit-frame-pointer.

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-08-04 Thread Robert Haas
On Thu, Aug 4, 2011 at 1:53 PM, Phil Sorber p...@omniti.com wrote: Ok, here is the patch that just moves the ALTER/SET pieces to the end. Can we get this included in the next commit fest? Yep, just make yourself an account and add it. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com

Re: [HACKERS] Transient plans versus the SPI API

2011-08-04 Thread Peter Eisentraut
On tis, 2011-08-02 at 16:47 -0400, Tom Lane wrote: The most straightforward way to reimplement things within spi.c would be to redefine SPI_prepare as just doing the parse-and-rewrite steps, with planning always postponed to SPI_execute. In the case where you just prepare and then execute a

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-08-04 Thread Peter Eisentraut
On ons, 2011-07-27 at 17:57 -0400, Josh Kupershmidt wrote: I think table_name is fine, and if you are very worried, add below that a table_name also includes views (or whatever). It includes tables, views, composite types, and foreign tables. Is table really an appropriate description for

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-08-04 Thread Peter Eisentraut
On ons, 2011-07-27 at 18:08 -0400, Robert Haas wrote: Also, while it may be true that we haven't used the term specifically in SQL sypnoses, it's been extensively used in other parts of the documentation, in the names of system functions such as pg_relation_size(), Well, that thing is just

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-08-04 Thread Robert Haas
On Thu, Aug 4, 2011 at 2:30 PM, Peter Eisentraut pete...@gmx.net wrote: On ons, 2011-07-27 at 18:08 -0400, Robert Haas wrote: Also, while it may be true that we haven't used the term specifically in SQL sypnoses, it's been extensively used in other parts of the documentation, in the names of

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-08-04 Thread Robert Haas
On Thu, Aug 4, 2011 at 2:26 PM, Peter Eisentraut pete...@gmx.net wrote: On ons, 2011-07-27 at 17:57 -0400, Josh Kupershmidt wrote: I think table_name is fine, and if you are very worried, add below that a table_name also includes views (or whatever). It includes tables, views, composite

Re: [HACKERS] Transient plans versus the SPI API

2011-08-04 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: How about a new function like SPI_parse that has the new semantics? Yeah, I'd considered that idea (and even exactly that name for it). Howver, the disadvantage of inventing a separate entry point is that it isn't going to be nice for multi-level call

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-08-04 Thread Kevin Grittner
Peter Eisentraut pete...@gmx.net wrote: According to scientific-ish database literature, a table is a relation and vice versa. I've generally understood the terms more like what is described near the top of this page: http://en.wikipedia.org/wiki/Relation_%28database%29 In SQL, [...] a

Re: [HACKERS] error: could not find pg_class tuple for index 2662

2011-08-04 Thread daveg
On Thu, Aug 04, 2011 at 12:28:31PM -0400, Tom Lane wrote: daveg da...@sonic.net writes: Summary: the failing process reads 0 rows from 0 blocks from the OLD relfilenode. Hmm. This seems to mean that we're somehow missing a relation mapping invalidation message, or perhaps not processing

[HACKERS] possible new feature: asynchronous sql or something like oracles dbms_job.submit

2011-08-04 Thread Vorarlberger
hi i switched back from oracle xe for many reasons and because the lack of pl/java in oralce xe. and posgesql is the best open source db i know! sadly what i realy miss is the possibility of asynchronous sql. which means the need to perform an sql in a completely different new session. something

[HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-08-04 Thread Petro Meier
Normal021false falsefalseDEX-NONEX-NONE MicrosoftInternetExplorer4

[HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Bruce Momjian
We currently have reduced WAL logging for wal_level = minimum for these commands: CREATE TABLE AS CREATE INDEX CLUSTER COPY into tables that were created or truncated in the same transaction One thing we don't optimize is INSERT ... SELECT when the table

Re: [HACKERS] error: could not find pg_class tuple for index 2662

2011-08-04 Thread daveg
On Thu, Aug 04, 2011 at 12:28:31PM -0400, Tom Lane wrote: daveg da...@sonic.net writes: Summary: the failing process reads 0 rows from 0 blocks from the OLD relfilenode. Hmm. This seems to mean that we're somehow missing a relation mapping invalidation message, or perhaps not processing

Re: [HACKERS] possible new feature: asynchronous sql or something like oracles dbms_job.submit

2011-08-04 Thread Joe Conway
On 08/03/2011 09:20 AM, Vorarlberger wrote: sadly what i realy miss is the possibility of asynchronous sql. which means the need to perform an sql in a completely different new session. something i could do in oracle with dbms_job.submit. Would this work for you?

Re: [HACKERS] cataloguing NOT NULL constraints

2011-08-04 Thread Alvaro Herrera
Excerpts from Peter Eisentraut's message of jue ago 04 13:57:54 -0400 2011: On tis, 2011-08-02 at 23:40 -0400, Alvaro Herrera wrote: Thanks. I've done the other changes you suggested, but I don't see that it's desirable to have gram.y emit AT_AddConstraint directly. It seems cleaner to be

Re: [HACKERS] error: could not find pg_class tuple for index 2662

2011-08-04 Thread Tom Lane
daveg da...@sonic.net writes: We are seeing cannot read' and 'cannot open' errors too that would be consistant with trying to use a vanished file. Yeah, these all seem consistent with the idea that the failing backend somehow missed an update for the relation mapping file. You would get the

Re: [HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-08-04 Thread k...@rice.edu
On Wed, Aug 03, 2011 at 03:19:06PM +0200, Petro Meier wrote: Normal021false falsefalseDEX-NONEX-NONE

Re: [HACKERS] Further news on Clang - spurious warnings

2011-08-04 Thread Peter Geoghegan
Can we please commit a fix for this problem? -- Peter Geoghegan       http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-08-04 Thread Tom Lane
Petro Meier petr...@gmx.de writes: INSERT INTO testtable (ID, BinaryContents) values (1, E'\xea2abd8ef3'); returns invalid byte sequence. '\xea2abd8ef3' is the string delivered by the PG 9.1 Beta3 server when calling PQescapeByteaConn(). It

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: One thing we don't optimize is INSERT ... SELECT when the table is created or truncated in the same transaction. Seems we could. We optimize CREATE TABLE AS which is effectively SELECT ... INTO using a different syntax. Is this a TODO? Considering

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Andrew Dunstan
On 08/04/2011 04:55 PM, Tom Lane wrote: Bruce Momjianbr...@momjian.us writes: One thing we don't optimize is INSERT ... SELECT when the table is created or truncated in the same transaction. Seems we could. We optimize CREATE TABLE AS which is effectively SELECT ... INTO using a different

Re: [HACKERS] mosbench revisited

2011-08-04 Thread Aidan Van Dyk
On Wed, Aug 3, 2011 at 5:04 PM, Robert Haas robertmh...@gmail.com wrote:  And hoping that the Linux guys decide to do something about it.  This isn't really our bug - lseek is quite cheap in the uncontended case. Has anyone tried this on a recent kernel (i.e. 2.6.39 or later), where

Re: [HACKERS] error: could not find pg_class tuple for index 2662

2011-08-04 Thread daveg
On Thu, Aug 04, 2011 at 04:16:08PM -0400, Tom Lane wrote: daveg da...@sonic.net writes: We are seeing cannot read' and 'cannot open' errors too that would be consistant with trying to use a vanished file. Yeah, these all seem consistent with the idea that the failing backend somehow

Re: [HACKERS] error: could not find pg_class tuple for index 2662

2011-08-04 Thread Tom Lane
daveg da...@sonic.net writes: On Thu, Aug 04, 2011 at 04:16:08PM -0400, Tom Lane wrote: If this theory is correct then all of the file-related errors ought to match up to recently-vacuumed mapped catalogs or indexes (those are the ones with relfilenode = 0 in pg_class). Do you want to expand

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Bruce Momjian
Andrew Dunstan wrote: On 08/04/2011 04:55 PM, Tom Lane wrote: Bruce Momjianbr...@momjian.us writes: One thing we don't optimize is INSERT ... SELECT when the table is created or truncated in the same transaction. Seems we could. We optimize CREATE TABLE AS which is effectively

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Simon Riggs
On Thu, Aug 4, 2011 at 10:46 PM, Bruce Momjian br...@momjian.us wrote: Right.  I brought up SELECT INTO because you could make the argument that INSERT ... SELECT is not a utility command like the other ones and therefore can't be done easily, but CREATE TABLE AS is internal SELECT INTO and

Re: [HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-08-04 Thread Florian Pflug
On Aug4, 2011, at 22:54 , Tom Lane wrote: Petro Meier petr...@gmx.de writes: INSERT INTO testtable (ID, BinaryContents) values (1, E'\xea2abd8ef3'); returns invalid byte sequence. '\xea2abd8ef3' is the string delivered by the PG 9.1 Beta3 server

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Bruce Momjian
Simon Riggs wrote: On Thu, Aug 4, 2011 at 10:46 PM, Bruce Momjian br...@momjian.us wrote: Right. ?I brought up SELECT INTO because you could make the argument that INSERT ... SELECT is not a utility command like the other ones and therefore can't be done easily, but CREATE TABLE AS is

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Alex Hunsaker
On Thu, Aug 4, 2011 at 09:11, Andrew Dunstan and...@dunslane.net wrote: What *I'd* like is a way to prevent libperl from touching the host application's signal handlers at all.  Sadly, Perl does not actually think of itself as an embedded library, and therefore thinks it owns all resources of

Re: [HACKERS] mosbench revisited

2011-08-04 Thread Robert Haas
On Thu, Aug 4, 2011 at 5:09 PM, Aidan Van Dyk ai...@highrise.ca wrote: On Wed, Aug 3, 2011 at 5:04 PM, Robert Haas robertmh...@gmail.com wrote:      And hoping that the Linux guys decide to do something about it.  This isn't really our bug - lseek is quite cheap in the uncontended case. Has

Re: [HACKERS] Transient plans versus the SPI API

2011-08-04 Thread Jeff Davis
On Tue, 2011-08-02 at 16:47 -0400, Tom Lane wrote: The most straightforward way to reimplement things within spi.c would be to redefine SPI_prepare as just doing the parse-and-rewrite steps, with planning always postponed to SPI_execute. In the case where you just prepare and then execute a

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread David E. Wheeler
On Aug 4, 2011, at 3:09 PM, Alex Hunsaker wrote: Mainly the options im thinking about are: 1) if anyone touches %SIG die 2) turn %SIG into a regular hash so people can set/play with %SIG, but it has no real effect. These would disable stuff like $SIG{__WARN__} and $SIG{__DIE__}, which would

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Alex Hunsaker
On Thu, Aug 4, 2011 at 16:34, David E. Wheeler da...@kineticode.com wrote: On Aug 4, 2011, at 3:09 PM, Alex Hunsaker wrote: Mainly the options im thinking about are: 1) if anyone touches %SIG die 2) turn %SIG into a regular hash so people can set/play with %SIG, but it has no real effect.

Re: [HACKERS] error: could not find pg_class tuple for index 2662

2011-08-04 Thread Tom Lane
Ahh ... you know what, never mind about stack traces, let's just see if the attached patch doesn't fix it. I still haven't reproduced the behavior here, but I think I see what must be happening: we are getting an sinval reset while attempting to open pg_class_oid_index. The latter condition

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Tom Lane
Alex Hunsaker bada...@gmail.com writes: On Thu, Aug 4, 2011 at 16:34, David E. Wheeler da...@kineticode.com wrote: On Aug 4, 2011, at 3:09 PM, Alex Hunsaker wrote: 3) local %SIG before we call their trigger function. This lets signals still work while in trigger scope (like we do for %_TD)

Re: [HACKERS] Transient plans versus the SPI API

2011-08-04 Thread Jeff Davis
On Wed, 2011-08-03 at 12:19 -0400, Tom Lane wrote: Of course we could address the worst cases by providing some mechanism to tell the plancache code always use a generic plan for this query or always use a custom plan. I'm not entirely thrilled with that, because it's effectively a planner

Re: [HACKERS] Transient plans versus the SPI API

2011-08-04 Thread Jeff Davis
On Wed, 2011-08-03 at 13:07 -0400, Robert Haas wrote: A little OT here, but (as I think Simon said elsewhere) I think we really ought to be considering the table statistics when deciding whether or not to replan. It seems to me that the overwhelmingly common case where this is going to come

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Alex Hunsaker
On Thu, Aug 4, 2011 at 17:52, Tom Lane t...@sss.pgh.pa.us wrote: Alex Hunsaker bada...@gmail.com writes: On Thu, Aug 4, 2011 at 16:34, David E. Wheeler da...@kineticode.com wrote: On Aug 4, 2011, at 3:09 PM, Alex Hunsaker wrote: 3) local %SIG before we call their trigger function. This lets

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Jeff Davis
On Thu, 2011-08-04 at 17:46 -0400, Bruce Momjian wrote: Right. I brought up SELECT INTO because you could make the argument that INSERT ... SELECT is not a utility command like the other ones and therefore can't be done easily, but CREATE TABLE AS is internal SELECT INTO and implemented in

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Bruce Momjian
Jeff Davis wrote: On Thu, 2011-08-04 at 17:46 -0400, Bruce Momjian wrote: Right. I brought up SELECT INTO because you could make the argument that INSERT ... SELECT is not a utility command like the other ones and therefore can't be done easily, but CREATE TABLE AS is internal SELECT

Re: [HACKERS] psql: bogus descriptions displayed by \d+

2011-08-04 Thread Jeff Davis
On Thu, 2011-08-04 at 14:20 -0500, Kevin Grittner wrote: Peter Eisentraut pete...@gmx.net wrote: According to scientific-ish database literature, a table is a relation and vice versa. I've generally understood the terms more like what is described near the top of this page:

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Robert Haas
On Thu, Aug 4, 2011 at 8:55 PM, Bruce Momjian br...@momjian.us wrote: Jeff Davis wrote: On Thu, 2011-08-04 at 17:46 -0400, Bruce Momjian wrote: Right.  I brought up SELECT INTO because you could make the argument that INSERT ... SELECT is not a utility command like the other ones and

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Jeff Davis
On Thu, 2011-08-04 at 20:55 -0400, Bruce Momjian wrote: It would act like COPY, meaning the table would have to be truncated or created in the same transaction. Well, in that case it could work for any INSERT. No need for a SELECT to be involved. For that matter, why not make it work for DELETE

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Andrew Dunstan
On 08/04/2011 08:44 PM, Alex Hunsaker wrote: On Thu, Aug 4, 2011 at 17:52, Tom Lanet...@sss.pgh.pa.us wrote: Alex Hunsakerbada...@gmail.com writes: On Thu, Aug 4, 2011 at 16:34, David E. Wheelerda...@kineticode.com wrote: On Aug 4, 2011, at 3:09 PM, Alex Hunsaker wrote: 3) local %SIG

Re: [HACKERS] psql: display of object comments

2011-08-04 Thread Josh Kupershmidt
On Thu, Aug 4, 2011 at 12:26 PM, Robert Haas robertmh...@gmail.com wrote: On Tue, Jul 26, 2011 at 8:38 PM, Josh Kupershmidt schmi...@gmail.com wrote: [new patch] I've committed the portion of this that displays comments on languages and casts. Thanks! For domains and conversions, I am

Re: [HACKERS] PQescapeByteaConn - returns wrong string for PG9.1 Beta3

2011-08-04 Thread Tom Lane
Florian Pflug f...@phlo.org writes: Just to clarify what's going on here, in case the OP is still puzzled. [ lots o detail snipped ] Right. Thanks for writing out what I didn't have time for today... regards, tom lane -- Sent via pgsql-hackers mailing list

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2011-08-04 Thread Alex Hunsaker
On Thu, Aug 4, 2011 at 19:40, Andrew Dunstan and...@dunslane.net wrote: Let's slow down a bit. Nobody that we know of has encountered the problem Tom's referring to, over all the years plperlu has been available. The changes you're proposing have the potential to downgrade the usefulness of

[HACKERS] Re: [GENERAL] Odd VACUUM behavior when it is expected to truncate last empty pages

2011-08-04 Thread Sergey Konoplev
Thank you very much, your explanation helped a lot. This is the tool I needed the solution for http://code.google.com/p/pc-tools/ if you are interested. On 4 August 2011 01:10, Pavan Deolasee pavan.deola...@gmail.com wrote: On Wed, Aug 3, 2011 at 12:33 PM, Pavan Deolasee

Re: [HACKERS] Reduce WAL logging of INSERT SELECT

2011-08-04 Thread Heikki Linnakangas
On 05.08.2011 04:23, Jeff Davis wrote: On Thu, 2011-08-04 at 20:55 -0400, Bruce Momjian wrote: It would act like COPY, meaning the table would have to be truncated or created in the same transaction. Well, in that case it could work for any INSERT. No need for a SELECT to be involved. For