Bug in JDBC CREATE FUNCTION syntax?

Lists: pgsql-jdbc
From: Olivier Hubaut <olivier(at)scmbb(dot)ulb(dot)ac(dot)be>
To: PgSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Bug in JDBC CREATE FUNCTION syntax?
Date: 2003-12-10 09:27:45
Message-ID: 3FD6E711.2070601@scmbb.ulb.ac.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

I'm trying to do a create function using JDBC 3,0 in Eclipse IDE with
JFaceDBC plugin.

This function doesn't work:

CREATE FUNCTION @user_schema(at)(dot)@igloo_login(at)_log_constraints_set ()
RETURNS boolean
LANGUAGE SQL
AS '
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_transaction
ADD CONSTRAINT @user_schema(at)_@igloo_login(at)_log_transaction_pk
PRIMARY KEY (batch)
;
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_object
ADD CONSTRAINT
@user_schema(at)_@igloo_login(at)_log_object_batch_id_uq UNIQUE (batch, id)
;
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_object
ADD CONSTRAINT
@user_schema(at)_@igloo_login(at)_log_object_batch_id_class_pk PRIMARY KEY
(batch, id, class)
;
SELECT true;'
;

But the same, written using a different indetation protocol, works:

CREATE FUNCTION @user_schema(at)(dot)@igloo_login(at)_log_constraints_set ()
RETURNS boolean
LANGUAGE SQL
AS '
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_transaction
ADD CONSTRAINT @user_schema(at)_@igloo_login(at)_log_transaction_pk
PRIMARY KEY (batch); ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_object
ADD CONSTRAINT
@user_schema(at)_@igloo_login(at)_log_object_batch_id_uq UNIQUE (batch, id);
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_object
ADD CONSTRAINT
@user_schema(at)_@igloo_login(at)_log_object_batch_id_class_pk PRIMARY KEY
(batch, id, class)
; SELECT true;'
;

It seem's that the problem is about the semi-colon position. The
following query MUST be on the same line to make it works...

Does anyone else notice the same thing?

Thanks,


From: Kris Jurka <books(at)ejurka(dot)com>
To: Olivier Hubaut <olivier(at)scmbb(dot)ulb(dot)ac(dot)be>
Cc: PgSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Bug in JDBC CREATE FUNCTION syntax?
Date: 2003-12-10 09:35:43
Message-ID: Pine.LNX.4.33.0312100433060.3460-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Wed, 10 Dec 2003, Olivier Hubaut wrote:

> I'm trying to do a create function using JDBC 3,0 in Eclipse IDE with
> JFaceDBC plugin.

I don't know the JFaceDBC plugin does, but it seems like the @user_schema@
and what not indicate a replacement scheme. Is it possible that it also
alters the function body somehow?

I don't think this is a backend or JDBC problem. If you think otherwise a
more complete example that can be run without Eclipse will be necessary.

Kris Jurka


From: Olivier Hubaut <olivier(at)scmbb(dot)ulb(dot)ac(dot)be>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: PgSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Bug in JDBC CREATE FUNCTION syntax?
Date: 2003-12-10 09:52:03
Message-ID: 3FD6ECC3.6070403@scmbb.ulb.ac.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Kris Jurka wrote:

>
> On Wed, 10 Dec 2003, Olivier Hubaut wrote:
>
>
>>I'm trying to do a create function using JDBC 3,0 in Eclipse IDE with
>>JFaceDBC plugin.
>
>
> I don't know the JFaceDBC plugin does, but it seems like the @user_schema@
> and what not indicate a replacement scheme. Is it possible that it also
> alters the function body somehow?
>
> I don't think this is a backend or JDBC problem. If you think otherwise a
> more complete example that can be run without Eclipse will be necessary.
>
> Kris Jurka
>
>
>
Thanks for your fast response.

The @user_schema@ and other similar pattern are just ANT's variables
used to create the functions on demand. The real query contains the réal
schema name and function name, and this one doesn't work.

I've already tried to make some other multiple queries, without any
problems. There is only with the CREATE FUNCTION that this bug appear.

I don't Think JFaceDBC is the cause, it's only a quite simple editor to
write queries with colorization, noting else.

--
Ci-git une signature avortee.
** RIP **