On Wed, Feb 10, 2010 at 11:00:00AM +0900, Takahiro Itagaki wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > Where are we on this patch? We should at least implement the completion
> > for 'LANGUAGE' in 'DO', and use the existing pg_language query for
> > completion. I am attaching a patch that does exactly this.
> I don't think we need the patch except adding DO to the top-level sql_commands.
> Syntax of DO command is:
> DO code [ LANGUAGE lang_name ]
That's not the only syntax.
DO [LANGUAGE lang_name] code
also works, e.g.:
CREATE LANGUAGE plperl;
CREATE TABLE foo(id SERIAL PRIMARY KEY, t TEXT);
DO LANGUAGE plperl $$spi_exec_query(q[INSERT INTO foo(t) VALUES('aaa')]);$$;
SELECT * FROM foo;
The DO LANGUAGE lang_name code syntax is much clearer, as far as I'm
concerned, than putting the code block before the language anyhow. :)
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2010-02-11 20:32:32|
|Subject: Re: Re: [COMMITTERS] pgsql: Remove old-style VACUUM FULL (which was known for a little while |
|Previous:||From: Tom Lane||Date: 2010-02-11 20:26:53|
|Subject: Re: review: More frame options in window functions |