Home > Archive > PostgreSQL Bugs > November 2005 > BUG #2074: Error switching connection in embedded PostgreSQL program









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author BUG #2074: Error switching connection in embedded PostgreSQL program
Edoardo Innocenti

2005-11-29, 3:24 am


The following bug has been logged online:

Bug reference: 2074
Logged by: Edoardo Innocenti
Email address: edoardo.innocenti@sdb.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

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com