pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
creating tables that are visible across databases
3+ messages / 3 participants
[nested] [flat]

* creating tables that are visible across databases
@ 2001-04-20 20:38  Mark Stosberg <mark@summersault.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Mark Stosberg @ 2001-04-20 20:38 UTC (permalink / raw)
  To: pgsql-sql


Hello,

  I'd like to create some tables that would visible across databases,
much like the postgres system tables. These would be for "static" data,
such as state and country codes, and geo-spatial data. I couldn't find
this mentioned in the docs, but unless this feature of the system tables
is magical, it appears to be possible. Did I miss an explanation in some
docs, or could someone give me a pointer? 
  Thanks!

   -mark

personal website             }      Summersault Website Development
http://mark.stosberg.com/    {      http://www.summersault.com/



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

* Re: creating tables that are visible across databases
@ 2001-04-20 21:13  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Mark Stosberg <mark@summersault.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2001-04-20 21:13 UTC (permalink / raw)
  To: mark@summersault.com; +Cc: pgsql-sql

Mark Stosberg <mark@summersault.com> writes:
>   I'd like to create some tables that would visible across databases,
> much like the postgres system tables. These would be for "static" data,
> such as state and country codes, and geo-spatial data. I couldn't find
> this mentioned in the docs, but unless this feature of the system tables
> is magical, it appears to be possible.

Unfortunately, it is magic ... see IsSharedSystemRelationName() for more
info.  Possibly you could hack that routine to allow certain other names
to be considered shared.

It looks to me like some of the uses of IsSharedSystemRelationName
could/should be replaced by examining pg_class.relisshared, but in other
places it's really necessary to determine sharedness with nothing but a
relname to go on.

This will all need to be rethought when we implement schemas, anyway...

			regards, tom lane



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

* Re: creating tables that are visible across databases
@ 2001-04-20 21:18  Jeff Hoffmann <jeff@propertykey.com>
  parent: Mark Stosberg <mark@summersault.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Jeff Hoffmann @ 2001-04-20 21:18 UTC (permalink / raw)
  To: mark@summersault.com; pgsql-sql

Mark Stosberg wrote:
> 
> Hello,
> 
>   I'd like to create some tables that would visible across databases,
> much like the postgres system tables. These would be for "static" data,
> such as state and country codes, and geo-spatial data. I couldn't find
> this mentioned in the docs, but unless this feature of the system tables
> is magical, it appears to be possible. Did I miss an explanation in some
> docs, or could someone give me a pointer?
>   Thanks!

you could create the tables using a template database, in which case
they would be created when you create a new database using that template
(look at "createdb -T" to see how this works).  this may not be what
you're looking for because they wouldn't be shared across databases,
they would just be copied into the new database when it was created.  i
don't think there's a way to have shared access to those tables.

-- 

Jeff Hoffmann
PropertyKey.com



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


end of thread, other threads:[~2001-04-20 21:18 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-20 20:38 creating tables that are visible across databases Mark Stosberg <mark@summersault.com>
2001-04-20 21:13 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-04-20 21:18 ` Jeff Hoffmann <jeff@propertykey.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