Re: A few questions - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: A few questions
Date
Msg-id 20071029100938.7f76b015@scratch
Whole thread Raw
In response to A few questions  (Samantha Atkins <sjatkins@mac.com>)
List pgsql-general
On Mon, 29 Oct 2007 09:52:55 -0700
Samantha Atkins <sjatkins@mac.com> wrote:

> First on prepared statements:
>
> 1) If I am using the libpq are prepared statements tied to a
> connection?

Yes.

>  In other words can I prepare the statement once and use
> it on multiple connections?

No.

>
> 2) What is the logical scope of prepared statement names?  Can I use
> the same name on different tables without conflict or is the scope
> database wide or something else?

Each prepare must be unique within the session. So session 1 can have
foo and session 2 can have foo, but session 1 can not have foo that
calls to two different objects...

>
> On indices:
>
> 3) same as 2 for index names.  I think they are per table but it is
> worth asking.

Indexes are per relation (table)

>
> and last:
>
> 4) Is it generally better to have more tables in one database from a
> memory and performance point of view or divide into more databases
> if there is a logical division.

Uhmm this is more of a normalization and relation theory question :). I

>  The reason I ask is that I have a
> situation where one app is used by multiple different users each
> running their own copy.

Ahh... use namespaces/schemas:

http://www.postgresql.org/docs/current/static/ddl-schemas.html


> Thanks very much for any enlightenment on these questions.
>
> - samantha

Hope this was helpful.

Sincerely,

Joshua D. Drake

>
>
> ---------------------------(end of
> broadcast)--------------------------- TIP 5: don't forget to increase
> your free space map settings
>


--

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564   24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997  http://www.commandprompt.com/
            UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


Attachment

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: A few questions
Next
From: Richard Huxton
Date:
Subject: Re: A few questions