Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Trent Shipley
On Thursday 2005-09-22 13:16, Andrew Dunstan wrote: > Jim C. Nasby wrote: > >While I'm all for COPY from views, I think I'd rather have the syntactic > >warts than code warts. ISTM that > > > >CREATE TEMP VIEW some_name AS SELECT * FROM table WHERE ...; > >COPY some_name TO stdout; > > > >is much u

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Bruce Momjian
AgentM wrote: > > > > While I'm all for COPY from views, I think I'd rather have the > > syntactic > > warts than code warts. ISTM that > > > > CREATE TEMP VIEW some_name AS SELECT * FROM table WHERE ...; > > COPY some_name TO stdout; > > > > is much uglier than > > > > COPY SELECT * FROM table W

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> writes: So why not do what everyone is agreed on now? I wasn't agreed on it ;-) The primary objection I've got is that I think this will be a very considerable increment of work for exactly zero increment in functionality, compared

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Jim Nasby
> From: Andrew Dunstan [mailto:[EMAIL PROTECTED] > Also, as nifty as this might be, we should also be prepared > for people > to complain that it runs a lot slower than vanilla COPY, because it > surely will. At which point we point out to them that it's also much faster than any of the other

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > So why not do what everyone is agreed on now? I wasn't agreed on it ;-) The primary objection I've got is that I think this will be a very considerable increment of work for exactly zero increment in functionality, compared to being able to copy from a

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Andrew Dunstan
Jim C. Nasby wrote: While I'm all for COPY from views, I think I'd rather have the syntactic warts than code warts. ISTM that CREATE TEMP VIEW some_name AS SELECT * FROM table WHERE ...; COPY some_name TO stdout; is much uglier than COPY SELECT * FROM table WHERE ... TO stdout; They are

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Hannu Krosing
On N, 2005-09-22 at 21:34 +0200, Hans-Juergen Schoenig wrote: > absolutely - the main advantage of the syntax tweak is that you can > add parameters more easily. Perhaps "COPY from SQL FUNCTIONS" is what wou need ? Or should we piggypack on (future) work needed for hierarchical queries and hav

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread AgentM
While I'm all for COPY from views, I think I'd rather have the syntactic warts than code warts. ISTM that CREATE TEMP VIEW some_name AS SELECT * FROM table WHERE ...; COPY some_name TO stdout; is much uglier than COPY SELECT * FROM table WHERE ... TO stdout; Or, you could just allow subqu

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Hans-Juergen Schoenig
absolutely - the main advantage of the syntax tweak is that you can add parameters more easily. best regards, hans On 22 Sep 2005, at 21:25, Jim C. Nasby wrote: On Wed, Sep 21, 2005 at 11:31:42AM -0400, Tom Lane wrote: =?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= <[EMAIL PROTECTE

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Jim C. Nasby
On Wed, Sep 21, 2005 at 11:31:42AM -0400, Tom Lane wrote: > =?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= <[EMAIL PROTECTED]> writes: > > Paolo Magnoli wrote: > >> Can't you just use a view? > > > no because a new is not a heap ... > > I think Paolo's idea is much better than munging the syntax of COP

Re: R: [HACKERS] feature proposal ...

2005-09-22 Thread Karel Zak
On Wed, 2005-09-21 at 11:31 -0400, Tom Lane wrote: > =?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= <[EMAIL PROTECTED]> writes: > > Paolo Magnoli wrote: > >> Can't you just use a view? > > > no because a new is not a heap ... > > I think Paolo's idea is much better than munging the syntax of COPY, > th

Re: R: [HACKERS] feature proposal ...

2005-09-21 Thread Cristian Prieto
Paolo Magnoli Cc: pgsql-hackers@postgresql.org; [EMAIL PROTECTED] Subject: Re: R: [HACKERS] feature proposal ... no because a new is not a heap ... em=# create view x as select * from pg_class; CREATE VIEW em=# copy x to '/tmp/x'; ERROR: cannot copy from view "x&qu

Re: R: [HACKERS] feature proposal ...

2005-09-21 Thread Joshua D. Drake
Hans-Jürgen Schönig wrote: no because a new is not a heap ... Why not use a function with a temporary table? That way you can pass a table parameter that is the temporary table with a select statement that you can populate the temp table with. Sincerely, Joshua D. Drake em=# create vie

Re: R: [HACKERS] feature proposal ...

2005-09-21 Thread Hans-Jürgen Schönig
Joshua D. Drake wrote: Hans-Jürgen Schönig wrote: no because a new is not a heap ... Why not use a function with a temporary table? That way you can pass a table parameter that is the temporary table with a select statement that you can populate the temp table with. Sincerely, Joshua D. D

Re: R: [HACKERS] feature proposal ...

2005-09-21 Thread Tom Lane
=?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= <[EMAIL PROTECTED]> writes: > Paolo Magnoli wrote: >> Can't you just use a view? > no because a new is not a heap ... I think Paolo's idea is much better than munging the syntax of COPY, though. Fixing COPY so that you *could* copy from a view would provi

Re: R: [HACKERS] feature proposal ...

2005-09-21 Thread Hans-Jürgen Schönig
no because a new is not a heap ... em=# create view x as select * from pg_class; CREATE VIEW em=# copy x to '/tmp/x'; ERROR: cannot copy from view "x" best regards, hans Paolo Magnoli wrote: Can't you just use a view? -Messaggio originale- Da: [EMAIL PROTE

R: [HACKERS] feature proposal ...

2005-09-21 Thread Paolo Magnoli
Can't you just use a view? -Messaggio originale- Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] conto di Hans-Jürgen Schönig Inviato: mercoledì 21 settembre 2005 15.30 A: pgsql-hackers@postgresql.org; [EMAIL PROTECTED] Oggetto: [HACKERS] feature proposal ... hackers, currently we have