BUG #3943: ecpg doesn't like "inet" operator

From: "Arnaud" <arnaud(dot)desmier(at)free(dot)fr>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3943: ecpg doesn't like "inet" operator
Date: 2008-02-08 18:42:53
Message-ID: 200802081842.m18IgrmH017576@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3943
Logged by: Arnaud
Email address: arnaud(dot)desmier(at)free(dot)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(at)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dan Hrabarchuk 2008-02-08 20:24:14 BUG #3944: Unable to create a database using SQL_ASCII encoding
Previous Message Heikki Linnakangas 2008-02-08 18:11:39 Re: BUG #3942: Related to BUG #2568 and BUG #2859: VACUUM process hangs and does not respond to the kill signals