"Derrick Betts" <derrick@blueaxis.com> writes:
> However, if I create a new schema, it would seem that the only way to =
> access a table within the new schema is to pre-pend the table name with =
> the schema name:
> CREATE SCHEMA new_schema;
> CREATE TABLE new_table (column_name varchar);
> SET search_path TO new_schema;
> SELECT column_name FROM new_table; This returns an error saying =
> there is no such table as new_table.
That's because you created new_table in the public schema. I think you
are confusing
CREATE SCHEMA new_schema;
CREATE TABLE new_table (column_name varchar);
(two independent commands, and the second one creates new_table in whatever
schema is current according to search_path) with
CREATE SCHEMA new_schema
CREATE TABLE new_table (column_name varchar);
which per SQL spec makes new_schema and then creates new_table within
it. That semicolon makes a lot of difference...
regards, tom lane