RE: AW: German "umlaut insensitive" query

From: "Voillequin, Jean-Marc" <Jean-Marc(dot)Voillequin(at)moodys(dot)com>
To: "Jakob(dot)Witczak(at)dlr(dot)de" <Jakob(dot)Witczak(at)dlr(dot)de>, "peter(dot)eisentraut(at)2ndquadrant(dot)com" <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>, "jonathan(dot)katz(at)excoventures(dot)com" <jonathan(dot)katz(at)excoventures(dot)com>
Subject: RE: AW: German "umlaut insensitive" query
Date: 2019-09-24 10:10:08
Message-ID: BYAPR20MB26140531FB0138F4C49F54DABE840@BYAPR20MB2614.namprd20.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

SET command does not work as you expect in PLPGSQL. The _timeout argument is understood as a the new value (not the content of _timeout).
Use set_config function instead.

CREATE OR REPLACE FUNCTION public.set_transfer(_id integer, _tablename character varying, _timeout character varying)
RETURNS void
LANGUAGE plpgsql
AS $function$
begin
perform set_config('idle_in_transaction_session_timeout',_timeout,false);
end;$function$
;

Regards

-----Original Message-----
From: Jakob(dot)Witczak(at)dlr(dot)de <Jakob(dot)Witczak(at)dlr(dot)de>
Sent: Tuesday, September 24, 2019 10:38 AM
To: peter(dot)eisentraut(at)2ndquadrant(dot)com
Cc: pgsql-sql(at)postgresql(dot)org; jonathan(dot)katz(at)excoventures(dot)com
Subject: AW: AW: German "umlaut insensitive" query

Super, thank you so much for the tip.

I still have a little problem where I don't get far ;-)

I constantly get an error message when I give the SET a value.
Siehe unten.

ERROR: ERROR: invalid value for parameter "idle_in_transaction_session_timeout": "_timeout" CONTEXT: SQL statement "SET idle_in_transaction_session_timeout TO _timeout" PL/pgSQL function set_transfer(integer,character varying,character varying) Line 4 at SET SQL state: 22023SELECT * FROM

Call function:
set_transfer(87,'users','5000');

Function:

CREATE OR REPLACE FUNCTION public.set_transfer(_id integer, _tablename character varying, _timeout character varying)
RETURNS SETOF users
LANGUAGE 'plpgsql'AS $BODY$
BEGIN
SET idle_in_transaction_session_timeout TO _timeout; ......
END

I've tried almost everything. :-(

Best Regards
Jakob

-----Ursprüngliche Nachricht-----
Von: Peter Eisentraut [mailto:peter(dot)eisentraut(at)2ndquadrant(dot)com]
Gesendet: Dienstag, 24. September 2019 09:05
An: Witczak, Jakob; jonathan(dot)katz(at)excoventures(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Betreff: Re: AW: German "umlaut insensitive" query

On 2019-09-23 07:57, Jakob(dot)Witczak(at)dlr(dot)de wrote:
> Thanks for the quick answer. I am looking forward to the new
> PostgresSQL version. Thanks

In the meantime, the unaccent contrib module can also help.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
-----------------------------------------

Moody's monitors email communications through its networks for regulatory compliance purposes and to protect its customers, employees and business and where allowed to do so by applicable law. The information contained in this e-mail message, and any attachment thereto, is confidential and may not be disclosed without our express permission. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited. If you have received this message in error, please immediately notify us by telephone, fax or e-mail and delete the message and all of its attachments. Every effort is made to keep our network free from viruses. You should, however, review this e-mail message, as well as any attachment thereto, for viruses. We take no responsibility and have no liability for any computer virus which may be transferred via this e-mail message.

This email was sent to you by Moody’s Investors Service EMEA Limited
Registered office address:
One Canada Square
Canary Wharf
London, E14 5FA
Registered in England and Wales No: 8922701

-----------------------------------------

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Karen Goh 2019-09-25 15:03:29 How do I get rid of version 10 Postgresql completely ?
Previous Message Jakob.Witczak 2019-09-24 08:38:29 AW: AW: German "umlaut insensitive" query