cursor "x" does not exist

2018-04-14 Thread Bob Jones
Hello, My apologies if I'm being incredibly stupid here, but I've reviewed what the docs have to say about naming portals and I still can't see where I'm going wrong here ? CREATE FUNCTION blah(v_id text,v_cursor refcursor) RETURNS refcursor AS $BODY$ BEGIN OPEN v_cursor FOR SELECT * FROM blah w

Re: cursor "x" does not exist

2018-04-14 Thread Tom Lane
Bob Jones writes: > My apologies if I'm being incredibly stupid here, but I've reviewed > what the docs have to say about naming portals and I still can't see > where I'm going wrong here ? I think you're forgetting to double-quote an upper case identifier. > FETCH ALL IN B; > ERROR: cursor "b"

Re: cursor "x" does not exist

2018-04-14 Thread Bob Jones
On 14 April 2018 at 16:38, Tom Lane wrote: > Bob Jones writes: >> My apologies if I'm being incredibly stupid here, but I've reviewed >> what the docs have to say about naming portals and I still can't see >> where I'm going wrong here ? > > I think you're forgetting to double-quote an upper case

Re: cursor "x" does not exist

2018-04-14 Thread Adrian Klaver
On 04/14/2018 09:36 AM, Bob Jones wrote: On 14 April 2018 at 16:38, Tom Lane wrote: Bob Jones writes: My apologies if I'm being incredibly stupid here, but I've reviewed what the docs have to say about naming portals and I still can't see where I'm going wrong here ? I think you're forgetti

Regex on field value

2018-04-14 Thread Mike Martin
Is this possible, eg Substring(field, regex include other field name) Thanks

Re: Regex on field value

2018-04-14 Thread David G. Johnston
On Saturday, April 14, 2018, Mike Martin wrote: > Is this possible, eg > Substring(field, regex include other field name) > Your example doesn't make sense but if you are asking whether a regular expression can be stored in a column the answer is yes - though it's nothing but a text value with r

Re: Regex on field value

2018-04-14 Thread Adrian Klaver
On 04/14/2018 02:06 PM, David G. Johnston wrote: On Saturday, April 14, 2018, Mike Martin > wrote: Is this possible, eg Substring(field, regex include other field name) Something like?: select substring(link_key from '^' || c_id ), link_key, c_id from proje