Josh Berkus <[EMAIL PROTECTED]> writes:
> Now, testing how many rows were inserted/updated/deleted ... that I'm
> not sure about. It would be nice to have a ROWS_AFFECTED returned from
> a data manipulation query in PL/pgSQL, but I don't believe that that has
> been implemented.
It has as of 7.1
Jack,
> 2) check if an INSERT/UPDATE/ DELETE has done successfully?
This happens automatically, within a PL/pgSQL function. If the
INSERT/UPDATE errors out, the function automatically halts. Actually,
this kind of behaviour can be annoying the other way (sometimes one
doesn't care about the er
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