Re: [SQL] notice on transaction abort?

2001-01-19 Thread Kovacs Zoltan Sandor
On Thu, 18 Jan 2001, Stephan Szabo wrote: > Well, you should have gotten an error message from the statement that was > in error in any case, but maybe a message on the commit/end that says > that the transaction was aborted due to errors would be nice. Or both. Zoltan

[SQL] notice on transaction abort?

2001-01-18 Thread Kovacs Zoltan Sandor
I realized that an error will abort a transaction all the time. Unfortunately I usually send millions of rows of INSERTs in a transaction and if there is some error in the middle of the code I got the message if I try to INSERT a new row: NOTICE: current transaction is aborted, queries ignored u

[SQL] speed of recursive queries, 7.1

2001-01-17 Thread Kovacs Zoltan Sandor
I experienced terrible speed decrease with some recursive PLPGSQL functions in 7.1beta3. Has anybody got similar behaviour? Details soon... Zoltan

Re: [SQL] Support for arrays in PL/pgSQL

2001-01-04 Thread Kovacs Zoltan Sandor
> Saluton, > > does anyone know whether there is any support at all for arrays > in PL/pgSQL? A second comment: as far as I know, no support for built-in array variables at all. I usually create temporary tables for doing jobs I need arrays. Zoltan

Re: [SQL] Support for arrays in PL/pgSQL

2001-01-04 Thread Kovacs Zoltan Sandor
On Tue, 2 Jan 2001, Albert REINER wrote: > Saluton, > > does anyone know whether there is any support at all for arrays > in PL/pgSQL? Yes, but it is not suggested for use. See ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz/Linux/PostgreSQL/strukturak/examples.tar.gz, function csoporttag_e.

Re: [SQL] plpgsql ?

2000-12-20 Thread Kovacs Zoltan Sandor
> CREATE FUNCTION autono (text,text) RETURNS text AS ' > DECLARE > a1 ALIAS FOR $1; > a2 ALIAS FOR $1; > ret_val text; > BEGIN > select tna into ret_val from a1 where pamt_no=a2; > > RETURN ret_val; > END;' LANGUAGE 'plpgsql' > > > error run " select tna into ret_val

Re: [SQL] to_char() causes backend to close connection

2000-12-14 Thread Kovacs Zoltan Sandor
> A problem (IMHO it's not problem) with 'now()::abstime' is in 7.1 too. > But why you not use directly now()? My aim is to get this format for the time '5 minutes ago'. So I need something like select to_char(now()-'5 minutes','YYMMDDHH24MI') but this doesn't work due to the missing type conv

[SQL] to_char() causes backend to close connection

2000-12-14 Thread Kovacs Zoltan Sandor
Hi, this query gives different strange results: select to_char(now()::abstime,'YYMMDDHH24MI'); I get e.g. a "backend closed the channel unexpectedly..." error with successful or failed resetting attempt (indeterministic) or ERROR: to_char/to_number(): not unique decimal poit or NOTICE: Por

[SQL] arrays in PostgreSQL

2000-12-14 Thread Kovacs Zoltan Sandor
> Is it possible to return an array from a plpgsql function?? AICR, it is impossible. In addition, it's not suggested using arrays at all: the array based logic is foreign from SQL solutions. In fact PostgreSQL doesn't have a good array support. My friend who built our logic data model, said that

Re: [SQL] plpgsql

2000-12-11 Thread Kovacs Zoltan Sandor
> Hi, there, > > Is there any way to handle exception ( such as cannot insert duplicate key on > a unique index) in > plpgsql function? > > I don't want it abort whole transaction instead I want to do something else if > it happened, > but I don't want to use a select stmt first to waste the tim

Re: [SQL] pgpl-problem, what's wrong with my loop?

2000-11-20 Thread Kovacs Zoltan Sandor
On Mon, 20 Nov 2000, Bruno Boettcher wrote: > On Mon, Nov 20, 2000 at 06:06:52PM +0100, Kovacs Zoltan Sandor wrote: > > > FOR arow IN SELECT currency,amount FROM journal WHERE col=sumup LOOP > > My opinion is the problem that you cannot give a column name as a > > par

Re: [SQL] pgpl-problem, what's wrong with my loop?

2000-11-20 Thread Kovacs Zoltan Sandor
> FOR arow IN SELECT currency,amount FROM journal WHERE col=sumup LOOP My opinion is the problem that you cannot give a column name as a parameter. But I'm not sure. This never worked for me. The thing here happens that you get all rows if and only if $1=$2 (as strings) and if they are not equal

Re: [SQL] Return from stored procedures

2000-11-10 Thread Kovacs Zoltan Sandor
> Probably a very simple question, but how do you define a function that > returns the sucess of an insert or update in a function i.e. > > CREATE FUNCTION foo ( varchar, int8 ) RETURNS bool > AS 'UPDATE table WHERE something' > LANGUAGE 'sql'; With SQL functions you can't (as far as I kn

Re: [SQL] Need info: pl/pgsql performance

2000-10-31 Thread Kovacs Zoltan Sandor
On Mon, 23 Oct 2000, najm Hashmi wrote: > Hi, I would to know if there is any articles or books that talk about > pl/pgsql performance especially versus C. Thanking you in advance for > your help. I can only say what the documentation says about it in the "Overview" section (please read it if

[SQL] PLPGSQL examples

2000-10-31 Thread Kovacs Zoltan Sandor
Hi Najm, have you tried the test examples shipped in the tarball (src/pl/plpgsql/test)? In addition, you can find *lots* of examples (mostly with Hungarian comments) on ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz/Linux/PostgreSQL/strukturak/* PLPGSQL is one of the best things in PostgreSQ

Re: [SQL] returning a recordset with pl/pgsql

2000-08-16 Thread Kovacs Zoltan Sandor
> Is it possible to return recordsets using pl/pgsql? > If so, how do I declare the return type in the declaration? AFAIK you can't. I suggest you using temporary tables instead. Regards, Zoltan

[SQL] select from table

2000-06-29 Thread Kovacs Zoltan Sandor
I would like to do something like this: create function x(varchar) returns setof int4 as 'select * from $1;' language 'sql'; Unfortunately, the parser drops me back: I cannot use any parameters after the keyword "from". How to solve this? A solution in PL/PgSQL would be also nice. Thanks in adv

[SQL] SQL functions - bug?

2000-06-05 Thread Kovacs Zoltan Sandor
I realized the following facts using SQL language functions: There is a function "function_y(...)" which returns int4; a table z and two functions: CREATE FUNCTION function_x1() RETURNS int4 AS ' select function_y(any_of_fields_of_table_z) from z; ' LANGUAGE 'SQL'; This calls function_y(...) on