Re: [INTERFACES] Re: [HACKERS] changes in 6.4

From: Hannu Krosing <hannu(at)trust(dot)ee>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, David Hartwig <daveh(at)insightdist(dot)com>, hackers(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Re: [HACKERS] changes in 6.4
Date: 1998-07-17 07:18:03
Message-ID: 35AEFAAB.2C8CC9B0@trust.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-interfaces

Thomas G. Lockhart wrote:
>
> > And there is no way of doing (at least presently):
> >
> > select * from table where (val1,val2,val3)
> > in (select 1,1,1 union select 1,1,2);
>
> I'll look at that...

Could it be a good idea to have the syntax (at least for constants),
changed to (or at least allowed ;) to the following:

select * from table
where (val1,val2,val3)
in ( (1,1,3), (1,1,2), (1,1,1) );

Which brings us to another issue:

Should (val1,val2,val3) be just some construct that gets rewritten to
"something else" in parser, or should it create an instance of
anonymus row type ?

Allowing anonymus row type creation on the fly would allow us many nice
things, for example a way to create new types of aggregate functions,
like
FOR_MAX((price,date)), so that we could do the following in only one
pass

SELECT
FOR_MAX((price,sales_datetime)) as last_price,
MAX(sales_datetime) as last_sale,
WEEK(sales_datetime) week_nr
GROUP BY
week_nr
;

This would get the prices and dates of each weeks last sale, and is
much hairier to do using just standard sql.

Hannu

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Antonio Garcia Mari 1998-07-17 09:47:04 Re: [GENERAL] Autonumbering column
Previous Message Brian 1998-07-17 02:53:54 Re: [GENERAL] listing all tables

Browse pgsql-hackers by date

  From Date Subject
Next Message David Gross 1998-07-17 08:59:17 using C++ to define new functions
Previous Message Bruce Momjian 1998-07-17 05:15:37 Re: [HACKERS] proposals for LLL, part 1

Browse pgsql-interfaces by date

  From Date Subject
Next Message Antonio Garcia Mari 1998-07-17 09:47:04 Re: [INTERFACES] Autoincrement
Previous Message Wari Wahab 1998-07-17 06:59:47 Autoincrement