testing in ESQL/C if a CUSROR "foo" is open?

2019-12-26 Thread Matthias Apitz
Hello, Is there any way (without looking up the name in table 'pg_cursors') to see if a cursor "foo" is still open? Thanks matthias -- Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub signature.asc Descripti

RE: Question on upgrading postgresql from 10.7 to 11.5

2019-12-26 Thread Lu, Dan
Thanks! I was misled by "pg_controldata" keyword and totally ignored the WAL segment size variable. Much appreciated for your help. -Original Message- From: Julien Rouhaud [mailto:rjuju...@gmail.com] Sent: Wednesday, December 25, 2019 10:36 AM To: Lu, Dan Cc: pgsql-gene...@postgresql.o

Re: Not my day :-( Another syntax error

2019-12-26 Thread Pavel Stehule
čt 26. 12. 2019 v 18:50 odesílatel stan napsal: > > On Thu, Dec 26, 2019 at 10:39:54AM -0700, David G. Johnston wrote: > > You should probably send that reply again using reply-to-all. > > > > Dave > > > > > > On Thu, Dec 26, 2019 at 10:38 AM stan wrote: > > > > > On Thu, Dec 26, 2019 at 10:26:4

Re: Not my day :-( Another syntax error

2019-12-26 Thread stan
On Thu, Dec 26, 2019 at 10:39:54AM -0700, David G. Johnston wrote: > You should probably send that reply again using reply-to-all. > > Dave > > > On Thu, Dec 26, 2019 at 10:38 AM stan wrote: > > > On Thu, Dec 26, 2019 at 10:26:49AM -0700, David G. Johnston wrote: > > > On Thu, Dec 26, 2019 a

Re: Not my day :-( Another syntax error

2019-12-26 Thread David G. Johnston
On Thu, Dec 26, 2019 at 9:33 AM stan wrote: > > WITH inserted AS ( > INSERT into project_cost_category > (category) > VALUES > ('MISC') >

Not my day :-( Another syntax error

2019-12-26 Thread stan
Thanks to the folks that helped me fix my earlier error today. I seem to be having a bad day. I am getting an error that I cannot understand, and I would appreciate another set of eyes looking at it. Here is the error Processing -> load_task.sql DELETE 0 ERROR: column "project_cost_category_ke

Re: What am I doing wrong here?

2019-12-26 Thread stan
On Thu, Dec 26, 2019 at 09:06:03AM -0500, Tom Lane wrote: > stan writes: > > When I try to insert this function I get an error on the following line: > > _bom_name_key = ( SELECT > > I actually pretty much get a syntax error whatever is at this line. > > Can someone please explain what I am doi

Re: What am I doing wrong here?

2019-12-26 Thread stan
On Thu, Dec 26, 2019 at 07:34:28PM +0530, Jayadevan M wrote: > Hi, > > > On Thu, Dec 26, 2019 at 7:06 PM stan wrote: > > > > > > > _bom_name_key = ( SELECT > > project_bom_key > >FROM inserted ) > > ; > > > > Try rewriting > _bom_name_key = ( SEL

Re: What am I doing wrong here?

2019-12-26 Thread stan
On Thu, Dec 26, 2019 at 01:55:34PM +, Ray O'Donnell wrote: > On 26/12/2019 13:36, stan wrote: > > IF _bom_name_key is NULL > > THEN > > WITH inserted AS ( > > INSERT into project_bom > > (project_key, bom_name) > > VALUES >

Re: What am I doing wrong here?

2019-12-26 Thread Tom Lane
stan writes: > When I try to insert this function I get an error on the following line: > _bom_name_key = ( SELECT > I actually pretty much get a syntax error whatever is at this line. > Can someone please explain what I am doing wrong? I think you're misunderstanding where to put the WITH. Tha

Re: What am I doing wrong here?

2019-12-26 Thread Jayadevan M
Hi, On Thu, Dec 26, 2019 at 7:06 PM stan wrote: > > > _bom_name_key = ( SELECT > project_bom_key >FROM inserted ) > ; > Try rewriting _bom_name_key = ( SELECT project_bom_key FROM inserted ) asSEL

Re: What am I doing wrong here?

2019-12-26 Thread Ray O'Donnell
On 26/12/2019 13:36, stan wrote: > IF _bom_name_key is NULL > THEN > WITH inserted AS ( > INSERT into project_bom > (project_key, bom_name) > VALUES > (NEW.project_key , 'Main') > RET

What am I doing wrong here?

2019-12-26 Thread stan
I am trying to create a function that checks to see if a value exists in a table, if it does it returns the key, and fills in a NULL filed in an INSERT. If the value DOES NOT exist, I want the function to insert the needed record it into the 2nd table, then get the resultant key, and fill in the

Re: Syntax question about returning value from an insert

2019-12-26 Thread stan
On Wed, Dec 25, 2019 at 09:17:22PM -0800, Adrian Klaver wrote: > On 12/25/19 4:48 PM, Rob Sargent wrote: > > > > > > > On Dec 25, 2019, at 3:10 PM, stan wrote: > > > There is more that that. There is a project number, so the actuall key > > > represents the combination of project number, and c