Re: An interisting conundrum where tables have a column called "found"

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: endoid(at)endoid(dot)net
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: An interisting conundrum where tables have a column called "found"
Date: 2003-10-28 14:21:02
Message-ID: 200310281321.OAA10057@rodos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> I am putting together a DB that records information about a set of web
> sites and how they link to one another. As one site refers to another, I
> monitor the first site and then record when I find the referred site.
>
> [snip]
>
> I also have a function called add_site that adds the newly found site.
>
> So far so good.
> To test my code I wrote the INSERT statement by hand:
> insert into sa_site (site_id, found, host_uri) values
> (nextval('sa_site_id_seq'), 'now', 'www.endoid.net');
>
> and everything worked fine when called from psql.
>
> Then I added the code to my add_site function and got the following
> error:
> ensa1.1=> select add_site('www.endoid.net', 4, null );
> WARNING: Error occurred while executing PL/pgSQL function add_site
> WARNING: line 26 at SQL statement
> ERROR: parser: parse error at or near "$1" at character 43
>
> I looked and looked but couldn't find anything that could explain the
> error. Then, being somewhat used to Oracle I tried renaming the "found"
> column to "found_on". Oracle occasionally has discrepencies in its rules
> for the naming of objects, so I thought that something *similar* might
> be happening with PG. Anyways this change did work in my PL/pgSQL
> function.
>
> Could you guys figure out where a general description of "please don't
> use keywords as column names even if you're allowed to at create time
> because something somewhere will throw an unintellligable error" should
> live on the site?
>
There is a SQL Key Words section, and I remember when porting to
postgres I saw complaints about a column named 'offset'.
So I assume there is a key word checking function already in operation.
Maybe it simply needs an update.
Regards, Christoph

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-10-28 14:40:15 Re: Slightly inconsistent behaviour in regproc?
Previous Message Bruce Momjian 2003-10-28 14:00:26 Re: Open items