[SQL] UNSUBSCRIBE

2003-11-04 Thread Atul Pedgaonkar
UNSUBSCRIBE ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] query assistance

2003-11-04 Thread Michael Glaesemann
Hi Jodi, On Wednesday, November 5, 2003, at 12:16 AM, Jodi Kanter wrote: Is there a straight forward way to pull out duplicates in a particular field given a value in another field? For example, I have a table that lists users and study names associated with those users. Each user can have one or

Re: [SQL] Problems with NEW.* in triggers

2003-11-04 Thread Tom Lane
Jamie Lawrence <[EMAIL PROTECTED]> writes: > I don't understand why moddate isn't getting set to now() in the above. Josh fingered the problem there --- you need a BEFORE trigger if you want to affect the data that will be stored. I had missed that little mistake :-( rega

Re: [SQL] Problems with NEW.* in triggers

2003-11-04 Thread Jamie Lawrence
On Tue, 04 Nov 2003, Tom Lane wrote: > Jamie Lawrence <[EMAIL PROTECTED]> writes: > > I had thought that if moddate isn't included in an insert or update, > > that it would be null in the NEW context, > > No, it would be whatever the value to be assigned to the column would > be, if the trigger w

Re: [SQL] Problems with NEW.* in triggers

2003-11-04 Thread Josh Berkus
Jamie, > Any thoughts on what I'm doing wrong?? Yes. If you want to modify the new data, you need to use a BEFORE trigger. AFTER triggers can't modify NEW, just read it. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--

Re: [SQL] Problems with NEW.* in triggers

2003-11-04 Thread Tom Lane
Jamie Lawrence <[EMAIL PROTECTED]> writes: > I had thought that if moddate isn't included in an insert or update, > that it would be null in the NEW context, No, it would be whatever the value to be assigned to the column would be, if the trigger were not present. In particular, during an UPDATE

[SQL] Problems with NEW.* in triggers

2003-11-04 Thread Jamie Lawrence
Hi folks - I'm having a problem with what looks like it should be trivial. For the function create or replace function timestamp_fn() returns opaque as ' begin NEW.moddate := coalesce(NEW.moddate, now()); return NEW; end ' language 'plpgsql'; on an after insert

Re: [SQL] Error message during compressed backup

2003-11-04 Thread Senthil Kumar S
Hi Peter Eisentraut, >>select proowner from pg_proc where proname = 'plpgsql_call_handler'; It gives me an id '101' While I search for the users in the pg_user, there is no user of id 101 select * from pg_user where usesysid = 101; No result was fetched. While I search this way select * from

[SQL] Please help me to slove this SQL statements

2003-11-04 Thread Freshman
There are three table in database which is suppliers, projects, and shipments suppliers contain suppliers id, name ...etc projects contain project name ..suppliers ID ( J1---J7) ...etc shipments table contain suppliers ID , PROJECTS ID how can i query to find out the suppliers to supply all the pr

Re: [SQL] connectby

2003-11-04 Thread BenoƮt BOURNON
I use postgresql 7.2.3 How can I use connectby ?? Must I install files ? or packages ? or it is recommanded to upgrade dataserver ? George Essig wrote: hi I have menu table: id | integer | not null default nextval('public.menu_id_seq'::text) parent_id | integer |

Re: [SQL] query assistance

2003-11-04 Thread Richard Huxton
On Tuesday 04 November 2003 15:16, Jodi Kanter wrote: > Is there a straight forward way to pull out duplicates in a particular > field given a value in another field? > For example, I have a table that lists users and study names associated > with those users. Each user can have one or more study n

[SQL] query assistance

2003-11-04 Thread Jodi Kanter
Is there a straight forward way to pull out duplicates in a particular field given a value in another field? For example, I have a table that lists users and study names associated with those users. Each user can have one or more study names. My goal is to determine if any of these people have

Re: [SQL] Using UNION inside a cursor

2003-11-04 Thread Paul Ganainm
[EMAIL PROTECTED] says... > (SELECT * FROM history WHERE obs_type = \'AA\' ) > UNION > (SELECT * FROM history WHERE obs_type = \'TA\'); Maybe I'm just confused here, but what's to stop you using SELECT * FROM History WHERE (Obs_Type = \'AA\' AND Obs_Type = \'TA\') ? Or have I mi

Re: [SQL] create type input and output function examples

2003-11-04 Thread Christoph Haller
> > I've seen the docs for create type and an example of the syntax to create a > type. What I haven't seen is the functions that are passed for the input and > output elements. > > CREATE TYPE box (INTERNALLENGTH = 8, > INPUT = my_procedure_1, OUTPUT = my_procedure_2); > > Now what would