[SQL] parse error at or near "(" -- Huh???
Hi,
I'm getting a frustrating error
ERROR: parser: parse error at or near "(" at character 201
in a CREATE TABLE statement from an SQL script that I'm running from
within a Perl script. When I run the same script from the command
line, either as a regular user or as root, it works fine.
The SQL is
-
CREATE SEQUENCE "users_id"
START 1 INCREMENT 1 MAXVALUE 2147483647 MINVALUE 1 CACHE 1;
CREATE TABLE "users" (
"u_id" integer DEFAULT nextval('users_id'::text) NOT NULL,
"u_name" text NOT NULL,
"u_password" text NOT NULL,
"u_console_flag" integer DEFAULT 0,
Constraint "users_pkey" Primary Key ("u_id")
);
-
The 'console_flag' field was recently added and is close-ish to the
point that I think the parser is failing. And speaking of that, how I
am to interpret 'character 201' -- should I collapse the SQL into it's
minimal state (least number spaces) and go from that?
Thanks.
Alex
ps Tried to join the list using
http://webmail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&func=lists-long-full&extra=pgsql-sql
but got a server timeout. :(
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Re: [SQL] Insert successful but data not found
On Mon, Dec 06, 2004 at 06:58:43PM -0800, Mian Yong Leow wrote: > I perform an INSERTion and there weren't any complains > of error, so i assume that it has no error. When i > perform a SELECT there were 0 rows in the table. What language or program are you using to do the inserts? How are you checking for errors? Have you done tests to verify that you *would* see errors if any occurred? Is it possible that the inserting transaction was rolled back instead of committed? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [SQL] parse error at or near "(" -- Huh???
On Thu, Dec 09, 2004 at 03:19:56PM -0500, Alex Beamish wrote:
> I'm getting a frustrating error
>
> ERROR: parser: parse error at or near "(" at character 201
>
> in a CREATE TABLE statement from an SQL script that I'm running from
> within a Perl script. When I run the same script from the command
> line, either as a regular user or as root, it works fine.
Your SQL statements ran fine for me, so please show us a small but
complete Perl script that duplicates the problem.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly
Re: [SQL] parse error at or near "(" -- Huh???
Alex Beamish <[EMAIL PROTECTED]> writes:
> I'm getting a frustrating error
> ERROR: parser: parse error at or near "(" at character 201
> in a CREATE TABLE statement from an SQL script that I'm running from
> within a Perl script. When I run the same script from the command
> line, either as a regular user or as root, it works fine.
One would have to suppose that the Perl environment is somehow munging
the SQL commands you think you are sending. Try enabling statement
logging on the server side --- when you can see what was really sent,
all will probably become much clearer.
> And speaking of that, how I
> am to interpret 'character 201' -- should I collapse the SQL into it's
> minimal state (least number spaces) and go from that?
One character per character, whether that be a visible character or
whitespace (including newlines). Collapsing out whitespace is
definitely not going to give you the right count.
regards, tom lane
---(end of broadcast)---
TIP 8: explain analyze is your friend
Re: [SQL] Unresolved external: tgetent
Would you please test 8.0RC release on the ftp site. It might already be fixed. --- Christoph Haller wrote: > I doubt this is the right list, but it's the only one I'm subscribed to, > > so please, if one of the core members is reading this, forward it to the > right one. > > I have successfully compiled and installed 7.4.5 yesterday. > After doing 'make' I saw the line "Ready to install". > template1=# select version(); > version > > PostgreSQL 7.4.5 on hppa2.0w-hp-hpux11.00, compiled by GCC gcc (GCC) > 3.3.1 > (1 row) > > But when I started psql it immediately core dumped with > libreadline.sl.5 Unresolved external: tgetent > > I did a search on the mailing list archives and got 63 hits on > 'tgetent', > dating from 1997 to 2004, all having the same problem, > the missing '-ltermcap' in LIBS in src/Makefile.global. > > After distclean and doing configure LIBS="-ltermcap" ... > and make again it finally worked. > > In http://archives.postgresql.org/pgsql-bugs/2001-09/msg00023.php > Peter Eisentraut writes > > LIBS = -lz -lresolv -lcompat -lm -lutil -ltermcap -lreadline > > That's a good fix. > > The current CVS tip also works around this problem. > > But the 7.4.5 src/Makefile.global still has this: > LIBS = -lz -lreadline -lPW -lgen -lBSD -ldld -lnsl -lm > > So it appears this fix must have been lost anywhere. > > Regards, Christoph > > > > > ---(end of broadcast)--- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match > -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [SQL] parse error at or near "(" -- Huh???
On Monday 13 December 2004 08:15 am, Tom Lane wrote: > > One character per character, whether that be a visible character or > whitespace (including newlines). Collapsing out whitespace is > definitely not going to give you the right count. and while on this topic, how does one interpret the line numbers one gets when running psql -f to create tables? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[SQL] Insert successful but data not found
Has anyone encountered this problem before? I perform an INSERTion and there weren't any complains of error, so i assume that it has no error. When i perform a SELECT there were 0 rows in the table. This is just a simple table with (Integer, Varchar(25),Varchar(50),Varchar(50)) type of data. The error does not occur all the time, it only happens once in a while. Would appreciate if anyone can share their experience and ways of getting around it with me. Thank you in advance. Mian __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
