Forum OpenACS Development: PostgreSQL embedded error - relation XX does not exist

I am converting some INFORMIX ESQL/C to postgresql embedded C code and having a slow go with each turn.  The lastest is the 'relation measurement_type does not exist.  I have tried with the " " around the table name just in case it was created with " " .  I verified however that it was not created with the " " around the table name.  I can cut and paste the exact query into psql and get the records back that I expect - so I am a little lost.

Any help to leap over this next hurdle would be greatly appreciated.  Especially since I need to get this conversion completed and tested in about 3 weeks!

Laura

Collapse
Posted by Don Baccus on
Quotes around an identifier are just that - quotes around the identifier. While it allows you to build identifiers that can't be referenced without quotes (i.e. by embedding strange characters) the quotes are not part of the identifier.

For instance:

openacs4=# create table "foo"("i" integer);
CREATE TABLE
openacs4=# select i from foo;
 i 
---
(0 rows)

As far as your embedded C proc issues - why not post to one of the PG mailing lists directly? Folks here are familiar with PL/pgSQL but we've had no need to write C functions and indeed want to avoid it like the plague so we don't need to worry about portability issues between various C compilers on various platforms, so we're really the wrong people to be asking.