Thread: pg_description usage pointers?

pg_description usage pointers?

From
will trillich
Date:
anybody using the PG_DESCRIPTION table to useful effect?
if so, or even if not, anybody got some ideas on what you
can do with it?

psql=> \h comment

Command:     COMMENT
Description: Add comment to an object
Syntax:
COMMENT ON
[
  [ DATABASE | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ]
  object_name |
  COLUMN table_name.column_name|
  AGGREGATE agg_name agg_type|
  FUNCTION func_name (arg1, arg2, ...)|
  OPERATOR op (leftoperand_type rightoperand_type) |
  TRIGGER trigger_name ON table_name
] IS 'text'


--
will@serensoft.com
http://newbieDoc.sourceforge.net/ -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

Re: pg_description usage pointers?

From
Bruce Momjian
Date:
Psql backslash commands use it to describe tables, types, functions,
etc.

> anybody using the PG_DESCRIPTION table to useful effect?
> if so, or even if not, anybody got some ideas on what you
> can do with it?
>
> psql=> \h comment
>
> Command:     COMMENT
> Description: Add comment to an object
> Syntax:
> COMMENT ON
> [
>   [ DATABASE | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ]
>   object_name |
>   COLUMN table_name.column_name|
>   AGGREGATE agg_name agg_type|
>   FUNCTION func_name (arg1, arg2, ...)|
>   OPERATOR op (leftoperand_type rightoperand_type) |
>   TRIGGER trigger_name ON table_name
> ] IS 'text'
>
>
> --
> will@serensoft.com
> http://newbieDoc.sourceforge.net/ -- we need your brain!
> http://www.dontUthink.com/ -- your brain needs us!
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>


--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: pg_description usage pointers?

From
will trillich
Date:
On Mon, Mar 19, 2001 at 09:50:20PM -0500, Bruce Momjian wrote:
> Psql backslash commands use it to describe tables, types, functions,
> etc.

i realize that, coach. i'm wondering if any devious minds
out there are using it for something clever and useful,
instead of doing the roll-your-own table cross-lookups that
i've been hobbling together for the past few weeks...

> > anybody using the PG_DESCRIPTION table to useful effect?
> > if so, or even if not, anybody got some ideas on what you
> > can do with it?

it's used in the psql "\d+" results, of course, but i was
wondering if any of you twisted puppies have used it for
anything more powerful and sinister...?

> > psql=> \h comment
> >
> > Command:     COMMENT
> > Description: Add comment to an object
> > Syntax:
> > COMMENT ON
> > [
> >   [ DATABASE | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ]
> >   object_name |
> >   COLUMN table_name.column_name|
> >   AGGREGATE agg_name agg_type|
> >   FUNCTION func_name (arg1, arg2, ...)|
> >   OPERATOR op (leftoperand_type rightoperand_type) |
> >   TRIGGER trigger_name ON table_name
> > ] IS 'text'
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

--
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
        -- Isaac Asimov, 'The Genetic Code'

will@serensoft.com
http://newbieDoc.sourceforge.net/ -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

tuple help

From
"John B. Abela"
Date:
Hello.

New to the list, so sorry if this is a common question.


We are just recently switched from MySQL to PostgreSQL.

We have came up against the "tuple to big" error.


We really need to find a way around this, and after 4+ hours of digging, we
have been unable to find a method to do so.

We would be very gratefull if someone could give us some step-by-step
details on how to either increase it, or use the larger field size method.

We know we need to recompile it... we just don't know what settings, and
such issues.

Many thanks.

John B. Abela
Web Developer
Dyrect Media Group.
abela@dyrectmedia.com
http://www.dyrectmedia.com/



Re: tuple help

From
Tom Lane
Date:
"John B. Abela" <abela@4cm.com> writes:
> We have came up against the "tuple to big" error.
> We know we need to recompile it... we just don't know what settings, and
> such issues.

BLCKSZ in src/include/config.h is the magic number.  Set to 32768,
make clean/all/install, initdb.

However, you should give serious consideration to skipping all that
BS and running 7.1 (beta6 or later) instead.  If you're still in
development phase then I see no reason to stick with 7.0.*.

            regards, tom lane

Re: pg_description usage pointers?

From
"Roderick A. Anderson"
Date:
On Mon, 19 Mar 2001, will trillich wrote:

> On Mon, Mar 19, 2001 at 09:50:20PM -0500, Bruce Momjian wrote:
> > Psql backslash commands use it to describe tables, types, functions,
> > etc.
>
> i realize that, coach. i'm wondering if any devious minds
> out there are using it for something clever and useful,
> instead of doing the roll-your-own table cross-lookups that
> i've been hobbling together for the past few weeks...

Nothing devious but back in my Oracle days we included comments on all
tables and attributes.  What better place to store the information about
the database than in the database (metadata?).  I wrote so scripts (pretty
ORacle and Data General AOS/VS specific) that generated documentation for
an application using the comments.
   Too often someone would walk in and want to know which attribute to use
to tie one table to another.  (I had some pretty good report writers that
weren't computer people.)  After getting this generate HTML and onto our
Intranet they could just run the report and see all the tables, columns,
primary keys, foreign keys, and information about each of them.  Made my
life simpler - when I could get them to use it - and I'd use it instead of
keeping printed stuff lying around.


Rod
--



clever COMMENT/description usage -- internationalizing?

From
will trillich
Date:
On Tue, Mar 20, 2001 at 08:26:58AM -0800, Roderick A. Anderson wrote:
> On Mon, 19 Mar 2001, will trillich wrote:
> > i'm wondering if any devious minds out there are using it for
> > something clever and useful, instead of doing the
> > roll-your-own table cross-lookups that i've been hobbling
> > together for the past few weeks...
>
> Nothing devious but back in my Oracle days we included comments on all
> tables and attributes.  What better place to store the information about
> the database than in the database (metadata?).  I wrote so scripts (pretty
> ORacle and Data General AOS/VS specific) that generated documentation for
> an application using the comments.
>    Too often someone would walk in and want to know which attribute to use
> to tie one table to another.  (I had some pretty good report writers that
> weren't computer people.)  After getting this generate HTML and onto our
> Intranet they could just run the report and see all the tables, columns,
> primary keys, foreign keys, and information about each of them.  Made my
> life simpler - when I could get them to use it - and I'd use it instead of
> keeping printed stuff lying around.

sounds reasnable -- and just like what the pg_description table
was intended for.

how about internationalizing the comments? i can do

    comment on column mytable.afield is 'general data stuff';

to get an english description -- how would y'all recommend
splitting up different languages? i'm thinking of doing something
like

    comment on column mytable.thisfield is
    'join=lookupTableName.lookupField/valueField
    en=general data
    fr=information generale
    es=informacion' ;

and then using some sort of split function to break it on
<perl> ($lang)=([^\n]+) </perl> ...

any commentary from you pg/sql folks? is there a sneakier or
more flexible/powerful way? maybe i should go ahead and roll my
own schematic...?

--
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
        -- Isaac Asimov, 'The Genetic Code'

will@serensoft.com
http://newbieDoc.sourceforge.net/ -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!