Re: A few questions

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Samantha Atkins <sjatkins(at)mac(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: A few questions
Date: 2007-10-29 17:09:38
Message-ID: 20071029100938.7f76b015@scratch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 29 Oct 2007 09:52:55 -0700
Samantha Atkins <sjatkins(at)mac(dot)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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-10-29 17:14:52 Re: A few questions
Previous Message David Fetter 2007-10-29 17:07:19 Re: A few questions