Re: [GENERAL] string_to_array with empty input

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tino Wildenhain <tino(at)living-examples(dot)com>
Cc: Sam Mason <sam(at)samason(dot)me(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] string_to_array with empty input
Date: 2009-04-02 11:50:18
Message-ID: 603c8f070904020450x20060643ie49a36f577cbc3a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

>> I'm speaking primarily of functions as first-class objects, though
>> closures would be nice too.   But consider an operation like
>>
>> UPDATE rel SET col1 = MAP ( f OVER col2 )
>>
>> We need to be able to determine whether this is well-typed, just as we
>> do now for any other SQL query.  Specifically, we need to check that f
>> is a one argument function whose argument type is that of col2 and
>> whose return type is that of col1.  My understanding is that right now
>> types are represented as 32-bit OIDs.  I think they'd need to be some
>> sort of more complex structure in order to handle cases like this.
>
> Would above query not be written as
>
> UPDATE rel SET col1 = f(col2);
>
> anyway or am I missing something?

Ah, sorry, I mis-stated it slightly. I was imagining that col2 and
col1 where arrays, and f was a function between the base types, not
the array types.

> imho, having generic tuple tables as we have in INSERT INTO (...)
> VALUES (...),(...),(...)
>
> to be useable in all places like a real table would be helpful in
> many cases.
>
> But this might be completely unrelated :)

Probably. :-)

...Robert

In response to

Browse pgsql-general by date

  From Date Subject
Next Message linnewbie 2009-04-02 12:48:40 Posgres Adding braces at beginning and end of text (html) content
Previous Message bernhard_s 2009-04-02 11:40:36 Re: %r in restore_command?

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-04-02 11:55:15 Re: Bug of ALTER TABLE DROP CONSTRAINT
Previous Message Magnus Hagander 2009-04-02 08:50:08 Re: [COMMITTERS] pgsql: Explicitly bind gettext to the correct encoding on Windows.