Re: [GENERAL] Performance of subselects

2009-03-05 Thread Scott Marlowe
On Thu, Mar 5, 2009 at 11:25 PM, Christian Schröder wrote: > Hi list, > if I want to find all records from a table that don't have a matching record > in another table there are at least two ways to do it: Using a left outer > join or using a subselect. I always thought that the planner would crea

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Nico Grubert
If you're going to truncate the NOW(), just go with CURRENT_DATE instead. Thanks for the "CURRENT_DATE" tip, Adam. Works fine! -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Adam Rich
> > > > This query makes little sense. Why are you trying to convert a > > timestamp to a timestamp? Is this a bizarre substitute for > date_trunc()? > > The "from_datetime" column is of type "timestamp" but I want to check > only the date, not the time. > In this example I want to retrieve al

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Adam Rich
> > > > OK, so you want to see if a timestamp is greater than now()? Why not > > just compare them? > > > > where a.from_datetime >= now() > > No, not the whole timestamp. I dont want to check the time. > So I had to truncate the datetime with: > > date_trunc('day', a.from_datetime) >= date_tr

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Scott Marlowe
On Thu, Mar 5, 2009 at 11:59 PM, Nico Grubert wrote: > >> OK, so you want to see if a timestamp is greater than now()?  Why not >> just compare them? >> >> where a.from_datetime >= now() > > No, not the whole timestamp. I dont want to check the time. > So I had to truncate the datetime with: > > d

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Scott Marlowe
On Thu, Mar 5, 2009 at 11:58 PM, Nico Grubert wrote: > >> This query makes little sense.  Why are you trying to convert a >> timestamp to a timestamp?  Is this a bizarre substitute for date_trunc()? > > Got it: > Thanks for the "date_trunc" tip. > > This query works fine: > date_trunc('day', a.fro

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Nico Grubert
OK, so you want to see if a timestamp is greater than now()? Why not just compare them? where a.from_datetime >= now() No, not the whole timestamp. I dont want to check the time. So I had to truncate the datetime with: date_trunc('day', a.from_datetime) >= date_trunc('day', NOW()) -- Sent

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Scott Marlowe
Or use date_trunc: select * from sometable where timestampfield >= date_trunc('day',now()); -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Nico Grubert
This query makes little sense. Why are you trying to convert a timestamp to a timestamp? Is this a bizarre substitute for date_trunc()? Got it: Thanks for the "date_trunc" tip. This query works fine: date_trunc('day', a.from_datetime) >= date_trunc('day', NOW()) -- Sent via pgsql-general m

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Scott Marlowe
On Thu, Mar 5, 2009 at 11:53 PM, Nico Grubert wrote: > >> This query makes little sense.  Why are you trying to convert a >> timestamp to a timestamp?  Is this a bizarre substitute for date_trunc()? > > The "from_datetime" column is of type "timestamp" but I want to check only > the date, not the

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Nico Grubert
This query makes little sense. Why are you trying to convert a timestamp to a timestamp? Is this a bizarre substitute for date_trunc()? The "from_datetime" column is of type "timestamp" but I want to check only the date, not the time. In this example I want to retrieve all records whose "fr

[GENERAL] merging 2 databases

2009-03-05 Thread Ivan Sergio Borgonovo
I've 2 installation of the same application. Each one has it's own DB with the same structure and different data. create table A (); create table B (); create table C (); Now for each DB I'm going to move most of the tables in a different schema: DB1 alter table A set schema XXX; alter table B se

[GENERAL] Performance of subselects

2009-03-05 Thread Christian Schröder
Hi list, if I want to find all records from a table that don't have a matching record in another table there are at least two ways to do it: Using a left outer join or using a subselect. I always thought that the planner would create identical plans for both approaches, but actually they are q

Re: [GENERAL] converting older databases

2009-03-05 Thread Scott Marlowe
On Thu, Mar 5, 2009 at 5:56 PM, Sathish Duraiswamy wrote: > Thanks for ur reply John > > For information , We have Novell SuSe 11.0 server ON x86_32 and we have > installed from source code Then all you need to do is run ./configure with the same --prefix switch as you did before, and then make ;

Re: [GENERAL] idle users

2009-03-05 Thread Scott Marlowe
On Thu, Mar 5, 2009 at 5:50 AM, paulo matadr wrote: > I need to procedure to kill users in idle,anybody have this made? > thanks > Paulo Moraes Here's a really primitive bash script to kill off all idle connections. Run it as postgres: #!/bin/bash for i in `psql -U postgres -t -c "select procpi

Re: [GENERAL] Hiding row counts in psql

2009-03-05 Thread Lubomir Petrov
Hi, Use "\pset footer [on|off]". test=# select 1 as "Col1"; Col1 -- 1 (1 row) test=# test=# \pset footer Default footer is off. test=# test=# select 1 as "Col1"; Col1 -- 1 test=# \pset footer Default footer is on. test=# test=# test=# select 1 as "Col1"; Col1 -- 1 (

Re: [GENERAL] idle users

2009-03-05 Thread Scott Marlowe
On Thu, Mar 5, 2009 at 9:31 AM, Joshua Tolley wrote: > On Thu, Mar 05, 2009 at 04:50:09AM -0800, paulo matadr wrote: >>    I need to procedure to kill users in idle,anybody have this made? >>    thanks > > See pg_cancel_backend. > http://www.postgresql.org/docs/8.3/static/functions-admin.html I j

Re: [GENERAL] pgsql announce now on twitter

2009-03-05 Thread Mark Styles
On Thu, Mar 05, 2009 at 09:44:58AM -0500, Douglas J Hunley wrote: > On Wednesday 04 March 2009 15:39:36 Mark Styles wrote: > > On Tue, Mar 03, 2009 at 09:38:39PM -0500, Douglas J Hunley wrote: > > > I really wanted to let everyone know that I've created @PGSQL_Announce on > > > Twitter and setup a

Re: [pgsql-advocacy] [GENERAL] pgsql announce now on twitter

2009-03-05 Thread Dan Langille
Mark Styles wrote: On Tue, Mar 03, 2009 at 09:38:39PM -0500, Douglas J Hunley wrote: I really wanted to let everyone know that I've created @PGSQL_Announce on Twitter and setup a cron job to parse the feed and post it to Twitter. It's been working for a little while now and I think it's stable

Re: [GENERAL] idle users

2009-03-05 Thread Sathish Duraiswamy
Thanks for your reply. Can we have script in cron jobs to do this step periodically If possible , can anyone help for cron script to do this job . Regards sathish On Fri, Mar 6, 2009 at 1:21 AM, Joshua D. Drake wrote: > On Fri, 2009-03-06 at 01:09 +0530, Sathish Duraiswamy wrote: > > Can we a

Re: [GENERAL] converting older databases

2009-03-05 Thread Sathish Duraiswamy
Thanks for ur reply John For information , We have Novell SuSe 11.0 server ON x86_32 and we have installed from source code Regards sathish On Fri, Mar 6, 2009 at 1:46 AM, John R Pierce wrote: > Sathish Duraiswamy wrote: > >> hai >> >> Recently we migrated our database from 8.2.4 to 8.2.12 , w

Re: [GENERAL] Keeping only one postgres.exe instance running

2009-03-05 Thread John R Pierce
Pierre Racine wrote: Hi, Is there a way to tell PostgreSQL to keep only one instance of postgres.exe running? you couldn't use it if that was the case. at a minimum, there is the postmaster process, the postgres writer, the postgres logger, the postgres stats collector, and the postgre

Re: [GENERAL] Keeping only one postgres.exe instance running

2009-03-05 Thread Scott Marlowe
On Thu, Mar 5, 2009 at 2:52 PM, Pierre Racine wrote: > Hi, > > Is there a way to tell PostgreSQL to keep only one instance of > postgres.exe running? Running it in single user non-server mode? Is there some reason you're looking to do this? -- Sent via pgsql-general mailing list (pgsql-general

[GENERAL] Keeping only one postgres.exe instance running

2009-03-05 Thread Pierre Racine
Hi, Is there a way to tell PostgreSQL to keep only one instance of postgres.exe running? Thanks, Pierre -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] BufferSync() performance

2009-03-05 Thread Greg Smith
On Thu, 5 Mar 2009, Guido Ostkamp wrote: Would this work or is there a special reason why the original check was done with lock held? http://en.wikipedia.org/wiki/Race_condition Until you have a lock on a buffer header, you can't trust that you're even seeing consistent information about it.

Re: [GENERAL] BufferSync() performance

2009-03-05 Thread Tom Lane
Guido Ostkamp writes: > Would this work or is there a special reason why the original check was > done with lock held? This will fail, very nastily, on multiple-CPU machines with weak memory ordering guarantees. You can't assume you are seeing an up-to-date value of the flag bit if you don't ta

Re: [GENERAL] not quite a cross tab query...

2009-03-05 Thread Richard Greenwood
On Thu, Mar 5, 2009 at 12:29 PM, Steve Atkins wrote: > > On Mar 5, 2009, at 11:17 AM, Richard Greenwood wrote: > >> Hello pgsql listers, >> >> I've got a problem that is similar to, but I don't think identical to, >> a cross tab query. My data looks like: >>  ID | CAT >>  1  |   A >>  1  |   B >>

Re: [GENERAL] not quite a cross tab query...

2009-03-05 Thread Richard Greenwood
On Thu, Mar 5, 2009 at 12:27 PM, wrote: > Have you tried using "group by"? Thanks, but that doesn't do it. If I group by ID I loose the CAT, group by CAT I loose the ID, group by bith and that's just the base table. Am I missing something? Regards, Rich >> Hello pgsql listers, >> >> I've got a

[GENERAL] BufferSync() performance

2009-03-05 Thread Guido Ostkamp
Hello, Bruce Momjian is with us for some training sessions this week and has asked me to post the following question to the mailing list (I have chosen this list as it was suggested not to post directly to hackers list): When looking at function BufferSync() in postgresql/src/backend/storage

Re: [GENERAL] converting older databases

2009-03-05 Thread John R Pierce
Sathish Duraiswamy wrote: hai Recently we migrated our database from 8.2.4 to 8.2.12 , went through manuals and followed the below steps 1.pg_dumpall to take data dump of current database 2.stopped database 3.moved the pgsql to backup folder 4.downloaded 8.2.12 , configured - gmake - gmake i

Re: [GENERAL] idle users

2009-03-05 Thread Joshua D. Drake
On Fri, 2009-03-06 at 01:09 +0530, Sathish Duraiswamy wrote: > Can we automate this process , maintained by postmaster itself No and that would be a bad idea. There has been discussion in the past of having an IDLE in TRANSACTION timeout but that is a different thing. Joshua D. Drake -- Postgre

Re: [GENERAL] not quite a cross tab query...

2009-03-05 Thread darren
Have you tried using "group by"? > Hello pgsql listers, > > I've got a problem that is similar to, but I don't think identical to, > a cross tab query. My data looks like: > ID | CAT > 1 | A > 1 | B > 2 | A > 2 | C > So for each ID there may be many CAT (categories). > The cl

Re: [GENERAL] idle users

2009-03-05 Thread Sathish Duraiswamy
Can we automate this process , maintained by postmaster itself Regards Sathish On Thu, Mar 5, 2009 at 10:01 PM, Joshua Tolley wrote: > On Thu, Mar 05, 2009 at 04:50:09AM -0800, paulo matadr wrote: > >I need to procedure to kill users in idle,anybody have this made? > >thanks > > See pg_

Re: [GENERAL] converting older databases

2009-03-05 Thread Sathish Duraiswamy
hai Recently we migrated our database from 8.2.4 to 8.2.12 , went through manuals and followed the below steps 1.pg_dumpall to take data dump of current database 2.stopped database 3.moved the pgsql to backup folder 4.downloaded 8.2.12 , configured - gmake - gmake install 5.recreated cluster dir

Re: [GENERAL] not quite a cross tab query...

2009-03-05 Thread Steve Atkins
On Mar 5, 2009, at 11:17 AM, Richard Greenwood wrote: Hello pgsql listers, I've got a problem that is similar to, but I don't think identical to, a cross tab query. My data looks like: ID | CAT 1 | A 1 | B 2 | A 2 | C So for each ID there may be many CAT (categories). The clie

Re: [GENERAL] Postgres Cookbook

2009-03-05 Thread A. Kretschmer
In response to Stefan Kaltenbrunner : > Tino Wildenhain wrote: > >Greg Smith wrote: > >>On Wed, 4 Mar 2009, Artacus wrote: > >> > >>>So it looks like at one time we had a cookbook. But the links are > >>>dead now. > >> > >>I'm not sure why Roberto Mello stopped hosting that, but you can see > >>t

[GENERAL] not quite a cross tab query...

2009-03-05 Thread Richard Greenwood
Hello pgsql listers, I've got a problem that is similar to, but I don't think identical to, a cross tab query. My data looks like: ID | CAT 1 | A 1 | B 2 | A 2 | C So for each ID there may be many CAT (categories). The client wants it to look like: ID | CATS 1 | A,B 2

Re: [GENERAL] Postgres with phpScheduleIt

2009-03-05 Thread Joshua D. Drake
On Thu, 2009-03-05 at 14:08 -0500, Tom Lane wrote: > Stuart Luppescu writes: > > phpScheduleIt uses mySQL by default, but they claim is should work with > > postgres. The setup uses a script that starts like this: > > > # phpScheduleIt 1.2.0 # > > drop database if exists phpScheduleIt; > > create

Re: [GENERAL] Postgres with phpScheduleIt

2009-03-05 Thread Tom Lane
Stuart Luppescu writes: > phpScheduleIt uses mySQL by default, but they claim is should work with > postgres. The setup uses a script that starts like this: > # phpScheduleIt 1.2.0 # > drop database if exists phpScheduleIt; > create database phpScheduleIt; > use phpScheduleIt; Frankly, it looks

Re: [GENERAL] Postgres with phpScheduleIt

2009-03-05 Thread Peter Eisentraut
On Thursday 05 March 2009 18:39:11 Stuart Luppescu wrote: > Hello, I'm trying to install phpScheduleIt (an on-line calendaring > application) on my system that has postgres 8.0.15 running. I have to > admit upfront that I have very little idea how postgres works; my > small-business accounting syst

Re: [GENERAL] converting older databases

2009-03-05 Thread John R Pierce
Heine Ferreira wrote: Hi When you install a newer version of Postgres how do you upgrade your database to the new format? Apparantly you can't just backup the old database and restore it on the new software. How do you do this on Windows? you pg_dump >dumpfile.sql the old one, psql -f dumpf

Re: [GENERAL] Custom datestyle for timestamps

2009-03-05 Thread Peter Eisentraut
On Thursday 05 March 2009 00:19:02 Daniel Verite wrote: > SET DATESTYLE takes predefined keywords such as ISO or US as arguments, > but I can't find a way to specify a custom format string for > timestamps. There is no support for that. > What I'd like to find is an equivalent to Oracle's > ALTER

Re: [GENERAL] Problem with SSL: "could not accept SSL connection: EOF detected"

2009-03-05 Thread Tom Lane
Pat Maddox writes: > On Thu, Mar 5, 2009 at 10:34 AM, Tom Lane wrote: >> Odd.  Try strace'ing the failing psql session, and send us the last few >> dozen lines of the output. > http://pastie.org/private/y7cbpuamemxawmhh8hdna is the strace output So the relevant info is sendto(3, "\0\0\0*\0\3\0

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Scott Marlowe
On Thu, Mar 5, 2009 at 9:48 AM, Nico Grubert wrote: > Dear list members > > I have upgraded my PostgreSQL 8.2.6 to 8.3.6 and I am having trouble with > calling "to_timestamp" function. > > Here is the query I use: > >  SELECT a.* >  FROM tblevent a >  WHERE to_timestamp(a.from_datetime,'/MM/DD

[GENERAL] converting older databases

2009-03-05 Thread Heine Ferreira
Hi When you install a newer version of Postgres how do you upgrade your database to the new format? Apparantly you can't just backup the old database and restore it on the new software. How do you do this on Windows? Thanks H.F.

Re: [GENERAL] Problem with SSL: "could not accept SSL connection: EOF detected"

2009-03-05 Thread Pat Maddox
On Thu, Mar 5, 2009 at 10:34 AM, Tom Lane wrote: > Pat Maddox writes: >> I have an ubuntu intrepid server running postgres 8.3.6.  The server >> is able to accept connections via SSL. > >> We have another host that is unable to connect via ssl for some >> reason.  Trying to connect results in >>

Re: [GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Tom Lane
Nico Grubert writes: >SELECT a.* >FROM tblevent a >WHERE to_timestamp(a.from_datetime,'/MM/DD') >= to_timestamp( > NOW(),'/MM/DD' ) >ORDER BY a.from_datetime > In PostgreSQL 8.2.6 everything works fine. > In PostgreSQL 8.3.6 I get the following error: > --

Re: [GENERAL] Problem with SSL: "could not accept SSL connection: EOF detected"

2009-03-05 Thread Tom Lane
Pat Maddox writes: > I have an ubuntu intrepid server running postgres 8.3.6. The server > is able to accept connections via SSL. > We have another host that is unable to connect via ssl for some > reason. Trying to connect results in > psql: > and quitting. The server log says > "could not ac

[GENERAL] Postgres with phpScheduleIt

2009-03-05 Thread Stuart Luppescu
Hello, I'm trying to install phpScheduleIt (an on-line calendaring application) on my system that has postgres 8.0.15 running. I have to admit upfront that I have very little idea how postgres works; my small-business accounting system uses it, but it's sort of like a black box to me. phpScheduleI

[GENERAL] repeated log "$libdir/plugins/plugin_debugger.dll"

2009-03-05 Thread Sabin Coanda
Hi there, I have "PostgreSQL 8.3.5, compiled by Visual C++ build 1400" installed on Windows XP. The log files contain the following repeated message: db=, user= LOG: loaded library "$libdir/plugins/plugin_debugger.dll" Unfortunately it fills a lot of my log file. Please tell me how to remove i

Re: [GENERAL] encoding of PostgreSQL messages

2009-03-05 Thread Hiroshi Saito
Hi. Karsten-san. Yeah, It was a problem unsolvable by the driver to relay. although perseverance keeping without giving up! -- arigatougozaimasu:-) Regards, Hiroshi Saito - Original Message - From: "Karsten Hilbert" On Tue, Mar 03, 2009 at 12:35:37AM +0900, Hiroshi Saito wrote:

Re: [GENERAL] Postgres Cookbook

2009-03-05 Thread Stefan Kaltenbrunner
Tino Wildenhain wrote: Greg Smith wrote: On Wed, 4 Mar 2009, Artacus wrote: So it looks like at one time we had a cookbook. But the links are dead now. I'm not sure why Roberto Mello stopped hosting that, but you can see the last content posted there at http://web.archive.org/web/200312070

Re: [GENERAL] idle users

2009-03-05 Thread Joshua Tolley
On Thu, Mar 05, 2009 at 04:50:09AM -0800, paulo matadr wrote: >I need to procedure to kill users in idle,anybody have this made? >thanks See pg_cancel_backend. http://www.postgresql.org/docs/8.3/static/functions-admin.html - Josh / eggyknap signature.asc Description: Digital signature

[GENERAL] After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

2009-03-05 Thread Nico Grubert
Dear list members I have upgraded my PostgreSQL 8.2.6 to 8.3.6 and I am having trouble with calling "to_timestamp" function. Here is the query I use: SELECT a.* FROM tblevent a WHERE to_timestamp(a.from_datetime,'/MM/DD') >= to_timestamp( NOW(),'/MM/DD' ) ORDER BY a.from_dat

[GENERAL] Problem with SSL: "could not accept SSL connection: EOF detected"

2009-03-05 Thread Pat Maddox
I have an ubuntu intrepid server running postgres 8.3.6. The server is able to accept connections via SSL. We have another host that is unable to connect via ssl for some reason. Trying to connect results in psql: and quitting. The server log says "could not accept SSL connection: EOF detected"

Re: [GENERAL] pgsql announce now on twitter

2009-03-05 Thread Douglas J Hunley
On Wednesday 04 March 2009 15:39:36 Mark Styles wrote: > On Tue, Mar 03, 2009 at 09:38:39PM -0500, Douglas J Hunley wrote: > > I really wanted to let everyone know that I've created @PGSQL_Announce on > > Twitter and setup a cron job to parse the feed and post it to Twitter. > > It's been working f

[GENERAL] idle users

2009-03-05 Thread paulo matadr
I need to procedure to kill users in idle,anybody have this made? thanks Paulo Moraes Veja quais são os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com

Re: [GENERAL] PostgreSQL template for cacti

2009-03-05 Thread Ashish Karalkar
Ashish Karalkar wrote: Hello list, I was wondering is there any postgresql template for cacti to monitor PostgreSQL server. can anybody plz point me to the same? Thanks in advance --Ashish That worked from google, sorry for making noise... http://forums.cacti.net/about23300.html --A

[GENERAL] PostgreSQL template for cacti

2009-03-05 Thread Ashish Karalkar
Hello list, I was wondering is there any postgresql template for cacti to monitor PostgreSQL server. can anybody plz point me to the same? Thanks in advance --Ashish -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.pos

Re: [GENERAL] pg_dumpall custom format?

2009-03-05 Thread Marc Mamin
Hello, you can first pipe the output of pg_dump to a compression tool: pg_dump. | gzip > file. instead of gzip, I'm using pigz which is faster thanks multithreading. HTH, Marc Mamin From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-o

Re: [GENERAL] pg_dumpall custom format?

2009-03-05 Thread Thom Brown
Thanks for the suggestion Marc. It would still be nice to have the custom format included as an option though with pg_restore supporting it, just for consistency. I will, however, follow your recommendation. Thom 2009/3/5 Marc Mamin > Hello, > > you can first pipe the output of pg_dump to a

[GENERAL] pg_dumpall custom format?

2009-03-05 Thread Thom Brown
Hi, I noticed that while pg_dump can output a custom format, effectively compressing the output, pg_dumpall doesn't. Is there a reason for this? And is there a way to get pg_dumpall to compress it's output? Thanks Thom