pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
a simple question
3+ messages / 3 participants
[nested] [flat]

* a simple question
@ 2001-07-11 19:23 Prashant Sinha <prashant@envivio.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Prashant Sinha @ 2001-07-11 19:23 UTC (permalink / raw)
  To: pgsql-admin

Hi,
I am new to postgresql. I have it installed on FreeBSD, can anyone please
tell me how could I check the no of connection to the database or How many
people are connected to the database at a time.

Thanks,
-Prashant.


----- Original Message -----
From: "Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>
To: "Mahesh Guleria" <mahesh@himline.com>
Cc: <pgsql-admin@postgresql.org>
Sent: Wednesday, July 11, 2001 11:25 AM
Subject: Re: [ADMIN] Can we increase the no. of users in postgres


> There is a max_connections variable to be set in $PGDATA/postgresql.conf
which is the configuration file starting at 7.1 I think.
>
> cheers,
> thalis
>
>
> On Wed, 11 Jul 2001, Mahesh Guleria wrote:
>
> > How is it going to be possible???
> >
> > -MG
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* A simple question
@ 2005-03-16 15:56 juanmime@ono.com
  0 siblings, 0 replies; 3+ messages in thread

From: juanmime@ono.com @ 2005-03-16 15:56 UTC (permalink / raw)
  To: pgsql-admin

Hello,
I wonder if postgres autocreates an index on foreign or primary key fields.

For example:

create table t1 (
  f1 integer,
  f2 varchar,
  primary key (f1));

create table t2 (
  f1 integer,
  f2 integer,
  primary key (f1),
  foreign key (f2) references t1(f1)
);
  
In this sample, "t1" has a primary key, and "t2" both (primary and foreign
keys).
Does postgres create each indexes for the primary key of "t1" and "t2" ?

and indexes for "f2" field in "t2" ?

I expleain, there are several DBMS where autocreates these indexes for you,
and others that shows you an alert, for example, if you don't create an unique
index for the primary key.

Thanks.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: A simple question
@ 2005-03-16 16:06 Lee Wu <Lwu@mxlogic.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Lee Wu @ 2005-03-16 16:06 UTC (permalink / raw)
  To: juanmime@ono.com; pgsql-admin

You can easily test yourself:

test=# \d t1
           Table "public.t1"
 Column |       Type        | Modifiers
--------+-------------------+-----------
 f1     | integer           | not null
 f2     | character varying |
Indexes: t1_pkey primary key btree (f1)

test=# \d t2
      Table "public.t2"
 Column |  Type   | Modifiers
--------+---------+-----------
 f1     | integer | not null
 f2     | integer |
Indexes: t2_pkey primary key btree (f1)
Foreign Key constraints: $1 FOREIGN KEY (f2) REFERENCES t1(f1) ON UPDATE
NO ACTION ON DELETE NO ACTION

test=#

So the answer is: yes for PK, no for FK in PG.


-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of juanmime@ono.com
Sent: Wednesday, March 16, 2005 8:57 AM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] A simple question

Hello,
I wonder if postgres autocreates an index on foreign or primary key
fields.

For example:

create table t1 (
  f1 integer,
  f2 varchar,
  primary key (f1));

create table t2 (
  f1 integer,
  f2 integer,
  primary key (f1),
  foreign key (f2) references t1(f1)
);

In this sample, "t1" has a primary key, and "t2" both (primary and
foreign
keys).
Does postgres create each indexes for the primary key of "t1" and "t2" ?

and indexes for "f2" field in "t2" ?

I expleain, there are several DBMS where autocreates these indexes for
you,
and others that shows you an alert, for example, if you don't create an
unique
index for the primary key.

Thanks.



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-03-16 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-11 19:23 a simple question Prashant Sinha <prashant@envivio.com>
2005-03-16 15:56 A simple question juanmime@ono.com
2005-03-16 16:06 Re: A simple question Lee Wu <Lwu@mxlogic.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox