Re: Problem with PG_GETARG_CSTRING - Mailing list pgsql-novice

From Brett Maton
Subject Re: Problem with PG_GETARG_CSTRING
Date
Msg-id 05ED21952E28E94E8352836547A6BA37026C2EBF@achmsx001.hsa.co.uk
Whole thread Raw
In response to Problem with PG_GETARG_CSTRING  ("Brett Maton" <Brett.Maton@simplyhealth.co.uk>)
List pgsql-novice

Ok, that means it's not something blindingly obvious then :-)

  I brought the code home and have tried it on one of my machines here.

  First time the function has been created so no picking the wrong .so
  Differences are that here I'm running Postgres 8.1.10-1 on Fedora Core 6

  Unfortunately when I call the function with:

  select * from bm_test('PRODAPP');

  I get the same result:

  NOTICE:  szPolicy len [1]'
                          '

  Followed by the expected list of Notices for each hostname in the servers table.
  My C is a bit rusty I'll be the first to admit but I'm really not getting where the line break is coming from.

  For info in my pg_log file it's reporting:

  NOTICE:  szPolicy len [1]'^K'

  Not sure if ^K means anything to anyone, would have expected to see ^J (10) or ^M (13)...

Brett

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Fri 12/10/2007 16:10
To: Brett Maton
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Problem with PG_GETARG_CSTRING

"Brett Maton" <Brett.Maton@simplyhealth.co.uk> writes:
> I'm probably just being a numpty, but I can't seem to get arguments with PG=
> _GETARG_CSTRING.

The code looks all right as far as I can see --- I suspect procedural
error, like you aren't loading the right .so file, or changed the code
and didn't re-LOAD the .so, or something like that.

                        regards, tom lane




-----------------------------------------------------------------------------------------------
This email, and the contents contained within, are private
and confidential between the sender and the individual(s)
to whom it is addressed.
The contents do not necessarily represent the views of Simplyhealth Group
Limited.

In the event of misdirection, the recipient is prohibited from 
using, copying or disseminating it or any information contained in it.
If you have received this email in error please notify Simplyhealth
immediately by telephone on 0845 075 2020, or by email to 
network.administrator@simplyhealth.co.uk

Simplyhealth Group Limited is registered and incorporated in England and Wales  
as a company limited by guarantee. Its registered office is at Hambleden House, 
Waterloo Court, Andover, Hampshire, SP10 1LQ, registered no. 5445654. We 
may record or monitor telephone calls to help improve our service and protect our 
members.
-----------------------------------------------------------------------------------------------

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem with PG_GETARG_CSTRING
Next
From: John Gunther
Date:
Subject: accented characters migraine