[SQL] GiST index implementation

2007-08-02 Thread Elena Camossi
Hi all,

what is the default implementation for GiST index? B-Tree or R-Tree?
That is, if i execute the following SQL command:

 CREATE index ON table USING Gist (column)

what is the type of the index that is actually built?

If I specify R-Tree instead, with:

 CREATE index ON table USING Rtree (column)

I got this message:

 NOTICE:  substituting access method "gist" for obsolete method "rtree"

and when I look at the SQL code that created the index in pgAdmin, I found
again

CREATE index ON table USING Gist (column).

How can I specify in SQL one of the two implementations provided (e.g.
R-Tree)?


Thank you for helping.

Regards,
-Elena


[SQL] Foreign Key inter databases

2007-08-02 Thread Dani CastaƱos

Hi all!

Is it possible to have a foreign key where referenced table is in 
another database?


Thank you in advance

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [SQL] Foreign Key inter databases

2007-08-02 Thread Josh Tolley
On 8/2/07, Dani CastaƱos <[EMAIL PROTECTED]> wrote:
> Hi all!
>
> Is it possible to have a foreign key where referenced table is in
> another database?
>
> Thank you in advance
>
> ---(end of broadcast)---
> TIP 1: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to [EMAIL PROTECTED] so that your
>message can get through to the mailing list cleanly
>

Unless you use things like dblink to make two separate databases think
they're one database, you really can't do anything where one database
depends on another. Your best bet, if you can have both data sets on
the same machine, is to stick them in two separate schemas, and then
you can have foreign keys on a table in one schema referencing a table
in another schema. That's (in part) what schemas are for in the first
place -- to separate logically distinct data sets while allowing
accesses between the two when necessary.

If for whatever reason having all the data on one machine isn't
possible, you can try using dbi-link or dblink to create links between
the two databases and do foreign keys that way, but I've never used
either, so that might not work/make sense/be possible, etc.

-Josh

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [SQL] Authentification failed

2007-08-02 Thread Kenneth Gonsalves


On 02-Aug-07, at 2:49 AM, Judith wrote:


I'm trying in SUSE to connect to a postgres db and this is the error:

Ident Authentification failed for user <>

I'm already created the user with createuser root, but the error  
persist, I would aprecciate some help, thanks in advanced


edit your pg_hba.conf file to allow tcp/ip access from localhost. And  
please dont try to access postgres as 'root'


--

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[SQL] Count of rows

2007-08-02 Thread Paul Lambert
What's the best way to count how many rows are in each table via SQL? Or 
is it even possible?


I'm trying something like:

select tablename, count(*) from (select tablename from pg_tables where 
schemaname = 'public') as test group by tablename;


But obviously this just gives a count of 1 for each table in the public 
schema.


Can it be done or would I have to write a function?

--
Paul Lambert
Database Administrator
AutoLedgers


---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly