Re: psql: SELECT INTO with FETCH_COUNT enabled - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: psql: SELECT INTO with FETCH_COUNT enabled
Date
Msg-id 201005282238.o4SMcu208435@momjian.us
Whole thread Raw
In response to psql: SELECT INTO with FETCH_COUNT enabled  (Josh Williams <joshwilliams@ij.net>)
List pgsql-bugs
I have added the following TODO:

    Fix FETCH_COUNT to handle SELECT ... INTO and WITH queries
        *  http://archives.postgresql.org/pgsql-hackers/2010-05/msg01565.php
        * http://archives.postgresql.org/pgsql-bugs/2010-05/msg00192.php

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

Josh Williams wrote:
> While tinkering with some psql settings on 9.0beta1...
>
> [local]:5432|postgres=# \set FETCH_COUNT 1
> [local]:5432|postgres=# SELECT foo INTO bar FROM baz;
> ERROR:  DECLARE CURSOR cannot specify INTO
> LINE 2: SELECT foo INTO bar FROM baz;
>                         ^
> [local]:5432|postgres=#!
>
> If I'm reading it right its using src/bin/psql/common.c's
> is_select_command() to determine if the query is cursor-able, and that
> function is just looking to see that the query starts with 'select' (or
> 'values'.)
>
> I'm not sure catching a non-alias use of INTO will be all that easy here
> without adding undue complexity.  So considering no one else has
> reported it at least than I've been able to find, +1 for leaving it as
> is.  Just thought I'd post it in case anyone has any better ideas for
> tackling it.
>
> - Josh
>
>
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #5478: ILIKE operator returns wrong result
Next
From: Bruce Momjian
Date:
Subject: Re: psql or pgbouncer bug?