Thread: Display listings

Display listings

From
Setyo Nugroho
Date:
Hi all,
How is it to display the listings/ detailed descriptions of a function
or a table created using plpgsql or using database client such as psql?

Regards
Setyo Nugroho





Re: Display listings

From
"Josh Berkus"
Date:
Setyo,

> How is it to display the listings/ detailed descriptions of a
> function
> or a table created using plpgsql or using database client such as
> psql?

Check out the \d commands through PSQL:

\dt     gives you a listing of all tables
\df     gives you a listing of all functions
\d table-name      gives you a schema of the table
\d function-name     gives you a list of parameters
etc.

Typing "\?" on the PSQL command line will show you more options.

-Josh




Re: Display listings

From
"cristi"
Date:
And how can I see the source code of the function made by me?

>
> > How is it to display the listings/ detailed descriptions of a
> > function
> > or a table created using plpgsql or using database client such as
> > psql?
>
> Check out the \d commands through PSQL:
>
> \dt gives you a listing of all tables
> \df gives you a listing of all functions
> \d table-name  gives you a schema of the table
> \d function-name gives you a list of parameters
> etc.
>
> Typing "\?" on the PSQL command line will show you more options.
>



Re: Display listings

From
Oliver Elphick
Date:
On Thu, 2002-11-07 at 06:04, cristi wrote:
> And how can I see the source code of the function made by me?

SELECT prosrc FROM pg_proc WHERE proname = 'your_function_name';

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Jesus said unto her, I am the resurrection, and
      the life; he that believeth in me, though he were
      dead, yet shall he live."      John 11:25


Re: Display listings

From
"cristi"
Date:
> > And how can I see the source code of the function made by me?
>
> SELECT prosrc FROM pg_proc WHERE proname = 'your_function_name';

Yes!
Thank you!

And for RULES and TRIGGERS ?


Re: Display listings

From
Oliver Elphick
Date:
On Thu, 2002-11-07 at 08:05, cristi wrote:
> > > And how can I see the source code of the function made by me?
> >
> > SELECT prosrc FROM pg_proc WHERE proname = 'your_function_name';
>
> Yes!
> Thank you!
>
> And for RULES and TRIGGERS ?

There are the tables pg_rules and pg_triggers...

Use \dS to get a list of all system tables.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Jesus said unto her, I am the resurrection, and
      the life; he that believeth in me, though he were
      dead, yet shall he live."      John 11:25