[GENERAL] How to discard partially retrieved result set with the C API?

2014-02-18 Thread
When single row mode is enabled, after retrieving part of the result set, I'm no longer interested in the rest of it (due to error handling or other reasons). How can I discard the result set without repeatedly calling PQgetResult() in such situation ? The result set may be quite large and it's ine

Re: [GENERAL] Weird "function does not exist" error.

2013-11-25 Thread
My apologies, I connected to the wrong database in my C code ... Sorry, if this E-mail bothers you. On Mon, Nov 25, 2013 at 5:33 PM, 邓尧 wrote: > Hi, > > I ran into a "function does not exist" error when invoking a function > created by myself. What's weird

[GENERAL] Weird "function does not exist" error.

2013-11-25 Thread
Hi, I ran into a "function does not exist" error when invoking a function created by myself. What's weird is that the function works perfectly if I invoke it through the command line tool "psql" but fails if I invoke it through the C API. The SQL to create the function is: CREATE OR REPLACE

Re: [GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-09 Thread
On Mon, Jan 9, 2012 at 9:53 AM, Jon Nelson wrote: > On Sun, Jan 8, 2012 at 7:13 PM, 邓尧 wrote: > > I have enabled the autocommit feature of psycopg2, and removed all the > > transactions in source code, also changed the sql statement to the > > following: > > &

Re: [GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-08 Thread
rote: > > On 3 Jan 2012, at 5:20, 邓尧 wrote: > > > >> Hi, > >> > >> I'm new to pgsql, I need the do something like the "INSERT IGNORE" in > mysql. After some searching I got a solution, which is adding a "do instead > nothing" rule

[GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-02 Thread
Hi, I'm new to pgsql, I need the do something like the "INSERT IGNORE" in mysql. After some searching I got a solution, which is adding a "do instead nothing" rule to the corresponding table, but it fails sometimes. The table and the rule is created with the following sql statements: create seque