Re: [HACKERS] Inserting heap tuples in bulk in COPY

2011-09-25 Thread Kohei KaiGai
Hi Heikki, I checked your patch, then I have a comment and two questions here. The heap_prepare_insert() seems a duplication of code with earlier half of existing heap_insert(). I think it is a good question to consolidate these portion of the code. I'm not clear the reason why the argument of

Re: [HACKERS] Inserting heap tuples in bulk in COPY

2011-09-25 Thread Dean Rasheed
On 25 September 2011 09:43, Kohei KaiGai kai...@kaigai.gr.jp wrote: Hi Heikki, I checked your patch, then I have a comment and two questions here. 2011/9/14 Heikki Linnakangas heikki.linnakan...@enterprisedb.com: Attached is a new version of the patch. It is now complete, including WAL

Re: [HACKERS] fix for pg_upgrade

2011-09-25 Thread panam
OK, i started once again: I hope the following is the correct way of querying the table corresponding to a relid: -- View this message in context: http://postgresql.1045698.n5.nabble.com/fix-for-pg-upgrade-tp3411128p4838427.html Sent from the PostgreSQL - hackers mailing list archive

Re: [HACKERS] TABLE tab completion

2011-09-25 Thread Dean Rasheed
On 24 September 2011 11:59, Magnus Hagander mag...@hagander.net wrote: TABLE tab completion in psql only completes to tables, not views. but the TABLE command works fine for both tables and views (and also sequences). Seems we should just complete it to relations and not tables - or can

Re: [HACKERS] posix_fadvsise in base backups

2011-09-25 Thread Andres Freund
Hi Greg, On Sunday, September 25, 2011 03:25:50 AM Greg Stark wrote: On Sat, Sep 24, 2011 at 4:16 PM, Magnus Hagander mag...@hagander.net wrote: I was assuming the kernel was smart enough to read this as *this* process is not going to be using this file anymore, not nobody in the whole

Re: [HACKERS] [v9.2] Fix Leaky View Problem

2011-09-25 Thread Robert Haas
On Sat, Sep 24, 2011 at 5:37 PM, Noah Misch n...@leadboat.com wrote: On Fri, Sep 23, 2011 at 06:25:01PM -0400, Robert Haas wrote: On Mon, Sep 12, 2011 at 3:31 PM, Kohei KaiGai kai...@kaigai.gr.jp wrote: The Part-1 implements corresponding SQL syntax stuffs which are security_barrier

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

2011-09-25 Thread Robert Haas
On Sat, Sep 24, 2011 at 3:49 PM, Joshua Berkus j...@agliodbs.com wrote: Since we haven't yet come up with a reasonable way of machine-editing postgresql.conf, this seems like a fairly serious objection to getting rid of recovery.conf.  I wonder if there's a way we can work around that...

Re: [HACKERS] Inserting heap tuples in bulk in COPY

2011-09-25 Thread Robert Haas
On Wed, Sep 14, 2011 at 6:52 AM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: Why do you need new WAL replay routines?  Can't you just use the existing XLOG_HEAP_NEWPAGE support? By any large, I think we should be avoiding special-purpose WAL entries as much as possible. I

Re: [HACKERS] [GENERAL] Alter column...using failure under 9.0.4

2011-09-25 Thread Tom Lane
=?iso-8859-1?Q?Bj=F6rn_H=E4user?= bjoernhaeu...@gmail.com writes: Am 25.09.2011 um 17:17 schrieb Edson Carlos Ericksson Richter: alter table usuario alter column ativo type smallint using (case when ativo then 1 else 0 end); ERROR: argument of IS FALSE must be type boolean, not type smallint

[HACKERS] RES: [GENERAL] Alter column...using failure under 9.0.4

2011-09-25 Thread Edson Carlos Ericksson Richter
That's it: a check constraint I was not aware of... Thanks! Edson -Mensagem original- De: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] Em nome de Tom Lane Enviada em: domingo, 25 de setembro de 2011 13:04 Para: pgsql-gene...@postgresql.org;

Re: [HACKERS] [v9.2] Fix Leaky View Problem

2011-09-25 Thread Kevin Grittner
Robert Haas 09/25/11 10:58 AM I'm not sure we've been 100% consistent about that, since we previously made CREATE OR REPLACE LANGUAGE not replace the owner with the current user. I think we've been consistent in *not* changing security on an object when it is replaced. test=# create user

Re: [HACKERS] Inserting heap tuples in bulk in COPY

2011-09-25 Thread Kevin Grittner
Kohei KaiGai wrote: I'm not clear the reason why the argument of CheckForSerializableConflictIn() was changed from the one in heap_insert(). The code was probably just based on heap_insert() before this recent commit:

Re: [HACKERS] Adding CORRESPONDING to Set Operations

2011-09-25 Thread Tom Lane
Kerem Kat kerem...@gmail.com writes: On Sat, Sep 24, 2011 at 19:51, Tom Lane t...@sss.pgh.pa.us wrote: Why? CORRESPONDING at a given set-operation level doesn't affect either sub-query, so I don't see why you'd need a different representation for the sub-queries. In the planner to construct

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

2011-09-25 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: On Sat, Sep 24, 2011 at 6:01 PM, Tom Lane t...@sss.pgh.pa.us wrote: Okay, so you do agree that eventually we want to be rid of recovery.conf?  I think everyone else agrees on that.  But if we are going to remove recovery.conf eventually, what is the

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

2011-09-25 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sep 24, 2011, at 1:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: I don't exactly buy this argument. If postgresql.conf is hard to machine-edit, why is recovery.conf any easier? Because you generally just write a brand-new file, without worrying about

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

2011-09-25 Thread Joshua Berkus
Folks, What happens currently if we have an \include in postgresql.conf for a file which doesn't exist? Is it ignored, or do we error out? If it could just be ignored, maybe with a note in the logs, then we could be a lot more flexible. --Josh Berkus -- Sent via pgsql-hackers mailing list

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

2011-09-25 Thread Tom Lane
Joshua Berkus j...@agliodbs.com writes: What happens currently if we have an \include in postgresql.conf for a file which doesn't exist? Is it ignored, or do we error out? It's an error, and I think changing that would be a really bad idea. If it could just be ignored, maybe with a note in

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

2011-09-25 Thread Joshua Berkus
There might be a use case for a separate directive include_if_exists, or some such name. But I think the user should have to tell us very clearly that it's okay for the file to not be found. Better to go back to include_directory, then. --Josh Berkus -- Sent via pgsql-hackers mailing

Re: [HACKERS] index-only scans

2011-09-25 Thread Marti Raudsepp
On Sun, Aug 14, 2011 at 00:31, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: That is somewhat compensated by the fact that tuples that are accessed more often are also more likely to be in cache. Fetching the heap tuple to check visibility is very cheap when the tuple is in

Re: [HACKERS] Range Types - symmetric

2011-09-25 Thread Jeff Davis
On Sat, 2011-09-24 at 10:49 -0400, Bruce Momjian wrote: I'll add that it would also cause a little confusion with inclusivity. What if you do: '[5,2)'::int4range? Is that really '[2,5)' or '(2,5]'? Reminder: BETWEEEN supports the SYMMETRIC keyword, so there is a precedent for this. And I

Re: [HACKERS] Range Types - symmetric

2011-09-25 Thread Joshua Berkus
Reminder: BETWEEEN supports the SYMMETRIC keyword, so there is a precedent for this. And I don't see it as valuable enough to justify changing the grammar. I agree that we should leave symmetry until 9.3. --Josh Berkus -- Sent via pgsql-hackers mailing list

[HACKERS] Re: [PATCH] Caching for stable expressions with constant arguments v3

2011-09-25 Thread Joshua Berkus
All, I'd love to see someone evaluate the impact of Marti's patch on JDBC applications which use named prepared statements. Anyone have a benchmark handy? --Josh -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] [v9.2] Fix Leaky View Problem

2011-09-25 Thread Kohei KaiGai
2011/9/24 Robert Haas robertmh...@gmail.com: On Mon, Sep 12, 2011 at 3:31 PM, Kohei KaiGai kai...@kaigai.gr.jp wrote: I updated the patches of fix-leaky-view problem, according to the previous discussion. The NOLEAKY option was replaced by LEAKPROOF option, and several regression test cases

Re: [HACKERS] [v9.2] database object class of contrib/sepgsql

2011-09-25 Thread Kohei KaiGai
2011/9/23 Robert Haas robertmh...@gmail.com: On Mon, Sep 12, 2011 at 5:45 AM, Kohei KaiGai kai...@kaigai.gr.jp wrote: The attached patch is a portion that we splitted off when we added pg_shseclabel system catalog. It enables the control/sepgsql to assign security label on pg_database

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

2011-09-25 Thread Joshua Berkus
I rather like Tom's suggestion of include_if_exists. include_if_exists certainly solves the recovery.conf/recovery.done problem. We can even phase it out, like this: 9.2: include_if_exists = 'recovery.conf' in the default postgresql.conf file. 9.3: include_if_exists = 'recovery.conf'

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

2011-09-25 Thread Tom Lane
Joshua Berkus j...@agliodbs.com writes: include_if_exists certainly solves the recovery.conf/recovery.done problem. We can even phase it out, like this: 9.2: include_if_exists = 'recovery.conf' in the default postgresql.conf file. 9.3: include_if_exists = 'recovery.conf' commented out by

Re: [HACKERS] [v9.2] DROP statement reworks

2011-09-25 Thread Dimitri Fontaine
Hi, Kohei KaiGai kai...@kaigai.gr.jp writes: 2011/8/15 Kohei KaiGai kai...@kaigai.gr.jp: The attached three patches try to consolidate code path of DROP statement on various kind of object classes. These are rebased to the latest tree, and the part-3 portion also consolidates DROP OPERATOR

Re: [HACKERS] fix for pg_upgrade

2011-09-25 Thread Bruce Momjian
panam wrote: OK, i started once again: I hope the following is the correct way of querying the table corresponding to a relid: -- View this message in context: http://postgresql.1045698.n5.nabble.com/fix-for-pg-upgrade-tp3411128p4838427.html Yes, that is very close to

[HACKERS] Re: Optimizing pg_trgm makesign() (was Re: WIP: Fast GiST index build)

2011-09-25 Thread Kevin Grittner
This is a review of the patch at this CF location: https://commitfest.postgresql.org/action/patch_view?id=598 as posted here: http://archives.postgresql.org/message-id/4e04c099.3020...@enterprisedb.com This patch applied cleanly and compiled without warning. It performed correctly. Since

Re: [HACKERS] index-only scans

2011-09-25 Thread Robert Haas
On Sun, Sep 25, 2011 at 2:43 PM, Marti Raudsepp ma...@juffo.org wrote: On Sun, Aug 14, 2011 at 00:31, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: That is somewhat compensated by the fact that tuples that are accessed more often are also more likely to be in cache. Fetching

Re: [HACKERS] [v9.2] Fix Leaky View Problem

2011-09-25 Thread Robert Haas
On Sun, Sep 25, 2011 at 3:25 PM, Kohei KaiGai kai...@kaigai.gr.jp wrote: I'm a bit nervous about storing security_barrier in the RTE.  What happens to stored rules if the security_barrier option gets change later? The rte-security_barrier is evaluated when a query referencing security views

[HACKERS] contrib/sepgsql regression tests are a no-go

2011-09-25 Thread Tom Lane
So I thought it would be a good idea to enable contrib/sepgsql in the Fedora build of 9.1. This soon crashed and burned, though, because (1) if you build sepgsql, there is no way to omit the sepgsql regression tests, other than by not regression-testing contrib at all. I didn't see that as a

Re: [HACKERS] Re: Optimizing pg_trgm makesign() (was Re: WIP: Fast GiST index build)

2011-09-25 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: This is a review of the patch at this CF location: https://commitfest.postgresql.org/action/patch_view?id=598 as posted here: http://archives.postgresql.org/message-id/4e04c099.3020...@enterprisedb.com Hmm, why is that patch the one posted

Re: [HACKERS] Re: Optimizing pg_trgm makesign() (was Re: WIP: Fast GiST index build)

2011-09-25 Thread Kevin Grittner
Tom Lane wrote: Kevin Grittner writes: This is a review of the patch at this CF location: https://commitfest.postgresql.org/action/patch_view?id=598 as posted here: http://archives.postgresql.org/message-id/4e04c099.3020...@enterprisedb.com Hmm, why is that patch the one posted for

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

2011-09-25 Thread Steve Singer
On 11-09-22 09:24 AM, Fujii Masao wrote: On Wed, Sep 21, 2011 at 11:50 AM, Fujii Masaomasao.fu...@gmail.com wrote: 2011/9/13 Jun Ishidukaishizuka@po.ntts.co.jp: Update patch. Changes: * set 'on' full_page_writes by user (in document) * read FROM: XX in backup_label (in xlog.c) *

Re: [HACKERS] [v9.2] Fix Leaky View Problem

2011-09-25 Thread Noah Misch
On Sun, Sep 25, 2011 at 11:22:03AM -0500, Kevin Grittner wrote: Robert Haas 09/25/11 10:58 AM I'm not sure we've been 100% consistent about that, since we previously made CREATE OR REPLACE LANGUAGE not replace the owner with the current user. I think we've been consistent in *not*

Re: [HACKERS] [v9.2] Fix Leaky View Problem

2011-09-25 Thread Robert Haas
On Sun, Sep 25, 2011 at 10:38 PM, Noah Misch n...@leadboat.com wrote: On Sun, Sep 25, 2011 at 11:22:03AM -0500, Kevin Grittner wrote: Robert Haas  09/25/11 10:58 AM I'm not sure we've been 100% consistent about that, since we previously made CREATE OR REPLACE LANGUAGE not replace the owner

Re: [HACKERS] Inlining comparators as a performance optimisation

2011-09-25 Thread Robert Haas
On Sun, Sep 25, 2011 at 10:12 PM, Peter Geoghegan pe...@2ndquadrant.com wrote: [ new results ] Nice results. I think these are far more convincing than the last set, because (1) the gains are bigger and (2) they survive -O2 and (3) you tested an actual query, not just qsort() itself. I don't

Re: [HACKERS] contrib/sepgsql regression tests are a no-go

2011-09-25 Thread Robert Haas
On Sun, Sep 25, 2011 at 9:07 PM, Tom Lane t...@sss.pgh.pa.us wrote: As a stopgap, what about removing sepgsql from the list of contrib modules tested by make -C contrib check? +1. In fact, I've been wondering if we ought to go a step further and not recurse into the sepgsql directory for *any*

Re: [HACKERS] contrib/sepgsql regression tests are a no-go

2011-09-25 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sun, Sep 25, 2011 at 9:07 PM, Tom Lane t...@sss.pgh.pa.us wrote: As a stopgap, what about removing sepgsql from the list of contrib modules tested by make -C contrib check? +1. In fact, I've been wondering if we ought to go a step further and not

Re: [HACKERS] contrib/sepgsql regression tests are a no-go

2011-09-25 Thread Robert Haas
On Mon, Sep 26, 2011 at 12:06 AM, Tom Lane t...@sss.pgh.pa.us wrote: Then we could get rid of the associated configure option, which no longer serves any other purpose, and just say that if you want to build (or regression-test) sepgsql, well, you gotta go to that directory and do it by hand.

[HACKERS] Support UTF-8 files with BOM in COPY FROM

2011-09-25 Thread Itagaki Takahiro
Hi, I'd like to support UTF-8 text or csv files that has BOM (byte order mark) in COPY FROM command. BOM will be automatically detected and ignored if the file encoding is UTF-8. WIP patch attached. I'm thinking about only COPY FROM for reads, but if someone wants to add BOM in COPY TO, we might