Re: Question about function - Mailing list pgsql-general

From Tom Lane
Subject Re: Question about function
Date
Msg-id 16003.1016121604@sss.pgh.pa.us
Whole thread Raw
In response to Question about function  (Bruno Lopes (Desenvolvimento) <blvieira@pcsolution.com.br>)
List pgsql-general
Bruno Lopes (Desenvolvimento) <blvieira@pcsolution.com.br> writes:
> CREATE FUNCTION test() RETURNS bool AS 'INSERT INTO b (nome) VALUES (\'PQP\');' LANGUAGE 'sql';
> function declared to return type bool, but final query is not a retrieve

> obviously my return type is incorrect... so what should I use?

It's unhappy because you're not returning anything (no final SELECT
statement).

You might consider updating to a more recent PG version; that error
message hasn't been worded that way for quite awhile.

            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Select not using primary key index
Next
From: Andre Radke
Date:
Subject: problem with array of boxes