Re: [HACKERS] Missing optimization when filters are applied after window functions

2012-05-22 Thread Hitoshi Harada
On Thu, May 17, 2012 at 7:26 AM, Volker Grabsch wrote: > Hitoshi Harada schrieb: >> On Wed, May 16, 2012 at 12:50 AM, Volker Grabsch >> wrote: >> > I propose the following general optimization: If all window >> > functions are partitioned by the same first field (here: id), >> > then any filter

Re: [HACKERS] Schema version management

2012-05-22 Thread Joel Jacobson
On the topic on fixing pg_dump to dump in a predictable order, can someone please update me on the current state of the problem? I've read though pg_dump_sort.c, and note objects are first sorted in type/name-based ordering, then topologically sorted in a way which "minimize unnecessary rearrangem

Re: [HACKERS] Schema version management

2012-05-22 Thread Joel Jacobson
On Wed, May 23, 2012 at 9:09 AM, Tom Lane wrote: > Thus, not implausibly, causing the dump to fail entirely on some > filesystems.  Case sensitivity, encoding issues, and special characters > in names (eg slashes or backslashes, depending on platform) are > additional pain points.  This does not s

Re: [HACKERS] Draft release notes complete

2012-05-22 Thread Bruce Momjian
On Wed, May 23, 2012 at 01:38:06AM +0400, Alexander Korotkov wrote: > On Wed, May 23, 2012 at 1:26 AM, Bruce Momjian wrote: > > On Thu, May 10, 2012 at 10:22:58PM +0400, Alexander Korotkov wrote: > > "Improve GiST box and point index performance by producing better trees > with >

Re: [HACKERS] Schema version management

2012-05-22 Thread Tom Lane
Joel Jacobson writes: > If the entire function identity arguments would be included in the filename, > two dumps of the same schema in two different databases > would be guaranteed to produce the same dump. > This would render some very long filenames for functions with many arguments, Thus, not

Re: [HACKERS] Proposal: add new field to ErrorResponse and NoticeResponse

2012-05-22 Thread Tatsuo Ishii
> This seems like a rather expensive solution to a problem that I'm not > really convinced is real. Why should a client program care about the > severity level to a greater extent than whether the message is > ErrorResponse or NoticeResponse? In particular, I'm entirely > unconvinced by your clai

Re: [HACKERS] Schema version management

2012-05-22 Thread Joel Jacobson
On Wed, May 23, 2012 at 3:24 AM, Daniel Farina wrote: > Is there a reason why the current directory format could not be > adjusted to become more human-readable friendly for mechanical > reasons?  I realize there is a backwards compatibility problem, but it > may be better than bloating a new opti

Re: [HACKERS] Proposal: add new field to ErrorResponse and NoticeResponse

2012-05-22 Thread Tom Lane
Tatsuo Ishii writes: > I described the problem with possibly localized "S" filed of > ErrorResponse(and NoticeResponse) in Frontend/Backend protocol. > http://archives.postgresql.org/pgsql-hackers/2012-05/msg00912.php > So I would like to propose a solution for this (for 9.3): add new > field to

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Christopher Browne
On Tue, May 22, 2012 at 4:35 PM, Stephen Frost wrote: > * Josh Berkus (j...@agliodbs.com) wrote: >> The local role is preferred, the same way we allow objects in the local >> schema to overshadow objects in the global schema. > > I would think we'd want the exact opposite.  I don't want my global

[HACKERS] Proposal: add new field to ErrorResponse and NoticeResponse

2012-05-22 Thread Tatsuo Ishii
I described the problem with possibly localized "S" filed of ErrorResponse(and NoticeResponse) in Frontend/Backend protocol. http://archives.postgresql.org/pgsql-hackers/2012-05/msg00912.php So I would like to propose a solution for this (for 9.3): add new field to ErrorResponse and NoticeResponse

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Josh Berkus
> That's only true if you try to satisfy both goals at once, which I'm > not suggesting. So I believe that proposition to be false. Oh, ok. Per your original email and follow-up arguments, you seemed to be doing just that. >> An alternative idea -- and one which could be deployed a lot faster -

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Josh Berkus
> The issue with not allowing global spaces to overlap local ones is that > we'd have to check every local list when creating a global account; > that doesn't seem very easy to do. On the flip side, allowing > duplicates between global and local would remove the need to check local > lists when c

Re: [HACKERS] Draft release notes complete

2012-05-22 Thread Alexander Korotkov
On Wed, May 23, 2012 at 1:26 AM, Bruce Momjian wrote: > On Thu, May 10, 2012 at 10:22:58PM +0400, Alexander Korotkov wrote: > > "Improve GiST box and point index performance by producing better trees > with > > less memory allocation overhead (Alexander Korotkov, Heikki Linnakangas, > Kevin > > G

Re: [HACKERS] Add primary key/unique constraint using prefix columns of an index

2012-05-22 Thread Simon Riggs
On 22 May 2012 18:41, Tom Lane wrote: > It'd be better to work on index-organized tables My earlier analysis showed that IOTs are essentially the same thing as block-level indexes, referred to as GITs by Heikki. (Robert referred to these as Lossy Indexes recently, which was not the case - that a

Re: [HACKERS] Draft release notes complete

2012-05-22 Thread Bruce Momjian
On Wed, May 16, 2012 at 10:49:25PM +0300, Heikki Linnakangas wrote: > On 16.05.2012 22:38, Jeff Janes wrote: > >For item: > >Improve COPY performance by adding tuples to the heap in batches > >(Heikki Linnakangas) > > > >I think we should point out that the batching only applies for COPY > >into un

Re: [HACKERS] Draft release notes complete

2012-05-22 Thread Bruce Momjian
On Thu, May 10, 2012 at 10:22:58PM +0400, Alexander Korotkov wrote: > "Improve GiST box and point index performance by producing better trees with > less memory allocation overhead (Alexander Korotkov, Heikki Linnakangas, Kevin > Grittner)" > Is this note about following two commits? > http://git.p

Re: [HACKERS] Add primary key/unique constraint using prefix columns of an index

2012-05-22 Thread Simon Riggs
On 22 May 2012 19:01, Robert Haas wrote: > On Tue, May 22, 2012 at 1:41 PM, Tom Lane wrote: >> Jeff Janes writes: >>> Now that there are index only scans, there is a use case for having a >>> composite index which has the primary key or a unique key as the >>> prefix column(s) but with extra col

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Florian Pflug
On May22, 2012, at 22:35 , Stephen Frost wrote: > * Josh Berkus (j...@agliodbs.com) wrote: >> The local role is preferred, the same way we allow objects in the local >> schema to overshadow objects in the global schema. > > I would think we'd want the exact opposite. I don't want my global > 'pos

Re: [HACKERS] Draft release notes complete

2012-05-22 Thread Bruce Momjian
On Wed, May 16, 2012 at 05:30:27PM -0400, Bruce Momjian wrote: > > I will make the adjustments outlined below as soon as I can. Done and committed. --- > > On Sun, May 13, 2012 at 12:37:52AM -0400, Robert Haas wrote: > > O

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Simon Riggs
On 22 May 2012 18:56, Josh Berkus wrote: > I'm not arguing that we don't have users who would like interdatabase > queries, especially when they port applications from MySQL or MSSQL.  We > have a lot of such users. Lots and lots, yes. > However, we *also* have a lot of users who > would like t

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Ants Aasma
On Tue, May 22, 2012 at 8:28 PM, Robert Haas wrote: > Totally agreed.  We're not the first people to think of this, either: > CLOCK and GLOCK have been extensively studied and found to be almost > as good as LRU in selecting good victim pages, but with less > contention.  That's why people are usi

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Stephen Frost
* Josh Berkus (j...@agliodbs.com) wrote: > The local role is preferred, the same way we allow objects in the local > schema to overshadow objects in the global schema. I would think we'd want the exact opposite. I don't want my global 'postgres' user to be overwritten by some local one that the a

Re: [HACKERS] Schema version management

2012-05-22 Thread Daniel Farina
On Mon, May 21, 2012 at 5:25 PM, Joel Jacobson wrote: > If one want to reuse the splitting to files-code of the directory > format, maybe the existing option -F d could be tweaked to output in > both a a machine-readable format (current way), and also a > human-friendly tree of files and content (

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Daniel Farina
On Tue, May 22, 2012 at 10:56 AM, Josh Berkus wrote: > I'm not arguing that we don't have users who would like interdatabase > queries, especially when they port applications from MySQL or MSSQL.  We > have a lot of such users.  However, we *also* have a lot of users who > would like to treat sepa

Re: [HACKERS] Add primary key/unique constraint using prefix columns of an index

2012-05-22 Thread Vik Reykja
On Tue, May 22, 2012 at 1:36 PM, Simon Riggs wrote: > On 22 May 2012 18:24, Jeff Janes wrote: > > Now that there are index only scans, there is a use case for having a > > composite index which has the primary key or a unique key as the > > prefix column(s) but with extra columns after that. Cu

Re: [HACKERS] Add primary key/unique constraint using prefix columns of an index

2012-05-22 Thread Jeff Janes
On Tue, May 22, 2012 at 10:41 AM, Tom Lane wrote: > Jeff Janes writes: >> Now that there are index only scans, there is a use case for having a >> composite index which has the primary key or a unique key as the >> prefix column(s) but with extra columns after that.  Currently you >> would also n

Re: [HACKERS] WIP: parameterized function scan

2012-05-22 Thread Robert Haas
On Fri, May 11, 2012 at 5:52 PM, Antonin Houska wrote: > Hello, > following this short discussion > http://archives.postgresql.org/message-id/4f5aa202.9020...@gmail.com > I gave it one more try and hacked the optimizer so that function can become > an inner relation in NL join, parametrized with v

Re: [HACKERS] Exclusion Constraints on Arrays?

2012-05-22 Thread David E. Wheeler
On May 22, 2012, at 9:56 AM, Tom Lane wrote: > It seems probably workable given that we expect the pending list to be > of fairly constrained size. However, the commit message referenced > upthread also muttered darkly about GIN's partial match logic not working > in amgettuple. I do not recall

Re: [HACKERS] Add primary key/unique constraint using prefix columns of an index

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 1:41 PM, Tom Lane wrote: > Jeff Janes writes: >> Now that there are index only scans, there is a use case for having a >> composite index which has the primary key or a unique key as the >> prefix column(s) but with extra columns after that.  Currently you >> would also ne

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Josh Berkus
> Why is it OK to allow somebody to access multiple schema in one query, > but not multiple databases? Are you arguing that schemas are also > broken? Because the purpose of a database is to be a Catalog, i.e. an isolated container, which is not the purpose of schemas. To the extent to which we

Re: [HACKERS] Problem with error response message

2012-05-22 Thread Simon Riggs
On 22 May 2012 12:59, Tatsuo Ishii wrote: > Also I wonder why "conflict with recovery" generates same error code > as serialization error. For me it seems not very consistent > choice. IMO, we should assign different error code for at least brings > totally different effect to frontend: aborting

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Daniel Farina
On Tue, May 22, 2012 at 10:43 AM, Simon Riggs wrote: > On 22 May 2012 18:35, Josh Berkus wrote: >> >>> If I have a customer with 1 database per user, how do they run a query >>> against 100 user tables? It would require 100 connections to the >>> database. Doing that would require roughly x100 th

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 1:27 PM, Simon Riggs wrote: > Ack, part from the bit about OIDs no longer being unique. That might > be an upgrade issue but its obviously something we wouldn't allow if > we did that. And how exactly are you going to disallow that? We currently enforce the uniqueness of

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Simon Riggs
On 22 May 2012 18:35, Josh Berkus wrote: > >> If I have a customer with 1 database per user, how do they run a query >> against 100 user tables? It would require 100 connections to the >> database. Doing that would require roughly x100 the planning time and >> x100 the connection delay. Larger SQL

Re: [HACKERS] Add primary key/unique constraint using prefix columns of an index

2012-05-22 Thread Tom Lane
Jeff Janes writes: > Now that there are index only scans, there is a use case for having a > composite index which has the primary key or a unique key as the > prefix column(s) but with extra columns after that. Currently you > would also need another index with exactly the primary/unique key, >

Re: [HACKERS] Add primary key/unique constraint using prefix columns of an index

2012-05-22 Thread Simon Riggs
On 22 May 2012 18:24, Jeff Janes wrote: > Now that there are index only scans, there is a use case for having a > composite index which has the primary key or a unique key as the > prefix column(s) but with extra columns after that.  Currently you > would also need another index with exactly the p

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Josh Berkus
> If I have a customer with 1 database per user, how do they run a query > against 100 user tables? It would require 100 connections to the > database. Doing that would require roughly x100 the planning time and > x100 the connection delay. Larger SQL statements pass their results > between execut

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Simon Riggs
On 22 May 2012 18:18, Josh Berkus wrote: > >> 1. Ability to have a Role that can only access one Database >> >> 2. Allow user info to be dumped with a database, to make a db >> completely self-consistent >> >> 3. Allow databases to be transportable >> >> 4. Allow users to access tables in >1 datab

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Josh Berkus
Stephen, > Which is "preferred" > when you do a 'grant select' or 'grant role'? The local role is preferred, the same way we allow objects in the local schema to overshadow objects in the global schema. > Or do we just disallow > overlaps between per-DB roles and global roles? If we don't all

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 12:39 PM, Tom Lane wrote: > Robert Haas writes: >> If we're going to throw our current algorithm over wholesale, I'd >> rather use some approach that has been demonstrated to work well in >> other systems.  Buffer eviction is a problem that's been around since >> the 1970s

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Simon Riggs
On 22 May 2012 14:05, Robert Haas wrote: > On Tue, May 22, 2012 at 8:40 AM, Andrew Dunstan wrote: >> That seems to be leaving aside the fact that we don't currently have any >> notion of how to allow FDWs to write the foreign tables. >> >> What is more, isn't the postgres FDW about talking to any

[HACKERS] Add primary key/unique constraint using prefix columns of an index

2012-05-22 Thread Jeff Janes
Now that there are index only scans, there is a use case for having a composite index which has the primary key or a unique key as the prefix column(s) but with extra columns after that. Currently you would also need another index with exactly the primary/unique key, which seems like a waste of st

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Josh Berkus
> 1. Ability to have a Role that can only access one Database > > 2. Allow user info to be dumped with a database, to make a db > completely self-consistent > > 3. Allow databases to be transportable > > 4. Allow users to access tables in >1 database easily, with appropriate > rights. The las

Re: [HACKERS] How could we make it simple to access the log as a table?

2012-05-22 Thread David Fetter
On Mon, May 21, 2012 at 05:53:55PM -0700, Josh Berkus wrote: > Hackers, > > There's a lot of great information in the postgres logs. While we > eventually want to get more sophisticated about providing users with > status and history information, for 9.3 it would be really nice to > just offer th

Re: [HACKERS] heap metapages

2012-05-22 Thread Simon Riggs
On 22 May 2012 13:52, Robert Haas wrote: > It seems pretty clear to me that making pg_upgrade responsible for > emptying block zero is a non-starter.  But I don't think that's a > reason to throw out the design; I think it's a problem we can work > around. I like your design better as well *if*

Re: [HACKERS] Exclusion Constraints on Arrays?

2012-05-22 Thread Tom Lane
Robert Haas writes: > On Tue, May 22, 2012 at 12:28 PM, David E. Wheeler > wrote: >> On May 13, 2012, at 3:45 PM, Robert Haas wrote: >>> It seems like maybe we could work around this by remembering the >>> contents of the pending list throughout the scan. Every time we hit a >>> TID while scanni

Re: [HACKERS] Exclusion Constraints on Arrays?

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 12:28 PM, David E. Wheeler wrote: > On May 13, 2012, at 3:45 PM, Robert Haas wrote: > >> It seems like maybe we could work around this by remembering the >> contents of the pending list throughout the scan.  Every time we hit a >> TID while scanning the main index, we check

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Tom Lane
Robert Haas writes: > If we're going to throw our current algorithm over wholesale, I'd > rather use some approach that has been demonstrated to work well in > other systems. Buffer eviction is a problem that's been around since > the 1970s, and our algorithm is just about that old. Um, if you'r

Re: [HACKERS] Why is indexonlyscan so darned slow?

2012-05-22 Thread Jeff Janes
On Mon, May 21, 2012 at 2:29 PM, Merlin Moncure wrote: > On Mon, May 21, 2012 at 4:17 PM, Jeff Janes wrote: >> >> For vaguely real life, take your example of pgbench -i -s200 -F 50, >> and I have 2Gig RAM, which seems to be the same as you do. >> >> With select only work load (pgbench -S -M prepa

Re: [HACKERS] Exclusion Constraints on Arrays?

2012-05-22 Thread David E. Wheeler
On May 13, 2012, at 3:45 PM, Robert Haas wrote: > It seems like maybe we could work around this by remembering the > contents of the pending list throughout the scan. Every time we hit a > TID while scanning the main index, we check whether we already > returned it from the pending list; if so, w

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Florian Pflug
On May22, 2012, at 18:03 , Thom Brown wrote: > On 22 May 2012 16:57, Florian Pflug wrote: >> On May22, 2012, at 16:09 , Tom Lane wrote: >>> Thom Brown writes: Conflicts would occur where localrolename matches an existing local role name within the same database, or a global role name, b

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 12:11 PM, Tom Lane wrote: >> With respect to the control logic for the background writer, one idea >> I had was to get rid of the idea that the background writer's job is >> to write in advance of the strategy point.  Instead, every time the >> clock sweep passes over a dir

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Tom Lane
Thom Brown writes: > On 22 May 2012 16:57, Florian Pflug wrote: >> Maybe we could simply make all global role's OIDs even, and all local ones >> odd, or something like that. > Wouldn't that instantly make all previous versions of database > clusters un-upgradable? IIRC, pg_upgrade doesn't need

Re: [HACKERS] hot standby PSQL 9.1 Windows 2008 Servers

2012-05-22 Thread chinnaobi
Dear Robert, Thank you very much for the reply. You mean when the primary which is going to switch its role to standby might not have sent all the WAL records to the standby and If it is switched to standby it has more WAL records than the standby which is now serves as primary. Is it ?? It is

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Florian Pflug
On May22, 2012, at 18:00 , Susanne Ebrecht wrote: > Am 22.05.2012 17:42, schrieb Tom Lane: >> Encoding yes, but since 9.1 we have pretty fine-grained control of >> collation. So I think this argument is a lot weaker than it used >> to be. It would only really apply if you have one of the corner >

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Tom Lane
Robert Haas writes: > On Tue, May 22, 2012 at 10:25 AM, Tom Lane wrote: >> My own thoughts about this had pointed in the direction of getting rid >> of the central freelist entirely, instead letting each backend run its >> own independent clock sweep as needed. > Hmm, that's certainly an interes

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 12:00 PM, Susanne Ebrecht wrote: > Usually you want to set the collation once per language schema. E.g. schema > russian gets Russian collation and schema British gets British collation and > so on. > > CREATE SCHEMA foo LC_COLLATE bar isn't supported so you went up a level

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Thom Brown
On 22 May 2012 16:57, Florian Pflug wrote: > On May22, 2012, at 16:09 , Tom Lane wrote: >> Thom Brown writes: >>> Conflicts would occur where localrolename matches an existing local >>> role name within the same database, or a global role name, but not a >>> local role name within another databas

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Susanne Ebrecht
Am 22.05.2012 17:42, schrieb Tom Lane: Encoding yes, but since 9.1 we have pretty fine-grained control of collation. So I think this argument is a lot weaker than it used to be. It would only really apply if you have one of the corner cases where utf8 doesn't work for you. Yeah it got better

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 10:25 AM, Tom Lane wrote: >> The idea would be to have a background process (like bgwriter) >> maintain the global LRU state and push candidate buffers onto the >> freelist. > > Amit was trying to convince me of the same idea at PGCon, but I don't > buy it.  bgwriter doesn'

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Florian Pflug
On May22, 2012, at 16:09 , Tom Lane wrote: > Thom Brown writes: >> Conflicts would occur where localrolename matches an existing local >> role name within the same database, or a global role name, but not a >> local role name within another database. The problem with this, >> however, is that cre

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Tom Lane
Susanne Ebrecht writes: > The use case in my mind for accessing more databases is when you want to > access stuff different languages. > You only can set encoding / LC_Collate per database not per schema. > So for different languages you might need different databases to do > correct sorting /

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Susanne Ebrecht
Am 22.05.2012 15:27, schrieb Albe Laurenz: If you need different applications to routinely access each other's tables, why not assign them to different schemas in one database? The use case in my mind for accessing more databases is when you want to access stuff different languages. You only c

Re: [HACKERS] weird error message in sepgsql

2012-05-22 Thread Robert Haas
On Sun, May 20, 2012 at 11:28 AM, Tom Lane wrote: > Peter Eisentraut writes: >> I found this in contrib/sepgsql/expected/label.out: >> SECURITY LABEL ON COLUMN t2 >>     IS 'system_u:object_r:sepgsql_ro_table_t:s0';   -- be failed >> ERROR:  improper relation name (too many dotted names): > >> C

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Tom Lane
Robert Haas writes: > On Tue, May 22, 2012 at 10:01 AM, Tom Lane wrote: >> Well, keep in mind that that action is not merely there to obtain a >> victim buffer; it is also maintaining the global LRU state (by >> decrementing the usage counts of buffers it passes over).  I don't think >> you can c

Re: [HACKERS] Draft release notes complete

2012-05-22 Thread Robert Haas
On Mon, May 21, 2012 at 9:54 PM, Noah Misch wrote: > On Wed, May 09, 2012 at 11:11:02PM -0400, Bruce Momjian wrote: >> I have completed my draft of the 9.2 release notes, and committed it to >> git. > > Concerning "Have psql \copy use libpq's SendQuery()", SendQuery() is a > psql-internal interfac

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Stephen Frost
* Thom Brown (t...@linux.com) wrote: > Conflicts would occur where localrolename matches an existing local > role name within the same database, or a global role name, but not a > local role name within another database. The problem with this, > however, is that creating global roles would need co

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 9:37 AM, Thom Brown wrote: > On 22 May 2012 14:04, Stephen Frost wrote: >> What would the semantics of that look like though?  Which is "preferred" >> when you do a 'grant select' or 'grant role'?  Or do we just disallow >> overlaps between per-DB roles and global roles?  

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Tom Lane
Thom Brown writes: > Conflicts would occur where localrolename matches an existing local > role name within the same database, or a global role name, but not a > local role name within another database. The problem with this, > however, is that creating global roles would need conflict checks > a

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 10:01 AM, Tom Lane wrote: > Robert Haas writes: >> Mind you, I think this whole area of the code needs some reengineering >> for better performance, but I'm not sure this is the right place to >> start.  What I think is really bad is that we're forcing every >> BufferAlloc

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-22 Thread Robert Haas
On Mon, May 14, 2012 at 2:24 PM, Fujii Masao wrote: > On Fri, May 11, 2012 at 11:43 PM, Magnus Hagander wrote: >> Should we go down the easy way and just reject connections when the flag is >> mismatching between the client and the server (trivial to do - see the >> attached patch)? > > +       c

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Tom Lane
Robert Haas writes: > Mind you, I think this whole area of the code needs some reengineering > for better performance, but I'm not sure this is the right place to > start. What I think is really bad is that we're forcing every > BufferAlloc() to iterate over buffers checking whether each one is >

Re: [HACKERS] "could not open relation with OID" errors after promoting the standby to master

2012-05-22 Thread Robert Haas
On Tue, May 15, 2012 at 10:37 PM, Joachim Wieland wrote: > If it matters, I have not promoted the master with a trigger file but > restarted it after deleting recovery.conf. Hmm. I think that if you do it this way, the minimum recovery point won't be respected, which could leave you with a corru

Re: [HACKERS] enhanced error fields

2012-05-22 Thread Robert Haas
On Wed, May 9, 2012 at 9:33 AM, Pavel Stehule wrote: > here is patch with enhancing ErrorData structure. Now constraints > errors and RI uses these fields Please add this to https://commitfest.postgresql.org/action/commitfest_view/open -- Robert Haas EnterpriseDB: http://www.enterprisedb.com Th

Re: [HACKERS] Readme of Buffer Management seems to have wrong sentence

2012-05-22 Thread Robert Haas
On Tue, May 8, 2012 at 9:37 PM, Amit Kapila wrote: > I have checked the code and logic according to which usage counter is > increased when the buffer is pinned. Fixed, thanks for the report. > Another Doubt : Why in function BufferAlloc, it needs to hold the > BufFreelistLock till it pin the bu

Re: [HACKERS] Per-Database Roles

2012-05-22 Thread Thom Brown
On 22 May 2012 14:04, Stephen Frost wrote: > What would the semantics of that look like though?  Which is "preferred" > when you do a 'grant select' or 'grant role'?  Or do we just disallow > overlaps between per-DB roles and global roles?  If we don't allow > duplicates, I suspect a lot of the o

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Albe Laurenz
Simon Riggs wrote: > On 21 May 2012 20:40, Stephen Frost wrote: > >>> This is important. I like the idea of breaking down the barriers >>> between databases to allow it to be an option for one backend to >>> access tables in multiple databases. > So collecting a few requirements from various pla

Re: [HACKERS] ERROR: catalog is missing 2 attribute(s) for relid 16584

2012-05-22 Thread Robert Haas
On Mon, May 14, 2012 at 1:01 AM, Prakash Itnal wrote: > Recently we faced an issue with postgres server where it is throwing error: > > ERROR:  catalog is missing 2 attribute(s) for relid 16584 > CONTEXT:  automatic analyze of table "DBRNW.public.act_wsta" > > I checked in the database and found t

Re: [HACKERS] hot standby PSQL 9.1 Windows 2008 Servers

2012-05-22 Thread Robert Haas
On Mon, May 14, 2012 at 8:18 AM, chinnaobi wrote: > I do base backup only first time on standby when it is going to be > replicated. when ever primary goes down,  standby becomes primary and > primary becomes standby when primary comes up. When primary becomes standby > I am restoring data from WA

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 8:40 AM, Andrew Dunstan wrote: > That seems to be leaving aside the fact that we don't currently have any > notion of how to allow FDWs to write the foreign tables. > > What is more, isn't the postgres FDW about talking to any postgres source? > If so, does it have special

[HACKERS] Per-Database Roles

2012-05-22 Thread Stephen Frost
* Simon Riggs (si...@2ndquadrant.com) wrote: > * Ability to have a Role that can only access one Database Alright, I'd like to think about this one specifically and solicit feedback on the idea that we keep the existing shared role tables but add on additional tables for per-database roles. In th

Re: [HACKERS] heap metapages

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 4:52 AM, Simon Riggs wrote: > Based upon all you've said, I'd suggest that we make a new kind of > fork, in a separate file for this, .meta. But we also optimise the VM > and FSM in the way you suggest so that we can replace .vm and .fsm > with just .meta in most cases. Big

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Andrew Dunstan
On 05/22/2012 07:56 AM, Robert Haas wrote: On Tue, May 22, 2012 at 7:35 AM, Florian Pflug wrote: * Allow users to access tables in>1 database easily, with appropriate rights. That one I'm very sceptical about. In the long run, I think we want better separation of databases, not less, and thi

Re: [HACKERS] Getting rid of cheap-startup-cost paths earlier

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 1:50 AM, Tom Lane wrote: > Currently, the planner keeps paths that appear to win on the grounds of > either cheapest startup cost or cheapest total cost.  It suddenly struck > me that in many simple cases (viz, those with no LIMIT, EXISTS, cursor > fast-start preference, et

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Florian Pflug
On May22, 2012, at 13:47 , Simon Riggs wrote: > On 22 May 2012 12:35, Florian Pflug wrote: >>> * Allow users to access tables in >1 database easily, with appropriate >>> rights. >> >> That one I'm very sceptical about. In the long run, I think we want better >> separation of databases, not less,

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread José Luis Tallón
On 22/05/12 13:47, Simon Riggs wrote: On 22 May 2012 12:35, Florian Pflug wrote: * Allow users to access tables in>1 database easily, with appropriate rights. That one I'm very sceptical about. In the long run, I think we want better separation of databases, not less, and this requirement carr

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread José Luis Tallón
On 22/05/12 13:24, Simon Riggs wrote: On 22 May 2012 12:05, José Luis Tallón wrote: IMVHO: s/database/schema/g does resolve many of the problems that you were referring to... and 'dblink' should solve the rest, right? Please, feel free to point out what I am (most probably) not considering --

[HACKERS] Problem with error response message

2012-05-22 Thread Tatsuo Ishii
Hi, ErrorResponse message from backend has some field type codes include: S Severity: the field contents are ERROR, FATAL, or PANIC (in an error message), or WARNING, NOTICE, DEBUG, INFO, or LOG (in a notice message), or a localized translation of one of these. Always present. C

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Robert Haas
On Tue, May 22, 2012 at 7:35 AM, Florian Pflug wrote: >> * Allow users to access tables in >1 database easily, with appropriate >> rights. > > That one I'm very sceptical about. In the long run, I think we want better > separation of databases, not less, and this requirement carries a huge risk >

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Simon Riggs
On 22 May 2012 12:35, Florian Pflug wrote: >> * Allow users to access tables in >1 database easily, with appropriate >> rights. > > That one I'm very sceptical about. In the long run, I think we want better > separation of databases, not less, and this requirement carries a huge risk > of standi

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Florian Pflug
On May22, 2012, at 11:46 , Simon Riggs wrote: > * Ability to have a Role that can only access one Database > > * Allow user info to be dumped with a database, to make a db > completely self-consistent These two could be achieved by having database-local roles I think. > * Allow databases to be t

Re: [HACKERS] Getting rid of cheap-startup-cost paths earlier

2012-05-22 Thread Simon Riggs
On 22 May 2012 12:12, PostgreSQL - Hans-Jürgen Schönig wrote: > > On May 22, 2012, at 9:57 AM, Simon Riggs wrote: > >> On 22 May 2012 06:50, Tom Lane wrote: >> >>> Currently, the planner keeps paths that appear to win on the grounds of >>> either cheapest startup cost or cheapest total cost.  It

Re: [HACKERS] Patch: add conversion from pg_wchar to multibyte

2012-05-22 Thread Tatsuo Ishii
> Thanks for your comments. They clarify a lot. > But I still don't realize how can we distinguish IS_LCPRV2 and IS_LC2? > Isn't it possible for them to produce same pg_wchar? If LB is in 0x90 - 0x99 range, then they are LC2. If LB is in 0xf0 - 0xff range, then they are LCPRV2. -- Tatsuo Ishii SRA

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Simon Riggs
On 22 May 2012 12:05, José Luis Tallón wrote: > IMVHO:  s/database/schema/g does resolve many of the problems that you were > referring to... and 'dblink' should solve the rest, right? > Please, feel free to point out what I am (most probably) not considering -- > not experienced enough yet :) T

Re: [HACKERS] Getting rid of cheap-startup-cost paths earlier

2012-05-22 Thread PostgreSQL - Hans-Jürgen Schönig
On May 22, 2012, at 9:57 AM, Simon Riggs wrote: > On 22 May 2012 06:50, Tom Lane wrote: > >> Currently, the planner keeps paths that appear to win on the grounds of >> either cheapest startup cost or cheapest total cost. It suddenly struck >> me that in many simple cases (viz, those with no LI

Re: [HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread José Luis Tallón
On 22/05/12 11:46, Simon Riggs wrote: On 21 May 2012 20:40, Stephen Frost wrote: This is important. I like the idea of breaking down the barriers between databases to allow it to be an option for one backend to access tables in multiple databases. The current mechanism doesn't actually prevent

Re: [HACKERS] Patch: add conversion from pg_wchar to multibyte

2012-05-22 Thread Alexander Korotkov
On Tue, May 22, 2012 at 11:50 AM, Tatsuo Ishii wrote: > > I think it's possible. The first characters are defined like this: > > #define IS_LCPRV1(c)((unsigned char)(c) == 0x9a || (unsigned char)(c) > == 0x9b) > #define IS_LCPRV2(c)((unsigned char)(c) == 0x9c || (unsigned char)(c) > == 0x9

[HACKERS] Changing the concept of a DATABASE

2012-05-22 Thread Simon Riggs
On 21 May 2012 20:40, Stephen Frost wrote: >> This is important. I like the idea of breaking down the barriers >> between databases to allow it to be an option for one backend to >> access tables in multiple databases. The current mechanism doesn't >> actually prevent looking at data from other d

Re: [HACKERS] heap metapages

2012-05-22 Thread Simon Riggs
On 22 May 2012 02:50, Robert Haas wrote: >> Not very sure why a metapage is better than a catalog table. > > Mostly because there's no chance of the startup process accessing a > catalog table during recovery, but it can read a metapage. OK, sounds reasonable. Based upon all you've said, I'd su

Re: [HACKERS] Getting rid of cheap-startup-cost paths earlier

2012-05-22 Thread Simon Riggs
On 22 May 2012 06:50, Tom Lane wrote: > Currently, the planner keeps paths that appear to win on the grounds of > either cheapest startup cost or cheapest total cost.  It suddenly struck > me that in many simple cases (viz, those with no LIMIT, EXISTS, cursor > fast-start preference, etc) we coul

  1   2   >