Re: [GENERAL] ERROR: syntax error at or near ":"

2013-03-06 Thread Ian Lawrence Barwick
2013/3/7 Graham Leggett : (...) >> Which psql version are you using, and what is the table definition? > > Version as below, from RHEL6: > > psql (PostgreSQL) 8.4.13 Aha, there is your problem: testdb=# SELECT version(); version ---

Re: [GENERAL] ERROR: syntax error at or near ":"

2013-03-06 Thread Greg Williamson
Thanks for the link / explanation -- hadn't seen this use before. GW - Original Message - > From: Adrian Klaver > To: Greg Williamson > Cc: "pgsql-general@postgresql.org" > Sent: Wednesday, March 6, 2013 3:13 PM > Subject: Re: [GENERAL] ERROR: synta

Re: [GENERAL] ERROR: syntax error at or near ":"

2013-03-06 Thread Graham Leggett
On 07 Mar 2013, at 1:05 AM, Ian Lawrence Barwick wrote: >> Can anyone explain what might be going wrong, and what I should do instead? >> >> patricia=# \set content `cat /tmp/certificates.txt` >> patricia=# update property set value = :'content' where key = >> 'patricia.home.security.cacerts';

Re: [GENERAL] ERROR: syntax error at or near ":"

2013-03-06 Thread Adrian Klaver
On 03/06/2013 03:04 PM, Greg Williamson wrote: Graham -- From: Graham Leggett To: "pgsql-general@postgresql.org" Sent: Wednesday, March 6, 2013 2:41 PM Subject: [GENERAL] ERROR: syntax error at or near ":" Hi all, I have a text file,

Re: [GENERAL] ERROR: syntax error at or near ":"

2013-03-06 Thread Ian Lawrence Barwick
Greg, 2013/3/7 Greg Williamson : > > > Graham -- (...) > The colon (":") is not needed, just remove it. A pair of colons is used to > indicate a cast of a value; off hand I am not coming up with any use of a > colon in basic SQL. This is psql-specific syntax; the colon should cause the value of

Re: [GENERAL] ERROR: syntax error at or near ":"

2013-03-06 Thread Adrian Klaver
On 03/06/2013 02:41 PM, Graham Leggett wrote: Hi all, I have a text file, and I need to update the value of an element in a table with the contents of this text file. Following the instructions at http://stackoverflow.com/questions/10968039/postgresql-inserting-value-of-a-column-from-a-file I

Re: [GENERAL] ERROR: syntax error at or near ":"

2013-03-06 Thread Ian Lawrence Barwick
2013/3/7 Graham Leggett : > Hi all, > > I have a text file, and I need to update the value of an element in a table > with the contents of this text file. Following the instructions at > http://stackoverflow.com/questions/10968039/postgresql-inserting-value-of-a-column-from-a-file > I tried this

Re: [GENERAL] ERROR: syntax error at or near ":"

2013-03-06 Thread Greg Williamson
Graham -- > > From: Graham Leggett >To: "pgsql-general@postgresql.org" >Sent: Wednesday, March 6, 2013 2:41 PM >Subject: [GENERAL] ERROR:  syntax error at or near ":" > >Hi all, > >I have a text file, and I ne

[GENERAL] ERROR: syntax error at or near ":"

2013-03-06 Thread Graham Leggett
Hi all, I have a text file, and I need to update the value of an element in a table with the contents of this text file. Following the instructions at http://stackoverflow.com/questions/10968039/postgresql-inserting-value-of-a-column-from-a-file I tried this, but get the error below, which I do

Re: [GENERAL] ERROR: syntax error at or near "IF"... why?

2009-05-01 Thread Sam Mason
On Wed, Apr 29, 2009 at 07:54:20AM -0700, DaNieL wrote: > ERROR: syntax error at or near "IF" > > Where am i mistaken? > > p.s: dont focus on the example functionality, its just a trial for me > to understand the transactions.. and now, the IF clause... As others have said, IF statements are on

Re: [GENERAL] ERROR: syntax error at or near "IF"... why?

2009-05-01 Thread Chris Spotts
: pgsql-general@postgresql.org Subject: [GENERAL] ERROR: syntax error at or near "IF"... why? Hi guys, im new with postgresql, and already got my first problem.. Well, I wroted some code for understend how the transaction works, following step by step the manual. TO make it short, i'

Re: [GENERAL] ERROR: syntax error at or near "IF"... why?

2009-05-01 Thread Johan Nel
Daniel, IF (SELECT credit FROM users WHERE name = 'mary') < 0 THEN ROLLBACK; END IF COMMIT; i always get the error ERROR: syntax error at or near "IF" Where am i mistaken? SELECT returns in essence a record or setof records. DECLARE _credit int; ... SELECT credit FROM users WHERE name = '

[GENERAL] ERROR: syntax error at or near "IF"... why?

2009-05-01 Thread DaNieL
Hi guys, im new with postgresql, and already got my first problem.. Well, I wroted some code for understend how the transaction works, following step by step the manual. TO make it short, i've created 2 tables, user and movements: in the firs one there are the name, email and credit colons, in th

Re: [GENERAL] ERROR: syntax error at or near "IF"... why?

2009-04-30 Thread Jaime Casanova
On Thu, Apr 30, 2009 at 1:45 AM, DaNieL..! wrote: >> >> > IF (SELECT credit FROM users WHERE name = 'mary') < 0 THEN >> >  ROLLBACK; >> > END IF >> > COMMIT; >> >> > i always get the error >> > ERROR:  syntax error at or near "IF" >> if you're inside a server-side function then you cannot use COM

Re: [GENERAL] ERROR: syntax error at or near "IF"... why?

2009-04-30 Thread Johan Nel
DaNieL..! wrote: I tryed the declare, before and after the BEGIN;, but allways returns me the error: --- ERROR: syntax error at or near "int"; LINE 1: DECLARE _mycredit int; ^ --

Re: [GENERAL] ERROR: syntax error at or near "IF"... why?

2009-04-30 Thread Raymond O'Donnell
On 30/04/2009 07:45, DaNieL..! wrote: > I tryed the declare, before and after the BEGIN;, but allways returns > me the error: > --- > ERROR: syntax error at or near "int"; > LINE 1: DECLARE _mycredit int; >

Re: [GENERAL] ERROR: syntax error at or near "IF"... why?

2009-04-30 Thread DaNieL..!
On 30 Apr, 07:30, Johan Nel wrote: > Daniel, > > > IF (SELECT credit FROM users WHERE name = 'mary') < 0 THEN > >  ROLLBACK; > > END IF > > COMMIT; > > > i always get the error > > ERROR:  syntax error at or near "IF" > > > Where am i mistaken? > > SELECT returns in essence a record or setof recor

Re: [GENERAL] error : syntax error at or near $1 for over select rows

2004-12-27 Thread John DeSoi
On Dec 27, 2004, at 11:36 AM, vinita bansal wrote: FOR for1 in select qi.tril_gid as vQuotaInstanceGID,qi.startdate as vQIStartDate,qi.enddate as vQIEndDate from cm_quotainstance as qi, cm_quota as q, fs_agr as a where a.fs_unid = AGR_UNID and a.fs_model = q.model and qi.quota = q.tril_g

[GENERAL] error : syntax error at or near $1 for over select rows

2004-12-27 Thread vinita bansal
This is the error i am getting when calling select * from cas_reset_qi_changedate('CAS','2003-02-03' ERROR: syntax error at or near "$1" at character 25 CONTEXT: PL/pgSQL function "cas_reset_qi_changedate" line 15 at for over select rows pgsql function : CREATE or replace FUNCTION qe13.CAS_RE