Re: [GENERAL] ERROR: missing FROM-clause entry for table on postgresql 8.1 not on 7.4; deleting from a join

2008-06-16 Thread Tommy Gildseth
m laks wrote: Hi, I am migrating to postgresql 8.1 from 7.4 with debian. Now I notice that one of my perl DBI scripts is crashing with the error above, and worked fine before. LTA_IDB=# delete from instancetable where ( (imagelevel.serparent= '1.2.840.113704.1.111.4640.1185891989.4') and (i

Re: [GENERAL] ERROR: missing FROM-clause entry for table on postgresql 8.1 not on 7.4; deleting from a join

2008-06-16 Thread Jaime Casanova
On Tue, Jun 17, 2008 at 1:25 AM, m laks <[EMAIL PROTECTED]> wrote: > Hi, > I am migrating to postgresql 8.1 from 7.4 with debian. > [...] > > the following worked before: > > LTA_IDB=# delete from instancetable where ( (imagelevel.serparent= > '1.2.840.113704.1.111.4640.1185891989.4') and (instanc

[GENERAL] ERROR: missing FROM-clause entry for table on postgresql 8.1 not on 7.4; deleting from a join

2008-06-16 Thread m laks
Hi, I am migrating to postgresql 8.1 from 7.4 with debian. Now I notice that one of my perl DBI scripts is crashing with the error above, and worked fine before. >From google I learn that postgresql is  getting tougher on us malfeasant >coders who violate the SQL rules :(.  I have not slept

Re: [GENERAL] inserting to a multi-table view

2008-06-16 Thread Richard Broersma
On Mon, Jun 16, 2008 at 10:24 PM, Richard Broersma <[EMAIL PROTECTED]> wrote: > On Mon, Jun 16, 2008 at 8:32 PM, Michael Shiulman <[EMAIL PROTECTED]> wrote: > Anyway, here is a link discussing a generalized vertical partitioned > view. Perhaps it can give you some idea to get yourself rolling. > h

Re: [GENERAL] inserting to a multi-table view

2008-06-16 Thread Richard Broersma
On Mon, Jun 16, 2008 at 8:32 PM, Michael Shiulman <[EMAIL PROTECTED]> wrote: > No, I don't think table inheritance will help. My actual situation is > somewhat more complicated: the view takes data from more than two > tables with a many-to-one rather than one-to-one relationship. For > instance

Re: [GENERAL] inserting to a multi-table view

2008-06-16 Thread Michael Shulman
On Mon, Jun 16, 2008 at 10:27 PM, Craig Ringer <[EMAIL PROTECTED]> wrote: >> I want to be able to do INSERTs on "studentinfo" and have rows created >> in both "person" and "student". This requires first inserting into >> "person", capturing the "person_id" of the resulting row, and using it >> to

Re: [GENERAL] inserting to a multi-table view

2008-06-16 Thread Michael Shulman
On Mon, Jun 16, 2008 at 10:03 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: >> I can write a trigger >> function that does the right thing, with 'INSERT ... RETURNING >> person_id INTO ...', but Postgres will not let me add an INSERT >> trigger to a view; it says 'ERROR: "studentinfo" is not a table

Re: [GENERAL] inserting to a multi-table view

2008-06-16 Thread Craig Ringer
Michael Shulman wrote: I want to be able to do INSERTs on "studentinfo" and have rows created in both "person" and "student". This requires first inserting into "person", capturing the "person_id" of the resulting row, and using it to insert into "student". This seems as though it must be a co

Re: [GENERAL] inserting to a multi-table view

2008-06-16 Thread Scott Marlowe
On Mon, Jun 16, 2008 at 8:49 PM, Michael Shulman <[EMAIL PROTECTED]> wrote: > Hi, > > This feels like a very basic question but I cannot figure it out. > Suppose I have two tables and a view that combines their data: > > CREATE TABLE person > (person_id SERIAL PRIMARY KEY, > ...); > > CREATE TABL

[GENERAL] inserting to a multi-table view

2008-06-16 Thread Michael Shulman
Hi, This feels like a very basic question but I cannot figure it out. Suppose I have two tables and a view that combines their data: CREATE TABLE person (person_id SERIAL PRIMARY KEY, ...); CREATE TABLE student (student_id SERIAL PRIMARY KEY, person_id INTEGER REFERENCES person, ...) CR

[GENERAL] cool code_swarm animation of PostgreSQL development since 1996

2008-06-16 Thread TJ O'Donnell
This is a very cool animation for your amusement, amazement and edification. http://www.vimeo.com/1081680 TJ O'Donnell http://www.gnova.com/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-gener

Re: [GENERAL] Money data type - Deprecated?

2008-06-16 Thread Martijn van Oosterhout
On Mon, Jun 16, 2008 at 11:10:09AM -0500, Decibel! wrote: > >I personally think that it really belongs in contrib as an example of > >adding a new type...with all the money bits stripped off, as a > >strictly fixed precision integer. > > I think what it really needs is currency information so that

Re: [GENERAL] How to INSERT empty line into SEQUENTIAL table from PHP

2008-06-16 Thread Tino Wildenhain
A. Kretschmer wrote: insert into table_xx (id, field2, ...) values (NULL, ...) I'd say it should be DEFAULT instead of NULL :-) T. smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] Clustering with minimal locking

2008-06-16 Thread Decibel!
On May 28, 2008, at 11:21 AM, Scott Ribe wrote: If I'm not totally off-base, here's one way to enable clustering on systems that run 24/7: 1 cluster current rows 1.1 note current last committed transaction 1.2 copy all visible rows to new table in cluster order 1.3 build indexes on

Re: [GENERAL] Money data type - Deprecated?

2008-06-16 Thread Decibel!
On May 27, 2008, at 8:29 AM, Merlin Moncure wrote: On Mon, May 26, 2008 at 4:05 PM, Andrew Sullivan <[EMAIL PROTECTED]> wrote: On Mon, May 26, 2008 at 03:46:39PM -0400, Justin wrote: Thats a good Question is the Money type ever going to die i believe it was deprecated several versions ago?

Re: [GENERAL] why sequential scan is used on indexed column ???

2008-06-16 Thread Michael Fuhr
On Sat, Jun 14, 2008 at 02:35:38PM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > I created a test case that has close to the same estimated and > > actual row counts and has the same plan if I disable enable_nestloop: > > There's something weird about this --- why does the

Re: [GENERAL] Advice for "hot-swapping" databases

2008-06-16 Thread Woody Woodring
If the databases are on the same machine, I could see creating a template database and then use: createdb -T templateName newDbName It will create the new db exactly like the template. I think createdb does this by default using the database template1 as the template. My databases are all on

Re: [GENERAL] Advice for "hot-swapping" databases

2008-06-16 Thread Geoffrey
Kynn Jones wrote: Hi. I'm trying to automate the updating of a database. This entails creating the new database from scratch (which takes a long time), under a different name, say mydb_tmp, and once this new database is ready, doing a "hot swap", i.e. renaming the existing database to something

Re: [GENERAL] How to INSERT empty line into SEQUENTIAL table from PHP

2008-06-16 Thread Stefan Schwarzer
True indeed... With SELECT setval('page_input_id_seq', 89); it works then with this: INSERT INTO page_input (id, page, text_en, text_fr, text_es, text_ar) VALUES (nextval('page_input_id_seq'::regclass), '', '', '', '', '') Thanks a lot!! Stef I guess you get duplicate value err

Re: [GENERAL] How to INSERT empty line into SEQUENTIAL table from PHP

2008-06-16 Thread Julius Tuskenis
I guess you get duplicate value error because you have previously inserted ID column with your own values. Check the sequence page_input_id_seq if it points to the right next value. If not - correct it to a MAX(ID) +1 Julius Tuskenis Stefan Schwarzer rašė: It doesn't work like this: I

Re: [GENERAL] How to INSERT empty line into SEQUENTIAL table from PHP

2008-06-16 Thread Stefan Schwarzer
It doesn't work like this: INSERT INTO page_input (id, page, text_en, text_fr, text_es, text_ar) VALUES (NULL, '', '', '', '', '') --> ERROR: null value in column "id" violates not-null constraint nor like this: INSERT INTO page_input (page, text_en, text_fr, text_es, text_ar) V