[SQL] trigger on DELETE

2001-07-11 Thread Phuong Ma
Hello everyone, I'm trying to define a trigger that copies the row to be deleted into another table (which is the inventory_audit table) before it does the delete from the original table (which is the inventory table). CREATE FUNCTION inv_audit_mod () RETURNS OPAQUE AS ' BEGIN NEW

Re: [SQL] restoring a dump

2001-06-28 Thread Phuong Ma
Peter Eisentraut wrote: > > Phuong Ma writes: > > > pg_dump -C -D -F t > test.tar > > tar -xvf test.tar > > psql restore.sql > > psql test < 19.dat > > psql test < 20.dat .. and so on > > psql test < toc.dat > > I b

[SQL] restoring a dump

2001-06-28 Thread Phuong Ma
Hello, I have been trying to restore my dump and it seems like it is not working. I put the dump in a tar file and when I untarred it, there are several .dat files, a toc.dat file, and a restore.sql file. I used psql to restore these files into a database. I first started restoring the restor

[SQL] Shortcut?

2001-05-29 Thread Phuong Ma
I'm running Postgres 7.1. I read in the documentation that the from clause can be omitted from a select statement. The example given in the documentation is: SELECT distributors.* WHERE name = 'Westwood'; I tried it on tables in our database, but it doesn't work. Is that part of earlier versio

[SQL] performance inconsistency

2001-04-04 Thread Phuong Ma
Good day, We're running a week-old CVS snapshot of PostgreSQL 7.1, and I'm not sure if this performance inconsistency is specific to it, or if this is just something in PostgreSQL in general, but it seems kind of odd, and I could use some help here. ;) I have run two queries in a table full of i

[SQL] inconsistent functionality with LIKE operator

2001-03-29 Thread Phuong Ma
I'm using PostgreSQL version 7.1, and I'm having trouble with the LIKE statement. How would I find the value "a\bc"? I tried using the backslash to escape it: LIKE 'a\\b%'; If I specify: LIKE 'a\\bc', then it works, but if I wanted it to look for consecetive characters after the c, using the %,