[SQL] How can this be legal syntax

2008-12-16 Thread Asko Oja
I was quite amazed to find that this piece of code actually works while reviewing code. I would prefer if it gave an error :) test=# create or replace function test(i_input text) returns text as $$ declare result text; begin SELECT CASE WHEN lower(i_input) ~ '^[a-z]' THEN

Re: [SQL] How can this be legal syntax

2008-12-16 Thread Alvaro Herrera
Asko Oja escribió: I was quite amazed to find that this piece of code actually works while reviewing code. I would prefer if it gave an error :) Yeah, me too. The functions posted by Josh Drake yesterday about constraint exclusion had something like select * from into temp table ...; (temp

Re: [SQL] How can this be legal syntax

2008-12-16 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Asko Oja escribió: I was quite amazed to find that this piece of code actually works while reviewing code. I would prefer if it gave an error :) Yeah, me too. As the plpgsql docs say, The INTO clause can appear almost anywhere in the SQL