Skip site navigation (1) Skip section navigation (2)

BUG #2074: Error switching connection in embedded PostgreSQL program

From: "Edoardo Innocenti" <edoardo(dot)innocenti(at)sdb(dot)it>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2074: Error switching connection in embedded PostgreSQL program
Date: 2005-11-29 08:05:43
Message-ID: 20051129080543.8FC84F0BF1@svr2.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2074
Logged by:          Edoardo Innocenti
Email address:      edoardo(dot)innocenti(at)sdb(dot)it
PostgreSQL version: 8.1.0
Operating system:   Linux
Description:        Error switching connection in embedded PostgreSQL
program
Details: 

We have problem on switching connection in PostgreSQL 8.1.0 database. Here a
test case:

#include <stdio.h>

main ()

{

 EXEC SQL BEGIN DECLARE SECTION;

 EXEC SQL END DECLARE SECTION;


 EXEC SQL CONNECT TO tcp:postgresql://localhost/basedati1 AS connection1
USER root;

 EXEC SQL CONNECT TO tcp:postgresql://localhost/basedati2 AS 

 connection2 USER root;

 EXEC SQL SET CONNECTION connection1;  (*)

 EXEC SQL DISCONNECT connection1;

 EXEC SQL DISCONNECT connection2;

}

We have syntax error when compiling this example with ecpg at line (*) 
(this is the syntax used in 8.1 documentation).

If we write

#include <stdio.h>


main ()

{

 EXEC SQL BEGIN DECLARE SECTION;

 EXEC SQL END DECLARE SECTION;


 EXEC SQL CONNECT TO tcp:postgresql://localhost/basedati1 AS  connection1
USER root;

 EXEC SQL CONNECT TO tcp:postgresql://localhost/basedati2 AS  connection2
USER root;

 EXEC SQL SET CONNECTION TO connection1;

 EXEC SQL DISCONNECT connection1;

 EXEC SQL DISCONNECT connection2;

}


we haven't compiling errors but we obtain [4-1] ERROR:  unrecognized
configuration parameter "connection" in PostgreSQL logs.

Thanks in advance

pgsql-bugs by date

Next:From: Kari LavikkaDate: 2005-11-29 14:05:44
Subject: postgres 8.1 crashing
Previous:From: Frank van VugtDate: 2005-11-29 00:36:00
Subject: Re: segfault of autovacuum process during restore - coredumps included

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group