Re: Without schemas - Mailing list pgsql-admin

From Daniel J. Summers
Subject Re: Without schemas
Date
Msg-id 49D3EBE1.2090805@djs-consulting.com
Whole thread Raw
In response to Without schemas  (Félix Sánchez Rodríguez <fesanch@ciego.cult.cu>)
List pgsql-admin
Félix Sánchez Rodríguez wrote:
> Have you used PHP with PostgreSQL??
Yep - daily. :)

> (Especifically the Doctrine
> Framework??).
Not familiar with that one. I don't have a framework (well, I do, but I
wrote it), but I use PDO (PHP Data Objects) as the interface.

> Because my question arises from the fact that I've had
> problems when rying to use Doctrine with a PostgreSQL database and I
> thought
> that the reason could be the lack of the schema name. However,
> according to
> your answer, it is not necessary to put the schema name before the
> table's
> (when it comes to the public schema). I'm trying some code right now and
> I've figured out that it's not the same to use 'SELECT NICK FROM
> USUARIOS'
> vs. 'SELECT "Nick" from "Usuarios"', it only works the second way. So, my
> problem could have something to do with it??
It's been my experience that just leaving the name out and not quoting
in the SQL is the most straightforward way to go. I always use lowercase
(in table definition and in the code) which seems to work well. Also,
with schemas, the "search path" defaults to the user name, then public.
The way I have coded my applications is to have a service user who owns
the schema, and that's the user that the application uses. If you have a
similar setup, that may work - if not, public is your best option. My
advice would be to get it working with no punctuation in the SQL (i.e.,
"select nick from usarios"), and set the rest of the tables up that way.

--
Daniel J. Summers
*Owner, DJS Consulting* Support <http://support.djs-consulting.com/> •
Tech Blog <http://www.djs-consulting.com/linux/blog>

daniel@djs-consulting.com <mailto:daniel@djs-consulting.com> •
http://www.djs-consulting.com <http://www.djs-consulting.com/>

GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w !O M--
V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e h---- r+++ y++++

pgsql-admin by date:

Previous
From: Félix Sánchez Rodríguez
Date:
Subject: Without schemas
Next
From: "Kevin Grittner"
Date:
Subject: Re: Without schemas