On Sat, 27 Aug 2011 18:36:14 -0400
Tom Lane wrote:
>Tarlika Elisabeth Schmitz writes:
>> SELECT INTO
>> country_id, region_id, town_id
>> country_fk, region_fk, id
>> FROM town
>> WHERE ...;
>
>> GET DIAGNOSTICS cnt = ROW_COUNT;
>> RAISE DEBUG 'COUNT %', cnt;
>
>> always returns 1
>
>Yeah. B
Tarlika Elisabeth Schmitz writes:
> SELECT INTO
> country_id, region_id, town_id
> country_fk, region_fk, id
> FROM town
> WHERE ...;
> GET DIAGNOSTICS cnt = ROW_COUNT;
> RAISE DEBUG 'COUNT %', cnt;
> always returns 1
Yeah. By default, SELECT INTO just fetches one row and stops;
it doesn't
On Sat, 27 Aug 2011 18:45:42 -0300
Osvaldo Kussama wrote:
>2011/8/27, Tarlika Elisabeth Schmitz
>:
>> Hello,
>>
>> In a PL/pgSQL trigger function, I try to select a record from table
>> "town" below.
>>
>> I am only interested in the result if the returned result set
>> contains exactly one resul
Hello,
In a PL/pgSQL trigger function, I try to select a record from table
"town" below.
I am only interested in the result if the returned result set contains
exactly one result.
If there is more than one result, I want to log the fact.
EXAMPLE pseudo code
select
country_fk, region_fk, id
fro