Обсуждение: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT again

Поиск
Список
Период
Сортировка

CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT again

От
"Ilja Golshtein"
Дата:
Hello!

According to Tom's message
http://archives.postgresql.org/pgsql-general/2005-06/msg00476.php
we have the stuff supposed to return number of rows affected by
CREATE .. AS SELECT or SELECT ... INTO in 8.1 beta.

The patch is at place, though PQcmdTuples returns nothing. It's not
a big surprise considering PQcmdTuples likes INSERT, DELETE, FETCH
or MOVE only. The real pain is cmdStatus does not contain number
of affected rows.

Any suggestions? Is it possible to calculate number of rows
in newly created table without explicit SELECT COUNT(*)?
I don't use PL/pgSQL.

Thanks a lot.

--
Best regards
Ilja Golshtein

Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

От
Bruce Momjian
Дата:
This change relates only to SPI, meaning plpsql.  It does not help libpq.

---------------------------------------------------------------------------

Ilja Golshtein wrote:
> Hello!
>
> According to Tom's message
> http://archives.postgresql.org/pgsql-general/2005-06/msg00476.php
> we have the stuff supposed to return number of rows affected by
> CREATE .. AS SELECT or SELECT ... INTO in 8.1 beta.
>
> The patch is at place, though PQcmdTuples returns nothing. It's not
> a big surprise considering PQcmdTuples likes INSERT, DELETE, FETCH
> or MOVE only. The real pain is cmdStatus does not contain number
> of affected rows.
>
> Any suggestions? Is it possible to calculate number of rows
> in newly created table without explicit SELECT COUNT(*)?
> I don't use PL/pgSQL.
>
> Thanks a lot.
>
> --
> Best regards
> Ilja Golshtein
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT again

От
"Ilja Golshtein"
Дата:
Hi!

>This change relates only to SPI, meaning plpsql.  It does not help libpq.

Thanks for response.

I see.

Any hope it would be possible
to calculate number of rows inserted
in newly created table via
CREATE .. AS SELECT?

--
Best regards
Ilja Golshtein