BUG #3943: ecpg doesn't like "inet" operator - Mailing list pgsql-bugs

From Arnaud
Subject BUG #3943: ecpg doesn't like "inet" operator
Date
Msg-id 200802081842.m18IgrmH017576@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #3943: ecpg doesn't like "inet" operator  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      3943
Logged by:          Arnaud
Email address:      arnaud.desmier@free.fr
PostgreSQL version: 8.3.0
Operating system:   linux debian etch
Description:        ecpg doesn't like "inet" operator
Details:

This is a sample of my C programm resuming the problem :

***************************************************
#include <stdio.h>
#include <stdlib.h>

int main()
{
  EXEC SQL BEGIN DECLARE SECTION;

  char *ip_address = "192.168.1.2";
  char ip_result[20];

  EXEC SQL END DECLARE SECTION;

  EXEC SQL WHENEVER SQLWARNING SQLPRINT;

  EXEC SQL CONNECT TO synch@localhost USER synch IDENTIFIED BY  synch;

  EXEC SQL SELECT text(inet :ip_address) INTO :ip_result;

  EXEC SQL DISCONNECT;

  printf("ip_result: %s\n", ip_result);

  return EXIT_SUCCESS;
}

***************************************************

And ecpg returns :
  test_sql.pgc:17: ERROR: syntax error at or near ":ip_address"

This error correpond with "EXEC SQL SELECT inet :ip_address;". If I remove
inet operator it works well. Of course text() does nothing when I remove
inet as postgres doesn't now it is an IP address.

pgsql-bugs by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: BUG #3942: Related to BUG #2568 and BUG #2859: VACUUM process hangs and does not respond to the kill signals
Next
From: "Dan Hrabarchuk"
Date:
Subject: BUG #3944: Unable to create a database using SQL_ASCII encoding