Re: [SQL] Problem with return type of function ??? (corrected)

2009-10-24 Thread Denis BUCHER
Tom Lane a écrit : > Denis BUCHER writes: >> To do this it will be a little complicated because of table >> dependencies... And it could bug again at the next DROP COLUMN... Is >> there a way to change my function (RETURN SETOF part) to specify the >> column names/

Re: [SQL] Problem with return type of function ??? (corrected)

2009-10-22 Thread Denis BUCHER
Hi Tom, Another question : Tom Lane a écrit : > Denis BUCHER writes: >> I have a strange problem, because it worked in a fonction for a table, >> and now I created the same (?) function for another table and it doesn't >> work... > >> The functi

Re: [SQL] Problem with return type of function ??? (corrected)

2009-10-22 Thread Denis BUCHER
Hello Tom, Tom Lane a écrit : > Denis BUCHER writes: >> I have a strange problem, because it worked in a fonction for a table, >> and now I created the same (?) function for another table and it doesn't >> work... > >> The function is accepted but at runtime

Re: [SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
Richard Huxton a écrit : >>> The other thing you could try is printing out row before returning it: >>> RAISE NOTICE 'row = %', row; >>> RETURN NEXT ROW; >>> It might be you've not got what you were expecting. >> Thanks a lot, good idea... >> >> But it looks good : > > Hmm... > >>> SELECT * F

Re: [SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
Hello Richard, Richard Huxton a écrit : >> I saw somwhere it could be the order of the fields ? > > Not if you are doing "SELECT * FROM". > > Create an empty test database and a short script to create the table and > function, insert a couple of rows then call the function. If you wrap > the who

Re: [SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
Hello Richard, Richard Huxton a écrit : ERREUR: wrong record type supplied in RETURN NEXT CONTEXTE : PL/pgSQL function "hds_bw_find_sn_live" line 26 at return next Does someone maybe knows what it could be ? This is (a part of) my function : > CREATE OR REPL

[SQL] Problem with return type of function ??? (corrected)

2009-10-22 Thread Denis BUCHER
Hello, (CORRECTED VERSION OF MY PREVIOUS EMAIL) I have a strange problem, because it worked in a fonction for a table, and now I created the same (?) function for another table and it doesn't work... The function is accepted but at runtime I get : ERREUR: wrong record type supplied in RETURN NE

Re: [SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
Richard Huxton a écrit : >> ERREUR: wrong record type supplied in RETURN NEXT >> CONTEXTE : PL/pgSQL function "hds_bw_find_sn_live" line 26 at return next >> >> Does someone maybe knows what it could be ? >> >> This is (a part of) my function : >> >>> CREATE OR REPLACE FUNCTION rma.find_sn_live (v

[SQL] Problem with return type of function ???

2009-10-22 Thread Denis BUCHER
Hello, I have a strange problem, because it worked in a fonction for a table, and now I created the same (?) function for another table and it doesn't work... The function is accepted but at runtime I get : ERREUR: wrong record type supplied in RETURN NEXT CONTEXTE : PL/pgSQL function "hds_bw_f

Re: [SQL] Question about encoding

2009-08-25 Thread Denis BUCHER
Hello, Peter Eisentraut a écrit : >> Question 1 : >> Is it the expected behavior ? These characters have a SQL_ASCII >> equivalent because I already have them stored in another table of the >> same database > > SQL_ASCII is not the same as ASCII. SQL_ASCII means, take the bytes as > they come.

[SQL] Question about encoding

2009-08-24 Thread Denis BUCHER
Hello, I'm sure you already replied tons of questions like this, but I don't understand something. This is the situation : * I have COPY commands from a dump, encoded as UTF8 (special characters are encoded as 2-bytes). * My file contains SET client_encoding = 'UTF8'; * But when I do psql http://

Re: [SQL] mail alert

2009-08-11 Thread Denis BUCHER
Hello, Jan Verheyden a écrit : > I was looking in what way it’s possible to alert via mail when some > conditions are true in a database. a) If the alert is not "very urgent" i.e. you can alter some minutes later I would do it like this : 1. Create a function that returns what you need, most imp

[SQL] URGENT ! Nouveau virus

2001-09-19 Thread Denis Bucher
Hello ! Ok... I wrote a small text against that virus just in case you need it ! http://www.horus.ch/virus180901.txt A bientôt ! Denis Bucher ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

[SQL] URGENT ! Nouveau virus

2001-09-18 Thread Denis Bucher
x27;informations, mais en attendant FERMEZ INTERNET EXPLORER ET NE L'OUVREZ PLUS Bonne soirée ! Denis Bucher ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Are circular REFERENCES possible ?

2001-08-07 Thread Denis Bucher
Hello ! I have a case where I wanted to do circular REFERENCES, is this impossible ? Just an example where it would be useful : We deliver to the *shops* of our *customers*. We have therefore two tables : - customers (enterprise, financial information, and so on...) - shop (with a name, st