Re: [GENERAL] Curious unnest behavior

2013-01-03 Thread Patrick Krecker
I have to say, this seems straightforward to me. An array with N elements gets N rows in the result set. I'm curious what other behavior would be more reasonable. On Thu, Jan 3, 2013 at 11:22 AM, Jeff Trout wrote: > I just ran into an interesting thing with unnest and empty arrays. > > create

[GENERAL] Unable to reload postgresql.conf without restarting

2013-01-03 Thread Jose Martinez
Hi, I made some changes to postgresql.conf and I want them to take effect without having to restart the server. I tried select pg_reload_conf(); /usr/pgsql-9.1/bin/pg_ctl reload but when I do 'show all', I see no changes take effect. There settings I tried to change are: -effective_cache_size

[GENERAL] Curious unnest behavior

2013-01-03 Thread Jeff Trout
I just ran into an interesting thing with unnest and empty arrays. create table x ( a int, b int[] ); insert into x(a,b) values (1, '{}'); insert into x(a,b) values (1, '{}'); insert into x(a,b) values (1, '{}'); select a, b from x; select a, unnest(b) from x; insert into x(a,b)

Re: [GENERAL] alter default privileges problem

2013-01-03 Thread Tom Lane
"Gauthier, Dave" writes: > create user "select" password 'select'; > create user "insert" password 'insert'; > alter default privileges for user "insert" grant select on tables to "select"; > alter default privileges for user "insert" grant select on sequences to > "select"; > alter default privi

[GENERAL] Unnecessary files that can be deleted/moved in cluster dir?

2013-01-03 Thread John Abraham
I have a little problem, I let my drive get too full. And then while I was deleting rows to free space, the auto vacuum didn't kick in quite the way I expected, and I ran out of space entirely. So the DB shut down and won't start back up. So is there anything ( other than the logs in pg_log

Re: [GENERAL] alter default privileges problem

2013-01-03 Thread Gauthier, Dave
The fix had to do with connecting as the "insert" user, then setting the default privs. My mistake was to run the "alter default privileges..." as the superuser. From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Gauthier, Dave Sent: Thursday, J

Re: [GENERAL] Large number of rows in pg_type and slow gui (pgadmin) refresh

2013-01-03 Thread Thomas Kellerer
Robert Klaus wrote on 03.01.2013 18:45: Yes, I consider it a tool issue and not a database issue. Is there somewhere else I should be posting this to? There is a pgAdmin mailing list, see here: http://www.postgresql.org/community/lists/ Thomas -- Sent via pgsql-general mailing list (pg

Re: [GENERAL] [ADMIN] Unable to reload postgresql.conf without restarting

2013-01-03 Thread Jerry Sievers
Jose Martinez writes: > Hi, > > I made some changes to?postgresql.conf and I want them to take effect without > having to restart the server. Check your server log for any report of a syntax error in your .conf file. If there is one, that will prevent the changes being loaded. pg_reload_conf(

[GENERAL] alter default privileges problem

2013-01-03 Thread Gauthier, Dave
v9.1 on linux Connect to postgres DB, then... create user "select" password 'select'; create user "insert" password 'insert'; alter default privileges for user "insert" grant select on tables to "select"; alter default privileges for user "insert" grant select on sequences to "select"; alter def

Re: [GENERAL] Large number of rows in pg_type and slow gui (pgadmin) refresh

2013-01-03 Thread Robert Klaus
Yes, I consider it a tool issue and not a database issue. Is there somewhere else I should be posting this to? Thanks, Robert -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Thomas Kellerer Sent: Thursday, January 03,

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Bèrto ëd Sèra
Hi again, > I understand it and for this reason I said to "use some strategy to purge > old historical data *OR* make your audit tables partitioned"... yes, prepare to scale up in any case, even if it seems to be a remote chance ATM. If the "untouched" nature of this data is so critical, you have

Re: [GENERAL] [ADMIN] Unable to reload postgresql.conf without restarting

2013-01-03 Thread sk baji
> Hi, > > I made some changes to postgresql.conf and I want them to take effect without > having to restart the server. > > I tried > > select pg_reload_conf(); > /usr/pgsql-9.1/bin/pg_ctl reload > > but when I do 'show all', I see no changes take effect. > > There settings I tried to change are: >

Re: [GENERAL] [ADMIN] Unable to reload postgresql.conf without restarting

2013-01-03 Thread Matheus de Oliveira
On Thu, Jan 3, 2013 at 2:25 PM, Jose Martinez wrote: > Hi, > > I made some changes to postgresql.conf and I want them to take effect > without having to restart the server. > > I tried > > select pg_reload_conf(); > /usr/pgsql-9.1/bin/pg_ctl reload > > but when I do 'show all', I see no changes ta

Re: [GENERAL] Large number of rows in pg_type and slow gui (pgadmin) refresh

2013-01-03 Thread Thomas Kellerer
Robert Klaus wrote on 03.01.2013 16:50: We have 36,000+ rows returned by " SELECT oid, format_type(oid, typtypmod) AS typname FROM pg_type". My manager says this is only a small number compared to what is expected by next summer. Why do you need so many types? That sounds like something in you

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Fabrízio de Royes Mello
On Thu, Jan 3, 2013 at 2:50 PM, Rich Shepard wrote: > > There should not be many changes in these tables. Ok. > > And historical data > cannot be purged or the purpose of maintaining a history is lost. The > history is valuable for tracking changes over time in regulatory agency > staff and to

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
On Thu, 3 Jan 2013, Bèrto ëd Sèra wrote: if it's a strict legal requirement you may want to enforce it with a trigger system, so that each time a record is inserted/updated/deleted you create an exact copy of it in a historical table, that has the original record plus data about who performed th

Re: [GENERAL] [ADMIN] Unable to reload postgresql.conf without restarting

2013-01-03 Thread Bruce Momjian
On Thu, Jan 3, 2013 at 11:25:41AM -0500, Jose Martinez wrote: > Hi, > > I made some changes to postgresql.conf and I want them to take effect without > having to restart the server. > > I tried > > select pg_reload_conf(); > /usr/pgsql-9.1/bin/pg_ctl reload > > but when I do 'show all', I see

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Bèrto ëd Sèra
Hi Rich, if it's a strict legal requirement you may want to enforce it with a trigger system, so that each time a record is inserted/updated/deleted you create an exact copy of it in a historical table, that has the original record plus data about who performed the operation, when, from which IP,

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
On Thu, 3 Jan 2013, Adrian Klaver wrote: As a matter of course I include fields to record the timestamp and user for insert of records and last update of record on my tables. Adrian, This is a useful addition to the application. For a relatively simple solution see this blog post I put up

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
On Thu, 3 Jan 2013, Fabrízio de Royes Mello wrote: And keep in mind that kind of table tend to grow quickly, so you must use some strategy to purge old historical data or make your audit table partitioned... Fabrizio, There should not be many changes in these tables. And historical data can

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Fabrízio de Royes Mello
On Thu, Jan 3, 2013 at 2:09 PM, Adrian Klaver wrote: > > On 01/03/2013 07:38 AM, Rich Shepard wrote: > >>The middleware of the application needs to check this table when data >> are >> to be viewed in the UI and present only the current row contents. A >> separate >> view would display a histo

Re: [GENERAL] Corrupt indexes on slave when using pg_bulkload on master

2013-01-03 Thread James Cowell
Hi Jeff (and group)   Was the reproduction information sufficient?   Do I need to submit this officially as a bug or something?   At the moment I'm considering rebuilding my cluster with 9.0 to see if that works and if not then reverting back to 9.1 but loading each DB seperately.  I would really

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Adrian Klaver
On 01/03/2013 07:38 AM, Rich Shepard wrote: The middleware of the application needs to check this table when data are to be viewed in the UI and present only the current row contents. A separate view would display a history of changes for that row. All thoughts, suggestions, and recommen

[GENERAL] Large number of rows in pg_type and slow gui (pgadmin) refresh

2013-01-03 Thread Robert Klaus
We have 36,000+ rows returned by " SELECT oid, format_type(oid, typtypmod) AS typname FROM pg_type". My manager says this is only a small number compared to what is expected by next summer. When I run this select statement on the database server it returns in under 1 second but it takes a m

[GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
I have the need to develop an application that will use postgres as the back end, and most of the design has been worked out, but I've one issue left to resolve and want help in this. If this is not the appropriate forum for this type of question, please point me in the right direction. For s

Re: [GENERAL] Postgresql 9.1 - select statement with multiple "with-clauses" becomes very slow

2013-01-03 Thread Opel Fahrer
Hi Alban, thanks a lot - didn't realize it was so simple. It works like a charm! Cheers Von: Alban Hertroys An: Opel Fahrer CC: "pgsql-general@postgresql.org" Gesendet: 13:25 Donnerstag, 3.Januar 2013 Betreff: Re: [GENERAL] Postgresql 9.1 - select stateme

Re: [GENERAL] Postgresql 9.1 - select statement with multiple "with-clauses" becomes very slow

2013-01-03 Thread Alban Hertroys
You're ending up with something that's basically a carthesian product of closebuildings and closebuildingdescriptions. Your query looks like a simple join would serve just fine, something like: prepare getmydata(real,real,real) AS ( select image, data from info inner join buildings on (buildings.

[GENERAL] Postgresql 9.1 - select statement with multiple "with-clauses" becomes very slow

2013-01-03 Thread Opel Fahrer
I'm a noob in writing efficient Postgres queries, so I wrote a first function to query multiple linked tables using the PostGIS extension. The query should fetch data from multiple tables and finally give me a table with two columns. Here's the code: [code]     prepare getmydata(real,real,real)

Re: [GENERAL] PostgreSQL run as process in windows

2013-01-03 Thread Alban Hertroys
FYI: There's a kernel sockets leak in the 64-bit edition of that OS in combination with multiple CPU cores (meaning on any slightly modern CPU). You might be running into that now or later. See: http://support.microsoft.com/?id=2577795 The issue is over a year old and there's still no Windows upda