Unix Technical Forum

BUG #2437: Rules for COPY

This is a discussion on BUG #2437: Rules for COPY within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2437 Logged by: Anton Fedorov Email address: datacompboy@mail.ru PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:59 AM
Anton Fedorov
 
Posts: n/a
Default BUG #2437: Rules for COPY


The following bug has been logged online:

Bug reference: 2437
Logged by: Anton Fedorov
Email address: datacompboy@mail.ru
PostgreSQL version: 8.1.3-3
Operating system: debian linux
Description: Rules for COPY
Details:

Looks like COPY bypass rules 'ON INSERT INSTEAD'.
I think, COPY .. FROM ... should be equal to
INSERT INTO ... SELECT * FROM ...
and be catched by INSERT rule.

Otherwise, need to create new temporary table, load data into, INSERT ..
SELECT ..., DROP TABLE, while it seems strange.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:59 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #2437: Rules for COPY

"Anton Fedorov" <datacompboy@mail.ru> writes:
> Looks like COPY bypass rules 'ON INSERT INSTEAD'.


That's the documented behavior. We're unlikely to change it because
it'd slow COPY down substantially, which'd negate its main use of being
a bulk data loading mechanism.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 10:59 AM
Jim C. Nasby
 
Posts: n/a
Default Re: BUG #2437: Rules for COPY

On Mon, May 15, 2006 at 09:50:57AM -0400, Tom Lane wrote:
> "Anton Fedorov" <datacompboy@mail.ru> writes:
> > Looks like COPY bypass rules 'ON INSERT INSTEAD'.

>
> That's the documented behavior. We're unlikely to change it because
> it'd slow COPY down substantially, which'd negate its main use of being
> a bulk data loading mechanism.


http://pgfoundry.org/projects/pgloader/ might allow for using inserts
and therefore firing ON INSERT rules. Another option is to COPY into a
temporary table, and then to INSERT INTO.

The problem with COPY not firing ON INSERT is that COPY is the only
convenient way to load data in that doesn't already happen to be
formatted as INSERT statements, so it would be nice if there was an
option that allowed you to have it follow normal INSERT conventions. Or
perhaps if there was a utility that allowed reading from an on-disk file
as if it was a table... I know Oracle has that ability, maybe
EnterpriseDB has it as well...
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:54 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com