Re: [SQL] cannot create function that uses variable table name

2003-01-16 Thread Stephan Szabo
On Thu, 16 Jan 2003, Matthew Nuzum wrote: > I have a number of tables in my database that use the concept of > “display order”, which is a field that can be used in an order by clause > to dictate what order the results should come out in. >   > I thought I would be crafty and devise a function th

Re: [SQL] cannot create function that uses variable table name

2003-01-16 Thread chester c young
--- Matthew Nuzum <[EMAIL PROTECTED]> wrote: > I thought I would be crafty and devise a function that would always > return the highest numbered item in the table. But it doesn’t work. > It always gives me a parse error at $1. Here’s the function: build the query as a string and execute it. __

[SQL] cannot create function that uses variable table name

2003-01-16 Thread Matthew Nuzum
I have a number of tables in my database that use the concept of “display order”, which is a field that can be used in an order by clause to dictate what order the results should come out in.   I thought I would be crafty and devise a function that would always return the highest numbered item in t

Re: [SQL] query speed joining tables

2003-01-16 Thread Josh Berkus
Vernon, > The other way to build a query string is used on selection operation for multiple table joined and/or involved. A query > string is built dynmically due to whether or not any fields are examined. The characteristic of the application is that > among of many fields a user may only wa

Re: [SQL] query speed joining tables

2003-01-16 Thread Vernon Wu
16/01/2003 9:46:30 AM, "Josh Berkus" <[EMAIL PROTECTED]> wrote: >Vernon, > >> What I stated is my observation on my project with over twenty >> multivalued detail tables. I have a selection query >> contained 200 characters, involving 10 tables, and using subquery. >> The performance is not bad a

Re: [SQL] pg_restore cannot restore an index

2003-01-16 Thread Jie Liang
Sorry, it because I have another index with same indexname because pg_restore index fail. Thanks. Jie Liang -Original Message- From: Bruce Momjian [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 10:07 AM To: Jie Liang Cc: Tom Lane; [EMAIL PROTECTED] Subject: Re: [SQL] pg_

Re: [SQL] pg_restore cannot restore an index

2003-01-16 Thread Bruce Momjian
Yes, I remember this. The code in 7.3 looks OK to me. Can you show me a command line that fails for you? I just tried: $ pg_restore -I x asdf pg_restore: [archiver] could not open input file: No such file or directory so it looks like -I is working. ---

Re: [SQL] query speed joining tables

2003-01-16 Thread Josh Berkus
Vernon, > What I stated is my observation on my project with over twenty > multivalued detail tables. I have a selection query > contained 200 characters, involving 10 tables, and using subquery. > The performance is not bad after properly indexing, > least than 3 second (what the planner says).

[SQL] pg_restore cannot restore an index

2003-01-16 Thread Jie Liang
Last July, I pointed out this problem when I use v7.2.1, I got the answer that will be resolved in v7.3, however, I am using v7.3.1, pg_restore.c seems have no change in this section. So it still doesn't work. Jie Liang Jie Liang wrote: > I read the pg_restore.c source code, I found: > #ifdef

Re: [SQL] RFC: A brief guide to nulls

2003-01-16 Thread Otto Hirr
I think that having this topic defined and available will be of great benefit... !!! Thanks Richard. Some additional thoughts based upon what other people have explicitly or implicitly implied. Peter quoted the sql definition as: >Every data type includes a special value, called the null valu

[SQL] Function unkown

2003-01-16 Thread Pedro Igor
How is this function ? plpgsql_call_handler() RETURNS language_handler AS 'plpgsql_call_handler' LANGUAGE 'c' VOLATILE; ---Outgoing mail is certified Virus Free.Checked by AVG anti-virus system (http://www.grisoft.com).Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003

Re: [SQL] Implementing automatic updating of primary keys...

2003-01-16 Thread Rajesh Kumar Mallah.
yes you got my problem rightly. If i use "on update cascade" approach still there is problem. If i attempt to update the key in master table it wont be allowed becoz of temporary violation of PRIMARY KEY CONSTRAINT. becoz 1 is also existing in the master table. update profile_master set id=

Re: [SQL] Implementing automatic updating of primary keys...

2003-01-16 Thread Tomasz Myrta
Rajesh Kumar Mallah. wrote: Hi we are working on re-structuring our database schemas and intend to implement the functionality below at database level. consider a master table with following data. Table: profile_master id | username | password ---|--|-- 1 | u1

[SQL] Implementing automatic updating of primary keys...

2003-01-16 Thread Rajesh Kumar Mallah.
Hi we are working on re-structuring our database schemas and intend to implement the functionality below at database level. consider a master table with following data. Table: profile_master id | username | password ---|--|-- 1 | u1 | p1 2 | u2 | p2

Re: [SQL] pg_dump problem

2003-01-16 Thread Tomasz Myrta
Rudi Starcevic wrote: Hi, After doing a pg_dump on a database I'm unable to access the file. My command is simply 'mv' :: mv camper.dump20020116 camper_bak/ The error I get is :: mv: camper.dump20020116: Value too large for defined data type Strange. It seems to be saying the file I created

Re: [SQL] Oracle outer join porting question

2003-01-16 Thread Marko Asplund
On Wed, 15 Jan 2003, Tambet Matiisen wrote: > ... > Try this: > > SELECT doc.id,doc.title,sub.user_id,sub.operation > FROM document doc LEFT OUTER JOIN document_subscription sub > ON sub.document_id = doc.id AND sub.user_id = 6; yes, this query seems to give the same results as the original

Re: [SQL] RFC: A brief guide to nulls (noarchive)

2003-01-16 Thread Ries van Twisk
You might add this as an example: mytable id value 1 1 2 2 3 3 4 5 4 6 5 -- Count ALL records SELECT count(*) FROM mytable; Result: 6 -- Count id records SELECT count(id) FROM mytable; Result: 6 -- Count value records SELECT count(value) FR

Re: [SQL] lost on self joins

2003-01-16 Thread Tomasz Myrta
Ross J. Reedstrom wrote: Finaly, a table to allow a many to many join called files_folders | files_folders x| ffid | folderid (fk to folders.folderid) | fileid (fk to files.fileid) Strange. Do you need this table? Can one file exist in several directories? If not, you can just

Re: [SQL] RFC: A brief guide to nulls

2003-01-16 Thread dev
Apologies for previous post with no content - hit send by mistake. Thanks to everyone for the feedback, 2nd draft out later today/tomorrow. - Richard Huxton ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql

Re: [SQL] RFC: A brief guide to nulls

2003-01-16 Thread dev
> > --- [EMAIL PROTECTED] wrote: >> There have been a few posts recently where people >> have had problems with >> nulls. Anyone got comments on the below before I >> submit it to techdocs? >> >> TIA >> >> - Richard Huxton >> >> A Brief Guide to NULLs >> == >> >> What is a null?