RE: Some questions about PLpgSql

From: Sondaar Roelof <roelof(dot)sondaar(at)scania(dot)com>
To: "'datactrl'" <quals(at)bigfoot(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: RE: Some questions about PLpgSql
Date: 2001-03-15 12:32:24
Message-ID: F28A2B83DFE0D411A7B3006097487147468FDC@sv7007.scania.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello jack,

To check if a table exists you could use:
select tablename from pg_tables;
For instance:
dhcp=# select count(*) from pg_tables where tablename='dhcp_subnet';
count
-------
1
(1 row)

dhcp=# select count(*) from pg_tables where tablename='dhcp_subnetaa';
count
-------
0
(1 row)

To see the system tables use \dS

The second I don't really know what you would like to see.
Perhaps a trigger could do this after the insert/update/delete ?

Best regards,
Roelof

> -----Original Message-----
> From: datactrl [SMTP:quals(at)bigfoot(dot)com]
> Sent: 15 March 2001 12:04
> To: pgsql-sql(at)postgresql(dot)org
> Subject: [SQL] Some questions about PLpgSql
>
> Hi, all
>
> By using 'PLpgsql', is that possible to
>
> 1) check if a specific table exists?
> 2) check if an INSERT/UPDATE/ DELETE has done successfully?
>
>
> Is there some more documents or samples for PLpgsql except USER GUIDE and
> PostgreSQL Introduction & concept?
>
> THANK YOU
>
> JACK
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2001-03-15 15:02:51 Re: PL/PgSQL and NULL
Previous Message datactrl 2001-03-15 11:03:53 Some questions about PLpgSql