[SQL] update/insert data

2004-11-27 Thread Keith Worthington
Hi All, I have two tables in different schemas. The first table in the data_transfer schema is loaded with a COPY command. I need to transfer the data to the second schema inserting new records and updating existing records. What is the best way to achieve this functionality? Kind Regards, Kei

Re: [SQL] Querying a list field against another list

2004-11-27 Thread m
Try this: CREATE OR REPLACE FUNCTION csv_matches(TEXT, TEXT) RETURNS BOOLEAN AS $$ DECLARE -- $1 is the field text, $2 is the list of ints to try and match. m TEXT; f TEXT; i INTEGER := 1; j INTEGER; BEGIN IF $1 IS NULL THEN RETURN 'f'; ELSIF

Re: [SQL] Type Inheritance

2004-11-27 Thread Andrew Thorley
"If you had said what this *does*, we might be better able to help" basically i have a series of types (or data types), of which one is the root and each of the other types appear under the root as in generalisation/specialisation style, inheriting the above types attributes etc. this is what i

Re: [SQL] Type Inheritance

2004-11-27 Thread Andrew Thorley
hi tom thanks for reply. im trying to provide inheritance for data types (domains), not tables. i will look into the syntax associated with domains as data types does not include an inheritance function (or so i think). regards andy. - Original Message - From: "Tom Lane" <[EMAIL PROTE

[SQL] how many JOINs?

2004-11-27 Thread Konstantin Danilov
Hello List! Do you know how many times can JOIN be used in a query? How many JOINs does PostgreSQL support in ONE query? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAdd