[SQL] Cheers for DISTINCT ON
I just wanted to give my cheers for DISTINCT ON. It is a great feature, I've just found a really good use for it. I am just wondering why it didn't make it into the standards. On a slightly unrelated note, I had the opportunity to work with EQUEL for a short period of time some 15 years ago before I started getting famililar with SQL. I clearly remember the disappointment/surprise I felt as I was struggling to translate some of the constructs I used with EQUEL into SQL. At that time, I thought that (the by then defunct) EQUEL was much more expressive/intuitive/flexible/easier-to-use than SQL. I've been wondering ever since why the worse so often gets the upper-hand over the better. (I am obviously having a hard time "growing-up" :-) ) Cheers, Peter ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
[SQL] "TZ"/"tz" not supported
Hi, Execution of the following statement aborts with the error message in the Subject: select to_timestamp('2008-06-20 02:30:00 GMT', '-MM-DD HH24:MI:SS TZ'); Does this message mean that this particular PostgreSQL installation doesn't support timezones? -- select * from pg_catalog.pg_timezone_abbrevs where abbrev = 'GMT'; abbrev | utc_offset | is_dst ++ GMT| 00:00:00 | f (1 row) -- The database version is 8.3.0. Any help appreciated, Peter -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] "TZ"/"tz" not supported
Thank you, Andreas! Your advice is very useful to me. I would still be interested why "TZ" is not accepted in the format string. Thanks Peter On Fri, Jun 20, 2008 at 8:15 AM, A. Kretschmer <[EMAIL PROTECTED]> wrote: > am Fri, dem 20.06.2008, um 7:51:50 +0200 mailte Peter Kovacs folgendes: >> Hi, >> >> Execution of the following statement aborts with the error message in >> the Subject: >> >> select to_timestamp('2008-06-20 02:30:00 GMT', '-MM-DD HH24:MI:SS TZ'); > > You can use: > > test=*# select '2008-06-20 02:30:00 GMT'::timestamptz; > timestamptz > > 2008-06-20 04:30:00+02 > (1 row) > > > > helps that? > > > > Andreas > -- > Andreas Kretschmer > Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) > GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] "TZ"/"tz" not supported
Are you basically saying that "TZ" can be used in an "output template string", but not in an "input template string" (in the terminology of the documentation)? If this is the case, shouldn't this be mentioned in the documentation? Also, is there a fundamental reason for this limitation or is it just the implementation waiting to be completed (nobody has had an itch intensive enough to scratch it)? Thanks Peter On Fri, Jun 20, 2008 at 8:50 AM, A. Kretschmer <[EMAIL PROTECTED]> wrote: > am Fri, dem 20.06.2008, um 8:35:10 +0200 mailte Peter Kovacs folgendes: >> Thank you, Andreas! Your advice is very useful to me. >> >> I would still be interested why "TZ" is not accepted in the format string. > > I think because TZ is only useful for displaying a timestamptz and not > for internal representation and/or calculation. > > For displaying you can use to_char(timestamptz, format-string). > > > Andreas > -- > Andreas Kretschmer > Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) > GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql