From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | steve k <steven(dot)c(dot)kohler(at)nasa(dot)gov>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: PQputCopyData dont signal error |
Date: | 2014-04-07 09:27:43 |
Message-ID: | 20140407092743.GA18105@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Apr 01, 2014 at 01:53:13PM -0400, Robert Haas wrote:
> > One of the things you mentioned is "I often find it necessary to refer to
> > existing examples of code when trying to figure out how to do things
> > correctly". I couldn't agree more. Haven't seen one yet, but found plenty
> > of discussion that tap danced around one or more of the components of the
> > copy, put, end paradigm. Maybe I should have just asked for a sample code
> > snippet but didn't after a day or so of frustration and trying to piece
> > together other people's incomplete samples.
>
> FWIW, I've generally found that the best examples are what's in the
> core distribution. I'd go and look at a tool like psql or pg_restore
> and find the code that handles this, and then copy it and cut it down
> to what you need.
To move the conversation along:
https://github.com/postgres/postgres/blob/master/src/bin/psql/copy.c#L664
Seems possibly even more robust than most people will code, but it's
had a lot of real world testing.
Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.
-- Arthur Schopenhauer
From | Date | Subject | |
---|---|---|---|
Next Message | Rajeev rastogi | 2014-04-07 09:53:45 | Re: Autonomous Transaction (WIP) |
Previous Message | Etsuro Fujita | 2014-04-07 08:45:53 | Re: Get more from indices. |