Tom Lane wrote:
I think that there are two likely possibilities for the result format:
* "Raw" data after just the de-escaping and column separation steps.
Array of text is probably the right thing here, at least for a text COPY
(doesn't seem to cover the binary case though).
* The data conve
Pavel Stehule wrote:
2009/12/17 Andrew Dunstan :
Recently there was discussion about allowing a COPY statement to be a SELECT
target, returning a text array, although the syntax wasn't really nailed
down that I recall. I was thinking that we might have
COPY RETURNING ARRAY FROM ...
ins
2009/12/17 Andrew Dunstan :
>
> Recently there was discussion about allowing a COPY statement to be a SELECT
> target, returning a text array, although the syntax wasn't really nailed
> down that I recall. I was thinking that we might have
>
> COPY RETURNING ARRAY FROM ...
>
> instead of
>
> C
Hi,
Le 17 déc. 2009 à 19:39, Josh Berkus a écrit :
> Mind you, returning (arbitrary expression) would be even better, but if
> we can get returning TEXT[] for 8.5, I think it's worth doing on its own.
Well, you already have it as soon as you have text[]:
INSERT INTO destination
SELECT row[0],
On Thu, Dec 17, 2009 at 1:50 PM, Tom Lane wrote:
> Robert Haas writes:
>> You might want to specify column names as well as well as types, in
>> this second case.
>
> Well, we could do it like VALUES: arbitrarily name the columns column1
> ... columnN and tell people to use an alias if they want
Robert Haas writes:
> You might want to specify column names as well as well as types, in
> this second case.
Well, we could do it like VALUES: arbitrarily name the columns column1
... columnN and tell people to use an alias if they want other names.
If it's convenient to fit column names into th
On Thu, Dec 17, 2009 at 1:37 PM, Tom Lane wrote:
> Andrew Dunstan writes:
>> Tom Lane wrote:
>>> The problem with COPY FROM is that it hard-wires a decision that there
>>> is one and only one possible result format, which I think we pretty
>>> much proved already is the wrong thing. I'm not thri
> In answer to Heiki's argument, what I wanted was exactly to return an
> array of text for each row. Whatever we have needs to be able to handle
> to possibility of ragged input (see previous discussion) so we can't tie
> it down too tightly.
I would have *lots* of use for this feature.
Mind yo
Andrew Dunstan writes:
> Tom Lane wrote:
>> The problem with COPY FROM is that it hard-wires a decision that there
>> is one and only one possible result format, which I think we pretty
>> much proved already is the wrong thing. I'm not thrilled with "RETURNING
>> ARRAY" either, but we need to le
Tom Lane wrote:
Heikki Linnakangas writes:
Andrew Dunstan wrote:
COPY RETURNING ARRAY FROM ...
It's not really returning an array, is it? It's returning a bag of rows
like a (sub)query.
How about just COPY FROM?
The problem with COPY FROM is that it har
Heikki Linnakangas writes:
> Andrew Dunstan wrote:
>> COPY RETURNING ARRAY FROM ...
> It's not really returning an array, is it? It's returning a bag of rows
> like a (sub)query.
> How about just COPY FROM?
The problem with COPY FROM is that it hard-wires a decision that there
is one and only o
On Thu, Dec 17, 2009 at 12:38 PM, David Fetter wrote:
> On Thu, Dec 17, 2009 at 12:28:50PM -0500, Robert Haas wrote:
>> On Thu, Dec 17, 2009 at 12:23 PM, Heikki Linnakangas
>> wrote:
>> > How about just COPY FROM? As in
>> >
>> > SELECT t[5] as a, 3*(t[3]::numeric) as b FROM (COPY FROM STDIN
>> >
On Thu, Dec 17, 2009 at 12:28:50PM -0500, Robert Haas wrote:
> On Thu, Dec 17, 2009 at 12:23 PM, Heikki Linnakangas
> wrote:
> > How about just COPY FROM? As in
> >
> > SELECT t[5] as a, 3*(t[3]::numeric) as b FROM (COPY FROM STDIN
> > CSV) as t
>
> I had the same thought. Though it would also b
On Thu, Dec 17, 2009 at 12:23 PM, Heikki Linnakangas
wrote:
> How about just COPY FROM? As in
>
> SELECT t[5] as a, 3*(t[3]::numeric) as b FROM (COPY FROM STDIN CSV) as t
I had the same thought. Though it would also be nice to allow something like:
COPY (type1, type2, type3, type4) FROM STDIN C
Andrew Dunstan wrote:
>
> Recently there was discussion about allowing a COPY statement to be a
> SELECT target, returning a text array, although the syntax wasn't really
> nailed down that I recall. I was thinking that we might have
>
>COPY RETURNING ARRAY FROM ...
>
> instead of
>
>C
Recently there was discussion about allowing a COPY statement to be a
SELECT target, returning a text array, although the syntax wasn't really
nailed down that I recall. I was thinking that we might have
COPY RETURNING ARRAY FROM ...
instead of
COPY tablename opt_column_list FROM ...
16 matches
Mail list logo