Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
On Fri, 3 Nov 2006, Tom Lane wrote: Jeff Frost <[EMAIL PROTECTED]> writes: BTW, just to make sure I get the right file to ship over if we have this again, it would be: /var/lib/pgsql/data/base/9366228/16204210 yes? Not necessarily --- the filename is initially the same as the index OID, but i

Re: [SQL] The empty list?

2006-11-02 Thread Tom Lane
Jesper Krogh <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> FWIW, as of 8.2 the best option will probably be to use >> "col = ANY (array)", which does support zero-length arrays >> if you use either an out-of-line parameter or an array literal. > That looks nice.. is ANY in the SQL-spec? ANY is

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Tom Lane
Jeff Frost <[EMAIL PROTECTED]> writes: > BTW, just to make sure I get the right file to ship over if we have this > again, it would be: /var/lib/pgsql/data/base/9366228/16204210 yes? Not necessarily --- the filename is initially the same as the index OID, but it wouldn't be anymore after a REINDE

Re: [SQL] The empty list?

2006-11-02 Thread Jesper Krogh
Tom Lane wrote: > Jesper Krogh <[EMAIL PROTECTED]> writes: >> ... the right-hand-side of on >> in operation will allways be a list (if I havent forgotten something). > > IN (SELECT ...) for one thing. Isn't that "just" a list of rows(complex value) instead of an list of types(simple values)? >>

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
On Fri, 3 Nov 2006, Tom Lane wrote: Jeff Frost <[EMAIL PROTECTED]> writes: On Thu, 2 Nov 2006, Tom Lane wrote: This seems pretty darn weird. I am wondering about corrupt indexes --- can you find the indicated key in either table if you set enable_indexscan and enable_bitmapscan to 0? That's

Re: [SQL] The empty list?

2006-11-02 Thread Tom Lane
Jesper Krogh <[EMAIL PROTECTED]> writes: > ... the right-hand-side of on > in operation will allways be a list (if I havent forgotten something). IN (SELECT ...) for one thing. > ... but missing SQL for the empty list basically means that > we cant handle the empty set encoded in the empty array

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Tom Lane
Jeff Frost <[EMAIL PROTECTED]> writes: > On Thu, 2 Nov 2006, Tom Lane wrote: >> This seems pretty darn weird. I am wondering about corrupt indexes --- >> can you find the indicated key in either table if you set >> enable_indexscan and enable_bitmapscan to 0? > test_tracking=# begin; > BEGIN > te

Re: [SQL] Add calculated fields from one table to other table

2006-11-02 Thread Richard Broersma Jr
> I am sending you the create statement of tables & few insert statements as > well. Hope this > helps to solve the problem. where are the insert statements? ;) > > CREATE TABLE ticks > ( > tick_id int8 NOT NULL DEFAULT nextval(('ticks_s'::text)::regclass), > ric varchar(30) NOT NUL

Re: [SQL] The empty list?

2006-11-02 Thread Jesper Krogh
Aaron Bono wrote: > On 11/2/06, Tom Lane <[EMAIL PROTECTED]> wrote: >> >> Jesper Krogh <[EMAIL PROTECTED]> writes: >> > Whereas this gives a syntax error: >> >> > # select 1 in (); >> > ERROR: syntax error at or near ")" at character 14 >> > LINE 1: select 1 in (); >> > ^ >> >

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
On Thu, 2 Nov 2006, Tom Lane wrote: Jeff Frost <[EMAIL PROTECTED]> writes: delete from visit where id not in (select distinct visit_id from page_view); This yields the following error: ERROR: update or delete on "visit" violates foreign key constraint "fk34afd255fbacabec" on "page_view"

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Tom Lane
Jeff Frost <[EMAIL PROTECTED]> writes: > delete from visit where id not in (select distinct visit_id from page_view); > This yields the following error: > ERROR: update or delete on "visit" violates foreign key constraint > "fk34afd255fbacabec" on "page_view" > DETAIL: Key (id)=(38635629) is s

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
On Thu, 2 Nov 2006, Jeff Frost wrote: I'm having problem with a cleanup script that runs nightly. The script calls the following query: delete from visit where id not in (select distinct visit_id from page_view); This yields the following error: ERROR: update or delete on "visit" violates

[SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
I'm having problem with a cleanup script that runs nightly. The script calls the following query: delete from visit where id not in (select distinct visit_id from page_view); This yields the following error: ERROR: update or delete on "visit" violates foreign key constraint "fk34afd255fbaca

Re: [SQL] Determining correct table order for insert or drop statements to satisfy foreign keys

2006-11-02 Thread Peter Hanson
Hi Aaron, I'm using PHP5 as the programming language. Thanks, Pete On Thursday 02 November 2006 16:58, Aaron Bono wrote: > On 11/2/06, Peter Hanson <[EMAIL PROTECTED]> wrote: > > Hello, > > > > First, sorry if this has already been covered, though I didn't find > > anything > > similar in the a

Re: [SQL] Determining correct table order for insert or drop statements to satisfy foreign keys

2006-11-02 Thread Aaron Bono
On 11/2/06, Peter Hanson <[EMAIL PROTECTED]> wrote: Hello,First, sorry if this has already been covered, though I didn't find anythingsimilar in the archives. Also sorry if this is the wrong list for this typeof question, though it seemed to be the most relevant list for this question. On to the qu

Re: [SQL] Database recovery in postgres 7.2.4.

2006-11-02 Thread Chris Browne
"Santosh" <[EMAIL PROTECTED]> writes: > Hi All. > > My setup is as follows: > OS: Sun Solaris 5.8. > Postgres: 7.2.4 > > I have very large database, which contain 15 tables and each table is > contain more than 10,00,000 records. > > My application is parsing text data files and inserting records i

Re: [SQL] The empty list?

2006-11-02 Thread Aaron Bono
On 11/2/06, Tom Lane <[EMAIL PROTECTED]> wrote: Jesper Krogh <[EMAIL PROTECTED]> writes:> Whereas this gives a syntax error:> # select 1 in ();> ERROR:  syntax error at or near ")" at character 14 > LINE 1: select 1 in ();>  ^I think the short answer why the spec disallows this

Re: [SQL] The empty list?

2006-11-02 Thread Tom Lane
Jesper Krogh <[EMAIL PROTECTED]> writes: > Whereas this gives a syntax error: > # select 1 in (); > ERROR: syntax error at or near ")" at character 14 > LINE 1: select 1 in (); > ^ If we took that syntax it would probably mean a zero-element row, not an empty IN list. But I

[SQL] The empty list?

2006-11-02 Thread Jesper Krogh
Hi. Is there someone who can elaborate on why the "empty list" is'nt implemented in Postgresql? This works: # select 1 in (1,2,3); ?column? -- t (1 row) And this works: jesper=# select * from test; id (0 rows) jesper=# select 1 in (select id from test); ?column? -- f (

Re: [SQL] [GENERAL] Is there anyway to...

2006-11-02 Thread Dave Page
imad wrote: Or you can probably use a PostgreSQL administration tool for scheduled jobs. I know a number of such tools which provide this feature and EnterpriseDB Management Server is one of them. As is pgAdmin's pgAgent. Regards, Dave ---(end of broadcast)

[SQL] Determining correct table order for insert or drop statements to satisfy foreign keys

2006-11-02 Thread Peter Hanson
Hello, First, sorry if this has already been covered, though I didn't find anything similar in the archives. Also sorry if this is the wrong list for this type of question, though it seemed to be the most relevant list for this question. On to the question: I'm writing a simple import script t

Re: [SQL] [GENERAL] Is there anyway to...

2006-11-02 Thread imad
Yeah, and EnterpriseDB Management Server is a community project and can be used for free, off course! --Imad www.EnterpriseDB.com On 11/3/06, A. Kretschmer <[EMAIL PROTECTED]> wrote: am Fri, dem 03.11.2006, um 0:04:50 +0500 mailte imad folgendes: > Or you can probably use a PostgreSQL admini

Re: [SQL] [GENERAL] Is there anyway to...

2006-11-02 Thread A. Kretschmer
am Fri, dem 03.11.2006, um 0:04:50 +0500 mailte imad folgendes: > Or you can probably use a PostgreSQL administration tool for scheduled > jobs. I know a number of such tools which provide this feature and > EnterpriseDB Management Server is one of them. > > --Imad > www.Enterpri

Re: [SQL] [GENERAL] Is there anyway to...

2006-11-02 Thread imad
Or you can probably use a PostgreSQL administration tool for scheduled jobs. I know a number of such tools which provide this feature and EnterpriseDB Management Server is one of them. --Imad www.EnterpriseDB.com On 11/2/06, A. Kretschmer <[EMAIL PROTECTED]> wrote: am Thu, dem 02.11.2006, um

Re: [SQL] [GENERAL] Is there anyway to...

2006-11-02 Thread A. Kretschmer
am Thu, dem 02.11.2006, um 13:14:22 -0500 mailte louis gonzales folgendes: > Hello all, > Is there an existing mechanism is postgresql that can automatically > increment/decrement on a daily basis w/out user interaction? The use You can use CRON for such tasks. I hope for, you have a operating

Re: [SQL] hi i am getting error...can u solve this

2006-11-02 Thread Hector Villarreal
What difference do you want to see? . Looks like your email got truncated. Please resend. There is not enough information to determine what is wanted.   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Penchalaiah P. Sent: Thursday, November 02, 2006 4:50 AM To: pgs

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-11-02 Thread Tom Lane
"Simon Riggs" <[EMAIL PROTECTED]> writes: > We have namespaces to differentiate between two sources of object names, > so anybody who creates a schema where MyColumn is not the same thing as > myColumn is not following sensible rules for conceptual distance. I'd agree that that is not a good desig

Re: [SQL] hi i am getting error...can u solve this

2006-11-02 Thread Andrew Sullivan
On Thu, Nov 02, 2006 at 06:19:45PM +0530, Penchalaiah P. wrote: > > This is the table it contains some sample data.. but I want to see > difference between Between what? A -- Andrew Sullivan | [EMAIL PROTECTED] "The year's penultimate month" is not in truth a good way of saying November.

[SQL] hi i am getting error...can u solve this

2006-11-02 Thread Penchalaiah P.
Hi can u tell me about this problem..   cda_no  bp npa   rp dp pay_change_date   234597D   7900 400   1000 1000 2006-09-05 234597D   8250 400   1000 1000 2005-09-05 234575E   4000 200   333