Unix Technical Forum

COPY FROM with CSV header

This is a discussion on COPY FROM with CSV header within the pgsql Hackers forums, part of the PostgreSQL category; --> Instead of ignoring the first line of a COPY FROM ... WITH CSV HEADER, what about allowing the first ...


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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 06:04 AM
Jim C. Nasby
 
Posts: n/a
Default COPY FROM with CSV header

Instead of ignoring the first line of a COPY FROM ... WITH CSV HEADER,
what about allowing the first line to be used as a list of field names?
This means you wouldn't have to include field order in the COPY command
if the names matched field names in the table.
--
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 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 06:07 AM
Andrew Dunstan
 
Posts: n/a
Default Re: COPY FROM with CSV header

Jim C. Nasby wrote:

>Instead of ignoring the first line of a COPY FROM ... WITH CSV HEADER,
>what about allowing the first line to be used as a list of field names?
>This means you wouldn't have to include field order in the COPY command
>if the names matched field names in the table.
>
>

It was debated ... could be dangerous, and you'd need extra syntax,
since we couldn't make it the default.

cheers

andrew

---------------------------(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 11:21 PM.


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