Re: vacuum from ecpg

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Lynn(dot)Tilby(at)asu(dot)edu
Cc: pgsql-general(at)postgresql(dot)org, ltilby(at)asu(dot)edu
Subject: Re: vacuum from ecpg
Date: 2003-11-15 20:41:29
Message-ID: 3FB68F79.9090808@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I might be wrong on this but I think that ecpg using transactions by
default for each query.
Perhaps turning on autocommit?

J

Lynn(dot)Tilby(at)asu(dot)edu wrote:

>The following program produces the output below...
>It is built with:
>
>vrfy_prob: vrfy_prob.cpg
> /usr/local/pgsql/bin/ecpg -I/usr/local/pgsql/include -o vrfy_prob.c vrfy_prob.cpg
> gcc -g${DEBUG} -I/usr/include/pgsql -o vrfy_prob -lm -lc -lecpg -lpq vrfy_prob.c
>
>I am not using a BEGIN/END block, though the error messages indicate
>that I am.
>
>How can I do a vacuum analyze from within embedded sql in a c program
>that works?
>
>Thanks for your help!
>
>Lynn Tilby
>ltilby(at)asu(dot)edu
>
>******************************* PROGRAM ********************************
>#include <stdlib.h>
>#include <ctype.h>
>
>EXEC SQL INCLUDE sqlca; /* include the sql debugging stuff... */
>
>/********* !!!!!!!!!! POSTGRES SQL DEBUGGING STRUCTURE FIELDS ************/
>#define DEBUG_SQL printf("sqlcaid = %s\n", sqlca.sqlcaid); printf("sqlabc =
>%f\n", sqlca.sqlabc); printf("sqlcode = %f\n", sqlca.sqlcode);
>printf("sqlca.sqlerrm.sqlerrml = %d\n", sqlca.sqlerrm.sqlerrml);
>printf("sqlca.sqlerrm.sqlerrmc = %s\n", sqlca.sqlerrm.sqlerrmc); printf("sqlerrp
>= %s\n", sqlca.sqlerrp); printf("sqlerrd = %f\n", sqlca.sqlerrd); printf("sqlext
>= %s\n", sqlca.sqlext);
>
>int main()
>{
>
> EXEC SQL BEGIN DECLARE SECTION; /* declare the variables used by sql */
>
> EXEC SQL END DECLARE SECTION; /* declare the variables used by sql */
>
> EXEC SQL CONNECT TO pma;
> EXEC SQL WHENEVER sqlerror sqlprint; /* turn on verbose sql error ckg */
>
>DEBUG_SQL
> EXEC SQL VACUUM ANALYZE optn_cent_xref;
>DEBUG_SQL
>}
>
>******************************* OUTPUT ********************************
>
>[lynn(at)polaris strdl_sim]$ ./vrfy_prob
>sqlcaid = SQLCA Œ
>sqlabc = -1.998680
>sqlcode = -1.998680
>sqlca.sqlerrm.sqlerrml = 0
>sqlca.sqlerrm.sqlerrmc =
>sqlerrp = NOT SET
>sqlerrd = -1.998680
>sqlext =
>sql error Postgres error: ERROR: VACUUM cannot run inside a BEGIN/END block
> line 23.
>sqlcaid = SQLCA Œ
>sqlabc = -1.998680
>sqlcode = -1.998681
>sqlca.sqlerrm.sqlerrml = 76
>sqlca.sqlerrm.sqlerrmc = Postgres error: ERROR: VACUUM cannot run inside a
>BEGIN/END block
> line 23.
>sqlerrp = 23.
>sqlerrd = -1.998680
>sqlext =
>[lynn(at)polaris strdl_sim]$
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 7: don't forget to increase your free space map settings
>
>

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC - S/JDBC
Postgresql support, programming, shared hosting and dedicated hosting.
+1-503-222-2783 - jd(at)commandprompt(dot)com - http://www.commandprompt.com
PostgreSQL.Org - Editor-N-Chief - http://www.postgresql.org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Wheeler 2003-11-15 21:41:26 Re: GUIDs
Previous Message Michael Meskes 2003-11-15 19:37:28 Re: vacuum from ecpg