Re: [SQL] dynamic OUT parameters?

2009-01-30 Thread Craig Ringer
gher...@fmed.uba.ar wrote: > Oh, that looks promising. I wrongly supposed that RETURNING SETOF RECORD > forces the use of OUT parameters. I will give your idea a try. Tom Lane's point about using a refcursor is (unsurprisingly) a good one. If you return a refcursor from your function, you don't h

Re: [SQL] dynamic OUT parameters?

2009-01-30 Thread gherzig
> Gerardo Herzig wrote: > >> 1) There is a way to make a function returning "any amount of any type >> of arguments"? > > RETURNS SETOF RECORD > > The application must, however, know what columns will be output by the > function ahead of time and call it using an explicit column declaration > list.

Re: [SQL] dynamic OUT parameters?

2009-01-30 Thread Tom Lane
Craig Ringer writes: >> 2) Can i make a special type "on_the_fly" and returning setof "that_type"? > You're better off using SETOF RECORD, at least in my opinion. Another possibility is to return a cursor. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] dynamic OUT parameters?

2009-01-30 Thread Craig Ringer
Gerardo Herzig wrote: > 1) There is a way to make a function returning "any amount of any type > of arguments"? RETURNS SETOF RECORD The application must, however, know what columns will be output by the function ahead of time and call it using an explicit column declaration list. For example, t

Re: [SQL] regexp_replace and UTF8

2009-01-30 Thread Harald Fuchs
In article <87ljstm4eq@oxford.xeocode.com>, Gregory Stark writes: > "Bart Degryse" writes: >> Hi, >> I have a text field with data like this: 'de patiënt niet' >> Can anyone help me fix this or point me to a better approach. >> By the way, changing the way data is put into the field is >> u

[SQL] dynamic OUT parameters?

2009-01-30 Thread Gerardo Herzig
Hi all. I have a situation here: I have to make a 'report' for a table. I'll try to explain the functionality needed: Lets say i have a table like this \d people name varchar id_city integer (references city(id_city)) \d city id_city integer city_name varchar id_country (references country (id_cou

Re: [SQL] regexp_replace and UTF8

2009-01-30 Thread Gregory Stark
"Bart Degryse" writes: > Hi, > I have a text field with data like this: 'de patiënt niet' > Can anyone help me fix this or point me to a better approach. > By the way, changing the way data is put into the field is > unfortunately not an option. > Many thanks in advance. You could use a plperl

[SQL] regexp_replace and UTF8

2009-01-30 Thread Bart Degryse
Hi, I have a text field with data like this: 'de patiënt niet' (without the quotes). I would like to convert this string to look like this: 'de patiënt niet' Basically what I need to do (I think) is - get rid of the &, # and ; - convert the number to hex - make a UTF8 from that (thus: \xEB) - conve