Re: [GENERAL] getting a list of users

2009-05-07 Thread Albe Laurenz
Eric Smith wrote: > How do I get a list of database usernames using the postgres C API? Execute this query: SELECT usename FROM pg_catalog.pg_user and read the results. Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscri

Re: [GENERAL] Schema per user?

2009-05-07 Thread CaT
On Thu, May 07, 2009 at 09:45:30PM +0200, Anders Steinlein wrote: > Has anyone done something like this, or is it simply A Bad Idea? How > many schemas can a database contain, until one hits a (hard or soft) > limit? Keep in mind that this is not a "regular" web-app with thousands > of users,

Re: [GENERAL] Schema per user?

2009-05-07 Thread Scott Marlowe
On Thu, May 7, 2009 at 4:59 PM, David Kerr wrote: > On Thu, May 07, 2009 at 03:06:11PM -0600, Scott Marlowe wrote: > - On Thu, May 7, 2009 at 2:12 PM, Anders Steinlein > wrote: > - > > - > On May 7, 2009, at 10:05 PM, Scott Marlowe wrote: > - > > - >> On Thu, May 7, 2009 at 1:45 PM, Anders Stein

Re: [GENERAL] getting a list of users

2009-05-07 Thread Eric Smith
Never mind, everyone. I figured it out. On May 7, 2009, at 8:05 PM, Eric Smith wrote: All, How do I get a list of database usernames using the postgres C API? Thanks, Eric -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www

[GENERAL] getting a list of users

2009-05-07 Thread Eric Smith
All, How do I get a list of database usernames using the postgres C API? Thanks, Eric -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Extract Week

2009-05-07 Thread Willem Buitendyk
Any ideas how to extract a non-iso week from timestamp? In other words, weeks that start on Sunday and end on Saturday? We have the dow function which returns the non-iso day of the week, why not a non-iso week function? Cheers, Willem -- Sent via pgsql-general mailing list (pgsql-general@

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-07 Thread David Fetter
On Fri, May 08, 2009 at 01:02:04AM +0100, Tim Bunce wrote: > On Thu, May 07, 2009 at 06:50:11AM -0700, David Fetter wrote: > > On Thu, May 07, 2009 at 02:31:08PM +0100, Tim Bunce wrote: > > > On Thu, May 07, 2009 at 04:54:06AM +1200, Andrej wrote: > > > > > > > > WARNING: DBD::Pg now (as of versio

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-07 Thread Tim Bunce
On Thu, May 07, 2009 at 06:50:11AM -0700, David Fetter wrote: > On Thu, May 07, 2009 at 02:31:08PM +0100, Tim Bunce wrote: > > On Thu, May 07, 2009 at 04:54:06AM +1200, Andrej wrote: > > > > > > WARNING: DBD::Pg now (as of version 1.40) uses true prepared > > > statements by sending them to the ba

Re: [GENERAL] A question about RAISE NOTICE

2009-05-07 Thread Kris Jurka
On Thu, 7 May 2009, Craig Ringer wrote: Most programs will not be aware of notice messages. Unlike error messages there's no provision for them in standard JDBC/ODBC/etc APIs, and you have to specifically ask the client driver for them. Unless your app is aware of PostgreSQL specifically, it w

Re: [GENERAL] Schema per user?

2009-05-07 Thread David Kerr
On Thu, May 07, 2009 at 03:06:11PM -0600, Scott Marlowe wrote: - On Thu, May 7, 2009 at 2:12 PM, Anders Steinlein wrote: - > - > On May 7, 2009, at 10:05 PM, Scott Marlowe wrote: - > - >> On Thu, May 7, 2009 at 1:45 PM, Anders Steinlein - >> wrote: - > Generally though, what made you consider suc

Re: [GENERAL] Schema per user?

2009-05-07 Thread Erik Jones
On May 7, 2009, at 2:06 PM, Scott Marlowe wrote: On Thu, May 7, 2009 at 2:12 PM, Anders Steinlein wrote: On May 7, 2009, at 10:05 PM, Scott Marlowe wrote: On Thu, May 7, 2009 at 1:45 PM, Anders Steinlein > wrote: Hi, I'm pondering a design question for a subscription-based web-app we

Re: [GENERAL] Schema per user?

2009-05-07 Thread Scott Marlowe
On Thu, May 7, 2009 at 2:12 PM, Anders Steinlein wrote: > > On May 7, 2009, at 10:05 PM, Scott Marlowe wrote: > >> On Thu, May 7, 2009 at 1:45 PM, Anders Steinlein >> wrote: >>> >>> Hi, >>> >>> I'm pondering a design question for a subscription-based web-app we are >>> developing. Would it be fea

Re: [GENERAL] Schema per user?

2009-05-07 Thread Scott Marlowe
On Thu, May 7, 2009 at 2:56 PM, Erik Jones wrote: > > On May 7, 2009, at 1:05 PM, Scott Marlowe wrote: > >> On Thu, May 7, 2009 at 1:45 PM, Anders Steinlein >> wrote: >>> >>> Hi, >>> >>> I'm pondering a design question for a subscription-based web-app we are >>> developing. Would it be feasible t

Re: [GENERAL] Schema per user?

2009-05-07 Thread Tom Lane
Adam Ruth writes: > I've actually done this before. I had a web app with about 400 users > each with their own schema. It actually worked very well, except for > one thing. There got to be so many tables that a pg_dump would fail > because it would run out of file locks. We got around it by

Re: [GENERAL] Schema per user?

2009-05-07 Thread Erik Jones
On May 7, 2009, at 1:05 PM, Scott Marlowe wrote: On Thu, May 7, 2009 at 1:45 PM, Anders Steinlein wrote: Hi, I'm pondering a design question for a subscription-based web-app we are developing. Would it be feasible to create a new schema per user account, setting the search_path to their

Re: [GENERAL] Schema per user?

2009-05-07 Thread Adam Ruth
I've actually done this before. I had a web app with about 400 users each with their own schema. It actually worked very well, except for one thing. There got to be so many tables that a pg_dump would fail because it would run out of file locks. We got around it by creating a primary table

Re: [GENERAL] Schema per user?

2009-05-07 Thread Anders Steinlein
On May 7, 2009, at 10:05 PM, Scott Marlowe wrote: On Thu, May 7, 2009 at 1:45 PM, Anders Steinlein wrote: Hi, I'm pondering a design question for a subscription-based web-app we are developing. Would it be feasible to create a new schema per user account, setting the search_path to the

Re: [GENERAL] Schema per user?

2009-05-07 Thread Scott Marlowe
On Thu, May 7, 2009 at 1:45 PM, Anders Steinlein wrote: > Hi, > > I'm pondering a design question for a subscription-based web-app we are > developing. Would it be feasible to create a new schema per user account, > setting the search_path to their own schema during login? There is no shared > dat

[GENERAL] Schema per user?

2009-05-07 Thread Anders Steinlein
Hi, I'm pondering a design question for a subscription-based web-app we are developing. Would it be feasible to create a new schema per user account, setting the search_path to their own schema during login? There is no shared data (except where we keep a record of users), as each account

Re: [GENERAL] Upgrading from postgres 8.1 to 8.3

2009-05-07 Thread Scott Marlowe
On Thu, May 7, 2009 at 1:05 PM, Scott Mead wrote: > > On Thu, May 7, 2009 at 2:56 PM, Scott Marlowe > wrote: >> >> On Thu, May 7, 2009 at 4:54 AM, Glyn Astill >> wrote: >> > >> >> From: S Arvind >> >> Subject: [GENERAL] Upgrading from postgres 8.1 to 8.3 >> >> To: pgsql-general@postgresql.org >

Re: [GENERAL] Upgrading from postgres 8.1 to 8.3

2009-05-07 Thread Scott Mead
On Thu, May 7, 2009 at 2:56 PM, Scott Marlowe wrote: > On Thu, May 7, 2009 at 4:54 AM, Glyn Astill > wrote: > > > >> From: S Arvind > >> Subject: [GENERAL] Upgrading from postgres 8.1 to 8.3 > >> To: pgsql-general@postgresql.org > >> Date: Thursday, 7 May, 2009, 11:42 AM > >> Our 600GB data was

Re: [GENERAL] Optimizing tuning and table design for large analytics DB

2009-05-07 Thread John R Pierce
Rob W wrote: Can anyone point me towards good articles or books that would help a PostgreSQL novice (i.e. me) learn the optimal approaches to setting up a DB for analytics? In this particular case, I need to efficiently analyze approximately 300 million system log events (i.e. time series data

Re: [GENERAL] Upgrading from postgres 8.1 to 8.3

2009-05-07 Thread Scott Marlowe
On Thu, May 7, 2009 at 4:54 AM, Glyn Astill wrote: > >> From: S Arvind >> Subject: [GENERAL] Upgrading from postgres 8.1 to 8.3 >> To: pgsql-general@postgresql.org >> Date: Thursday, 7 May, 2009, 11:42 AM >> Our 600GB data was currently loaded in postgres 8.1 , we >> want to upgrade >> from postg

Re: [GENERAL] Postgres partially hang after inactivity

2009-05-07 Thread Marco Maccaferri
On 06/05/2009 21:39 Merlin Moncure ha scritto: probably, you had a transaction sitting around that is not closed (to see: select * from pg_stat_activity). the alter table is waiting for that transaction to finish, but itself blocks all _new_ transactions (alter table acquires a strong lock on t

Re: [GENERAL] "No transaction in progress" warning

2009-05-07 Thread Tom Lane
Scott Mead writes: > On Thu, May 7, 2009 at 11:29 AM, Conrad Lender wrote: >> When I leave both log_directory and log_filename commented out (my >> original settings), then restart postgres, it creates the file >> >> /var/log/postgresql/postgresql-8.3-main.log >> >> This contains three lines ab

Re: [GENERAL] PgUS 501c3 Public Charity

2009-05-07 Thread Joshua D. Drake
On Thu, 2009-05-07 at 12:15 -0400, Alvaro Herrera wrote: > Andrew Gould escribió: > Hey, but I forgot -- congratulations on the 501(c)3 status! > First, thanks! I think we are getting a bit off topic here. If we want to continue this let's move it to -advocacy. Sincerely, Joshua D. Drake -

Re: [GENERAL] PgUS 501c3 Public Charity

2009-05-07 Thread Alvaro Herrera
Andrew Gould escribió: > The public charity status lets those of us who pay income taxes to the US > government claim donations to PostgreSQL as deductions on our income tax > statements. It encourages donations. It makes donations more affordable. > It does not limit where the money is used. T

Re: [GENERAL] Power outage and funny chars in the logs

2009-05-07 Thread Massa, Harald Armin
> What did make me scratch my head was a short stream of @ symbols (well they > show up as @ symbols in vi) in the log file of the main server (others are > slony subscribers). > > mentioning those @ symbols ... 1,5 weeks ago there was reported on this list the problem "postgres service not st

Re: [GENERAL] PgUS 501c3 Public Charity

2009-05-07 Thread Joshua D. Drake
On Thu, 2009-05-07 at 16:25 +0100, Dave Page wrote: > On Thu, May 7, 2009 at 4:22 PM, Alvaro Herrera > wrote: > > > Isn't the majority of donations going to go to PgUS and pgEU anyway? > > I don't believe so, Actually except for a very recent influx of a bulk sum into SPI, PgUS is probably lead

Re: [GENERAL] PgUS 501c3 Public Charity

2009-05-07 Thread Andrew Gould
On Thu, May 7, 2009 at 10:22 AM, Alvaro Herrera wrote: > Dave Page wrote: > > On Thu, May 7, 2009 at 3:04 AM, Alvaro Herrera > > wrote: > > > Joshua D. Drake wrote: > > >> Hello, > > >> > > >> Yeah its not general technical discussion but this little bit of news > > >> warrants more widely read a

Re: [GENERAL] "No transaction in progress" warning

2009-05-07 Thread Scott Mead
On Thu, May 7, 2009 at 11:29 AM, Conrad Lender wrote: > > I'm beginning to feel incredibly dense now, but this actually brought my > original problem back. When I do specify log_filename and log_directory, > and restart Postgres, the test you suggested ('select 1/0;') shows up as > an error in th

Re: [GENERAL] "No transaction in progress" warning

2009-05-07 Thread Conrad Lender
On 07/05/09 16:56, Adrian Klaver wrote: >> The server startup messages were in this file (which is why I >> assumed it was the correct one), but for some reason after a >> restart the logs were created as >> >> /var/log/postgresql/postgresql-8.3-main.log.1241706461 [...] > is done in the zone spec

Re: [GENERAL] Is thre a way?

2009-05-07 Thread Anderson dos Santos Donda
My backup is PLAIN(text) format... i'll try to do with sed... Thanks for all o/ On Thu, May 7, 2009 at 9:14 AM, Jasen Betts wrote: > On 2009-05-06, Anderson dos Santos Donda wrote: > > --0021cc022382dbd1bb0469443c6e > > Content-Type: text/plain; charset=ISO-8859-1 > > Content-Transfer-Encoding

[GENERAL] Optimizing tuning and table design for large analytics DB

2009-05-07 Thread Rob W
Can anyone point me towards good articles or books that would help a PostgreSQL novice (i.e. me) learn the optimal approaches to setting up a DB for analytics? In this particular case, I need to efficiently analyze approximately 300 million system log events (i.e. time series data). It's log da

Re: [GENERAL] PgUS 501c3 Public Charity

2009-05-07 Thread Dave Page
On Thu, May 7, 2009 at 4:22 PM, Alvaro Herrera wrote: > Isn't the majority of donations going to go to PgUS and pgEU anyway? I don't believe so, > What good will it to for SPI to attempt to support global activities > if it doesn't have any money? It wouldn't be any good, but it does have mone

Re: [GENERAL] PgUS 501c3 Public Charity

2009-05-07 Thread Alvaro Herrera
Dave Page wrote: > On Thu, May 7, 2009 at 3:04 AM, Alvaro Herrera > wrote: > > Joshua D. Drake wrote: > >> Hello, > >> > >> Yeah its not general technical discussion but this little bit of news > >> warrants more widely read attention. PgUS (http://www.postgresql.us/) > >> received its 501c3 publi

Re: [GENERAL] Power outage and funny chars in the logs

2009-05-07 Thread Alvaro Herrera
> --- On Thu, 7/5/09, Massa, Harald Armin wrote: > > After reading the answers to the funny chars in the logs and no fsync on > > the logs: is there a fsync on postmaster.pid? Or is that file not > > considered important enough? I think this strongly suggests that postmaster.pid should be fsync

Re: [GENERAL] Power outage and funny chars in the logs

2009-05-07 Thread Glyn Astill
--- On Thu, 7/5/09, Massa, Harald Armin wrote: > > > > mentioning those @ symbols ... > > 1,5 weeks ago there was reported on this list the problem > "postgres service > not starting on windows"; after consulting event log > the user reported as > message "bogus data in postmaster.pid". Aft

Re: [GENERAL] PGSQL x iptables

2009-05-07 Thread Slansky Lukas
Very odd, indeed. We have analysed the traffic on both ends and we have found that the problem is probably in PIX. As I have read in LKML (http://lkml.org/lkml/2007/7/29/174) CISCO works really badly with SACK packets and these are then recognized as INVALID and dropped. We still don't know what is

Re: [GENERAL] A question about RAISE NOTICE

2009-05-07 Thread Craig Ringer
Luigi N. Puleio wrote: > and this function is fired when I modify a view's field which as a RULE > INSTEAD DO where it calls this function. The result I'd like would be to > notice me with a on-display message with a window having an OK button (like > when I use EXCEPTION). which would tell me

Re: [GENERAL] "No transaction in progress" warning

2009-05-07 Thread Adrian Klaver
On Thursday 07 May 2009 7:42:40 am Conrad Lender wrote: > On 07/05/09 15:58, Tom Lane wrote: > > What seems most likely is that you're looking at the wrong log file. > > Recheck the "where to log" settings. > > Thanks, Adrian and Tom, > > you were right, I wasn't looking at the correct file. > My p

[GENERAL] A question about RAISE NOTICE

2009-05-07 Thread Luigi N. Puleio
Hello everyone, I have a question concerning RAISE NOTICE I have a plpgsql function where it has a code like this: IF (condition) THEN     RAISE NOTICE 'This condition is verified'; END IF; and this function is fired when I modify a view's field which as a RULE INSTEAD DO where it calls th

Re: [GENERAL] "No transaction in progress" warning

2009-05-07 Thread Conrad Lender
On 07/05/09 15:58, Tom Lane wrote: > What seems most likely is that you're looking at the wrong log file. > Recheck the "where to log" settings. Thanks, Adrian and Tom, you were right, I wasn't looking at the correct file. My postgresql.conf has: log_directory = '/var/log/postgresql' log_filenam

Re: [GENERAL] Power outage and funny chars in the logs

2009-05-07 Thread Albe Laurenz
Glyn Astill wrote: > We had a power outage today when a couple of computer > controlled power strips crashed (my secondary psu's will stay > firmly in the wall sockets now though). > > I'd had a lot of fun pulling plugs out under load before we > went into production so I wasn't particularly wo

Re: [GENERAL] Power outage and funny chars in the logs

2009-05-07 Thread Glyn Astill
> From: Albe Laurenz > Subject: RE: [GENERAL] Power outage and funny chars in the logs > To: glynast...@yahoo.co.uk, pgsql-general@postgresql.org > Date: Thursday, 7 May, 2009, 2:44 PM > Glyn Astill wrote: > > We had a power outage today when a couple of computer > > > controlled power strips cr

Re: [GENERAL] "No transaction in progress" warning

2009-05-07 Thread Tom Lane
Conrad Lender writes: > SHOW log_min_messages; > log_min_messages > -- > notice > (1 row) > I thought this would cause all warnings to be logged automatically. Yup. > When > I enter "COMMIT" in psql, I do get the warning, but I don't see it in > the log file. What could be the

Re: [GENERAL] Power outage and funny chars in the logs

2009-05-07 Thread Tom Lane
Glyn Astill writes: > What did make me scratch my head was a short stream of @ symbols (well they > show up as @ symbols in vi) in the log file of the main server (others are > slony subscribers). There isn't anything making any effort to fsync the postmaster log, so some data corruption in the

Re: [GENERAL] "No transaction in progress" warning

2009-05-07 Thread Adrian Klaver
On Thursday 07 May 2009 3:33:09 am Conrad Lender wrote: > Hello. > > We've recently discovered a bug in our code that resulted in COMMITs > without BEGINs, and our client saw "no transaction in progress" warnings > in his log file. What worries me is that we didn't discover this problem > during de

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-07 Thread David Fetter
On Thu, May 07, 2009 at 02:31:08PM +0100, Tim Bunce wrote: > On Thu, May 07, 2009 at 04:54:06AM +1200, Andrej wrote: > > 2009/5/7 JP Fletcher : > > > Hi, > > > > > > I see different behavior with DBI/DBD::Pg (1.607/2.11.8, pg 8.1) when the > > > first command in a prepared statement is 'CREATE TEMP

[GENERAL] Problem with pg_restore in windows VISTA

2009-05-07 Thread Anamika Saini
Hello, I have an problem with using pg_restore in windows VISTA. I created the pgpass.conf file and copied it into the APPDATA of user currently logged in. The pgpass.conf file has all the rights of postgres service account. Well its perfectly working on Windows XP but when i try it on VISTA it g

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-07 Thread Tim Bunce
On Thu, May 07, 2009 at 04:54:06AM +1200, Andrej wrote: > 2009/5/7 JP Fletcher : > > Hi, > > > > I see different behavior with DBI/DBD::Pg (1.607/2.11.8, pg 8.1) when the > > first command in a prepared statement is 'CREATE TEMP TABLE'. > > > > For instance, this works: > > > > my $prepare_sql =<

Re: [GENERAL] Is thre a way?

2009-05-07 Thread Jasen Betts
On 2009-05-06, Anderson dos Santos Donda wrote: > --0021cc022382dbd1bb0469443c6e > Content-Type: text/plain; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > Hi o/ > > I have a table with 2000 names and emails.. and I did UPDATE list SET email >= '' without the WHERE and now all rows is nu

Re: [GENERAL] Upgrading from postgres 8.1 to 8.3

2009-05-07 Thread Raymond O'Donnell
On 07/05/2009 11:42, S Arvind wrote: > Our 600GB data was currently loaded in postgres 8.1 , we want to upgrade > from postgres 8.1 to 8.3 . Can we able to point the data directly or should > we have to do any porting work for transfering data from 8.1 to 8.3. You'll want to test your applications

Re: [GENERAL] date ranges in where

2009-05-07 Thread Raymond O'Donnell
On 07/05/2009 12:59, Jasen Betts wrote: > where lastlogin::date between '2009-05-01'::date and '2009-05-02'::date > > If you leave it uncast postgres will probably convert the lastlogin to > a string and produce results other than that desired and proabaly > take longer to do it too. The OP was

Re: [GENERAL] date ranges in where

2009-05-07 Thread Jasen Betts
On 2009-05-06, Miguel Miranda wrote: > --00032557620e737136046944dbf1 > Content-Type: text/plain; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > Hi, what is the recommended way to select a range of dates? if you want to compare dates, use dates! > Lets say a have a table with a lastlog

[GENERAL] Question about function returning record

2009-05-07 Thread Markus Wollny
Hi! I've got a generalized function getshadowrecord(schema (varchar),table (varchar), id (int4), version_id (int)) which returns RECORD. As this function is supposed to work on any table structure, I need to declare a column alias list when I do a SELECT on it, like SELECT *

Re: [GENERAL] Upgrading from postgres 8.1 to 8.3

2009-05-07 Thread Glyn Astill
> From: S Arvind > Subject: [GENERAL] Upgrading from postgres 8.1 to 8.3 > To: pgsql-general@postgresql.org > Date: Thursday, 7 May, 2009, 11:42 AM > Our 600GB data was currently loaded in postgres 8.1 , we > want to upgrade > from postgres 8.1 to 8.3 . Can we able to point the data > directly or

[GENERAL] "No transaction in progress" warning

2009-05-07 Thread Conrad Lender
Hello. We've recently discovered a bug in our code that resulted in COMMITs without BEGINs, and our client saw "no transaction in progress" warnings in his log file. What worries me is that we didn't discover this problem during development - the warning doesn't show up in our logs. We're both usi

[GENERAL] Upgrading from postgres 8.1 to 8.3

2009-05-07 Thread S Arvind
Our 600GB data was currently loaded in postgres 8.1 , we want to upgrade from postgres 8.1 to 8.3 . Can we able to point the data directly or should we have to do any porting work for transfering data from 8.1 to 8.3. Arvind S * "Many of lifes failure are people who did not realize how close the

[GENERAL] Power outage and funny chars in the logs

2009-05-07 Thread Glyn Astill
Hi chaps, We had a power outage today when a couple of computer controlled power strips crashed (my secondary psu's will stay firmly in the wall sockets now though). I'd had a lot of fun pulling plugs out under load before we went into production so I wasn't particularly worried, and the datab

Re: [GENERAL] PgUS 501c3 Public Charity

2009-05-07 Thread Dave Page
On Thu, May 7, 2009 at 3:04 AM, Alvaro Herrera wrote: > Joshua D. Drake wrote: >> Hello, >> >> Yeah its not general technical discussion but this little bit of news >> warrants more widely read attention. PgUS (http://www.postgresql.us/) >> received its 501c3 public charity status today. You can v