Thread: namespace in pgsql

namespace in pgsql

From
Bhavik
Date:
Hi,

I am newbie for pgsql..... Im using Solaris.....

1) Is it possible to have namespace like in OOP, in pgsql query.....
means as I know we can reference table or its column with fashion like
<schema>.<table_name>, but is it possible like
<db_name>.<schema>.<table_name> ???

2) Is it fine if I store all data in one db ( well most of the table
with 2000+ rows ) ? OR better to created 2-3 dbs and store those
tables...

Thanks in advance...... ("    ,)

Re: namespace in pgsql

From
Andreas Kretschmer
Date:
Bhavik <bhavikdbavishi@gmail.com> schrieb:

> Hi,
>
> I am newbie for pgsql..... Im using Solaris.....
>
> 1) Is it possible to have namespace like in OOP, in pgsql query.....
> means as I know we can reference table or its column with fashion like
> <schema>.<table_name>, but is it possible like
> <db_name>.<schema>.<table_name> ???

No, you can't acces across multiple db's.

>
> 2) Is it fine if I store all data in one db ( well most of the table
> with 2000+ rows ) ? OR better to created 2-3 dbs and store those
> tables...

Use one DB. You can store millions of tables and billions of rows per
table in one DB, no problem.



Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

Re: namespace in pgsql

From
RW
Date:
> 1) Is it possible to have namespace like in OOP, in pgsql query.....
> means as I know we can reference table or its column with fashion like
> <schema>.<table_name>, but is it possible like
> <db_name>.<schema>.<table_name> ???
>
As far as I know this is only possible with dblink which is a contrib
module.
> 2) Is it fine if I store all data in one db ( well most of the table
> with 2000+ rows ) ? OR better to created 2-3 dbs and store those
> tables...
>
I don't see any reason not to store the data in one database with tables
with 2000+ rows.
But it of course depends on the data. If you have a dataware house it
could make
sense to distribute the data on different maschines and connect them
with dblink to
distribute the load. For general databases its normally more important
to set
the postgresql.conf parameter right, use a adequate sized maschine and
storage (e.g. RAID 10 instead of RAID 5) and create indexes where it make
sense.

- Robert

Re: namespace in pgsql

From
"Albe Laurenz"
Date:
Bhavik wrote:
> I am newbie for pgsql..... Im using Solaris.....
>
> 1) Is it possible to have namespace like in OOP, in pgsql query.....
> means as I know we can reference table or its column with fashion like
> <schema>.<table_name>, but is it possible like
> <db_name>.<schema>.<table_name> ???
>
> 2) Is it fine if I store all data in one db ( well most of the table
> with 2000+ rows ) ? OR better to created 2-3 dbs and store those
> tables...
>
> Thanks in advance...... ("    ,)

When connected to one PostgreSQL database, you cannot access data
stored in another PostgreSQL database, even if it is in the same
database cluster.

If you need to select from several tables from an application and
perhaps join them, you should have them in one database.

Yours,
Laurenz Albe

PS: There is dblink, but I think that's not what you want to know.