Re: Question about copy from with timestamp format

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Sherrylyn Branchaw <sbranchaw(at)gmail(dot)com>
Cc: Alban Hertroys <haramrae(at)gmail(dot)com>, Murali M <manips2002(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Question about copy from with timestamp format
Date: 2015-07-30 17:22:10
Message-ID: 55BA5D42.9090203@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/30/2015 08:59 AM, Sherrylyn Branchaw wrote:
> From here:
>
> http://www.postgresql.org/docs/9.4/interactive/sql-copy.html
>
> "COPY can only be used with plain tables, not with views. However, you
> can write COPY (SELECT * FROM viewname) TO ...."
>
> Right, so you can COPY FROM a view, but not, as far as I can tell, TO a
> view, unless Alban found a workaround.

As to your other question:

"Still curious why the triggers I'm writing won't fire before my
statement errors out on copying to a view, or inserting an out-of-range
timestamp, when the trigger would resolve all the illegal operations if
it just fired first."

See this thread:

http://www.postgresql.org/message-id/AANLkTik6-sNYpAbiaZtipPJkqxbOrfVAZb1EFk0CNHYw@mail.gmail.com

in particular this post:

http://www.postgresql.org/message-id/24930.1276658060@sss.pgh.pa.us

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2015-07-30 18:47:34 Re: Lots of stuck queries after upgrade to 9.4
Previous Message Adrian Klaver 2015-07-30 16:56:41 Re: Question about copy from with timestamp format