Re: [SQL] Getting yyyy-mm-dd 00:00:00 in an arbitrary time zone

2006-03-03 Thread Davidson, Robert
It does, doesn't it. And it does it just the way it is documented in 9.9.3 AT TIME ZONE table 9.27. I was expecting it to be harder and didn't see I had figured out the right answer already - thanks! Robert -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Friday, Marc

Re: [SQL] Getting yyyy-mm-dd 00:00:00 in an arbitrary time zone

2006-03-03 Thread Tom Lane
"Davidson, Robert" <[EMAIL PROTECTED]> writes: > I am trying to find out what the last full day of data for an arbitrary = > timezone (generally not the pg client's timezone). I get the = > max(timestamp), then would like to remove the time portion. Sounded like = > a job for date_trunc, unfortunat

[SQL] Getting yyyy-mm-dd 00:00:00 in an arbitrary time zone

2006-03-03 Thread Davidson, Robert
Title: Getting -mm-dd 00:00:00 in an arbitrary time zone I am trying to find out what the last full day of data for an arbitrary timezone (generally not the pg client's timezone). I get the max(timestamp), then would like to remove the time portion. Sounded like a job for date_trunc, unfo

Re: [SQL] pg_dump and diffrent sizes

2006-03-03 Thread Scott Marlowe
On Fri, 2006-03-03 at 14:10, Maciej Piekielniak wrote: > Hello pgsql-sql, > > I dump db with pg_dump v.8.1.3 on database postgresql server 7.4.7. > Data directory with my db on pg 7.4.7 had 1,8GB and > file with dump had 2,7GB. > Database have blob fields. > > When I restore db on pg 8.1 - data d

[SQL] pg_dump and diffrent sizes

2006-03-03 Thread Maciej Piekielniak
Hello pgsql-sql, I dump db with pg_dump v.8.1.3 on database postgresql server 7.4.7. Data directory with my db on pg 7.4.7 had 1,8GB and file with dump had 2,7GB. Database have blob fields. When I restore db on pg 8.1 - data directory have only 1GB, why? -- Best regards, Maciej

Re: [SQL] Sequential scan where Index scan expected (update)

2006-03-03 Thread Andrew Sullivan
On Fri, Mar 03, 2006 at 11:35:55AM -0800, Bryce Nesbitt wrote: > Yup that's it. But this project uses (ugh) Hibernate. I can't change > it. I may have to change > from BIGINT primary keys to INT. > Well, you could upgrade from 7.4. > Also: > Any hints on the table statistics? I turn them o

Re: [SQL] Sequential scan where Index scan expected (update)

2006-03-03 Thread Bryce Nesbitt
Andrew Sullivan wrote: thing_event_id=1; ^ in quotes. The automatic int4-int8 coercion is probably your problem. Also Yup that's it.  But this project uses (ugh) Hibernate.  I can't change it.  I may have to change from BIGINT primary keys to IN

Re: [SQL] how to make infinite intervals?

2006-03-03 Thread Tom Lane
Tilman Baumann <[EMAIL PROTECTED]> writes: > I see there is a isfinite(interval) function. Looks like it's just a stub :-( Datum interval_finite(PG_FUNCTION_ARGS) { PG_RETURN_BOOL(true); } Evidently someone planned for infinite intervals a long time ago, but never got round to it.

Re: [SQL] how to make infinite intervals?

2006-03-03 Thread Tilman Baumann
Bruce Momjian schrieb: Tilman Baumann wrote: I see there is a isfinite(interval) function. So there must be something like a infinite interval. An infinite interval would be yuite handy for me at the moment. But i have no clue how to make one. interval 'infinity' does not do the

Re: [SQL] how to make infinite intervals?

2006-03-03 Thread Bruce Momjian
Tilman Baumann wrote: > I see there is a isfinite(interval) function. So there must be something > like a infinite interval. > > An infinite interval would be yuite handy for me at the moment. But i > have no clue how to make one. > > interval 'infinity' does not do the trick. :) On the TODO lis

[SQL] how to make infinite intervals?

2006-03-03 Thread Tilman Baumann
I see there is a isfinite(interval) function. So there must be something like a infinite interval. An infinite interval would be yuite handy for me at the moment. But i have no clue how to make one. interval 'infinity' does not do the trick. :) Thank you -- Tilman Baumann Software Developer C

Re: [SQL] Sequential scan where Index scan expected (update)

2006-03-03 Thread Andrew Sullivan
On Thu, Mar 02, 2006 at 11:28:49PM -0800, Bryce Nesbitt wrote: > Can anyone help figure out why? Well. . . > > > demo=# \d xx_thing > -+-+--- > thing_id | bigint | not null

Re: [SQL] newbie question

2006-03-03 Thread Karsten Hilbert
On Fri, Mar 03, 2006 at 12:30:20PM +0100, ivan marchesini wrote: > another question... > is it possible to copy a table to a view and then back the view to a > table??? You need to read a basic textbook about what a view is. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 7

Re: [SQL] Help with trigger that updates a row prior to a potentially aborted deletion?

2006-03-03 Thread Andrew Sullivan
On Fri, Mar 03, 2006 at 12:19:22AM -, Simon Kinsella wrote: > Hi Andrew, > > I think I may have cracked this problem by combining a RULE ON DELETE which > calls a function instead of the standard DELETE op. No triggers. It was a Ah. Yes, likely. Yeah, you can't do that. A -- Andrew Sull

Re: [SQL] newbie question

2006-03-03 Thread A. Kretschmer
am 03.03.2006, um 12:30:20 +0100 mailte ivan marchesini folgendes: > Thanks to all... > another question... > is it possible to copy a table to a view and then back the view to a > table??? Yes this is possible. > > Il giorno ven, 03/03/2006 alle 11.51 +0100, Andreas Kretschmer ha please, no s

Re: [SQL] newbie question

2006-03-03 Thread ivan marchesini
Thanks to all... another question... is it possible to copy a table to a view and then back the view to a table??? thank you very much... ivan Il giorno ven, 03/03/2006 alle 11.51 +0100, Andreas Kretschmer ha scritto: > ivan marchesini <[EMAIL PROTECTED]> schrieb: > > > Dear users.. > > I have

Re: [SQL] newbie question

2006-03-03 Thread Karsten Hilbert
On Fri, Mar 03, 2006 at 10:43:09AM +0100, ivan marchesini wrote: > I have fastly created a table in a postgresql database.. > some columns where edited by hand (columns A, B, C), and some others > (columns D, E, F) have been calculated as a result of mathematical > equation (where the factors are

Re: [SQL] newbie question

2006-03-03 Thread Andreas Kretschmer
ivan marchesini <[EMAIL PROTECTED]> schrieb: > Dear users.. > I have fastly created a table in a postgresql database.. > some columns where edited by hand (columns A, B, C), and some others > (columns D, E, F) have been calculated as a result of mathematical > equation (where the factors are the A

Re: [SQL] Why do I get these results?????

2006-03-03 Thread Joost Kraaijeveld
On Fri, 2006-03-03 at 09:51 +, Ragnar wrote: > Looks like it either sorts lowercase before uppercase > or treats them as equivalent. Ooops. I must sort resultset using the same condition is I select. Oops again. them. -- Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Ni

[SQL] newbie question

2006-03-03 Thread ivan marchesini
Dear users.. I have fastly created a table in a postgresql database.. some columns where edited by hand (columns A, B, C), and some others (columns D, E, F) have been calculated as a result of mathematical equation (where the factors are the A, B, C columns) now I simply need to change some val

Re: [SQL] Why do I get these results?????

2006-03-03 Thread Ragnar
On fös, 2006-03-03 at 09:50 +0100, Joost Kraaijeveld wrote: > Hi, > > Why do I get the following result from the query below? I expected that, > given the fact that there are over 100 "Jansen" (but no "jansen") in > "Nijmegen" the first record would definitively be people living in > "Nijmegen". I

Re: [SQL] Sequential scan where Index scan expected (update)

2006-03-03 Thread Michael Fuhr
On Thu, Mar 02, 2006 at 11:37:53PM -0800, Gregory S. Williamson wrote: > It seems unlikely but maybe try an explict cast for the thing_id call, e.g. > explain update xx_thing_event set thing_color='foo' where > thing_event_id=1::bigint; The server is pre-8.0 so it's likely that this is indeed

Re: [SQL] Sequential scan where Index scan expected (update)

2006-03-03 Thread Ragnar
On fim, 2006-03-02 at 23:28 -0800, Bryce Nesbitt wrote: > I'm getting sequential scans (and poor performance), on scans using my > primary keys. This is an older postgres. > Can anyone help figure out why? > > > demo=# \d xx_thing > Table "public.xx_thing" > Column

Re: [SQL] Why do I get these results?????

2006-03-03 Thread Joost Kraaijeveld
Hi Frans On Fri, 2006-03-03 at 10:06 +0100, Van Elsacker Frans wrote: > Joost > > Why do you use > > AND TRIM(UPPER(addresses.city)) >= TRIM(UPPER('NIJMEGEN')) > and not > AND TRIM(UPPER(addresses.city)) = TRIM(UPPER('NIJMEGEN')) > > upper(Rotterdam) en upper(Someren) meets >= TRIM(UPPER('NIJME

[SQL] Why do I get these results?????

2006-03-03 Thread Joost Kraaijeveld
Hi, Why do I get the following result from the query below? I expected that, given the fact that there are over 100 "Jansen" (but no "jansen") in "Nijmegen" the first record would definitively be people living in "Nijmegen". If I change the order to the order that is commented out, the query goes