| From: | TJ O'Donnell <tjo(at)acm(dot)org> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | sql error creating function |
| Date: | 2006-08-11 00:33:32 |
| Message-ID: | 44DBD05C.9020800@acm.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
When I psql -f f.sql
I get the following error:
psql:f.sql:10: ERROR: relation "fragset" does not exist
CONTEXT: SQL function "fragments"
> cat f.sql
Create Or Replace Function fragments(character varying)
Returns setof character varying
As $$
Create Temporary Table fragset (smiles character varying);
Insert into fragset Values ('COCNC');
Insert into fragset Values ('COCNCc1ccccc1');
Select smiles from fragset;
$$ Language SQL;
But, if I paste into a running psql the commands:
Create Temporary Table fragset (smiles character varying);
Insert into fragset Values ('COCNC');
Insert into fragset Values ('COCNCc1ccccc1');
Select smiles from fragset;
it works fine.
What is wrong in the function definition?
I'm using 8.1.3
Thanks,
TJ O'Donnell
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Christopher Browne | 2006-08-11 12:48:19 | Re: sql error creating function |
| Previous Message | Niklas Johansson | 2006-08-10 23:30:45 | Re: |