Re: [SQL] extracting words

2008-04-22 Thread A. Kretschmer
am Tue, dem 22.04.2008, um 22:25:04 +0100 mailte Tarlika Elisabeth Schmitz folgendes: > I am not quite sure whether this would be sensible or indeed at > all possible to do in SQL: > > TABLE product: product_pk, product_name, department_fk > TABLE product: department_pk, department_name > > e

[SQL] extracting words

2008-04-22 Thread Tarlika Elisabeth Schmitz
I am not quite sure whether this would be sensible or indeed at all possible to do in SQL: TABLE product: product_pk, product_name, department_fk TABLE product: department_pk, department_name example data: SELECT product_pk, department_name, product_name ... LEFT JOIN ...: 1, "cakes & dessert

Re: [SQL] Problem with FOREIGN KEY

2008-04-22 Thread D'Arcy J.M. Cain
On Tue, 22 Apr 2008 18:26:19 +0300 "? |Vadim Zhernovoi|" <[EMAIL PROTECTED]> wrote: > I have a Problem with Foreign key query...i've posted the code on > http://pgsl.privatepaste.com/e44p3Orqiq, so it have syntax higlight. > Please, need help! That message is not telling you the the r

Re: [SQL] Problem with FOREIGN KEY

2008-04-22 Thread Erik Jones
On Apr 22, 2008, at 10:26 AM, Вадим Жерновой |Vadim Zhernovoi| wrote: I have a Problem with Foreign key query...i've posted the code on http://pgsl.privatepaste.com/e44p3Orqiq, so it have syntax higlight. Please, need help! What that's telling you is that there is data in your Users table

[SQL] Problem with FOREIGN KEY

2008-04-22 Thread Вадим Жерновой |Vadim Zhernovoi|
I have a Problem with Foreign key query...i've posted the code on http://pgsl.privatepaste.com/e44p3Orqiq, so it have syntax higlight. Please, need help! Thank you! -- Vadim Zhernovoi -- -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://w

Re: [SQL] After updating dataset the record goes to the end of thedataset

2008-04-22 Thread Scott Marlowe
On Tue, Apr 22, 2008 at 7:00 AM, Nacef LABIDI <[EMAIL PROTECTED]> wrote: > Thank you all for your useful comments. > > I have tried to order my records as you said and got it work as I wanted. Cool beans! I was just watching this conversation, but wanted to point out that using the methods mentio

Re: [SQL] After updating dataset the record goes to the end of thedataset

2008-04-22 Thread Bart Degryse
Probably what you mean is that you want the order in which the records were originally inserted into the database. In that case add a serial to your table and fetch the records like SELECT * FROM tbl WHERE 1=1 ORDER BY [myserialfield] It's not foolproof but will in many cases come close to what y

Re: [SQL] After updating dataset the record goes to the end of thedataset

2008-04-22 Thread Nacef LABIDI
Thank you all for your useful comments. I have tried to order my records as you said and got it work as I wanted. Thank you again On Tue, Apr 22, 2008 at 2:56 PM, Bart Degryse <[EMAIL PROTECTED]> wrote: > Probably what you mean is that you want the order in which the records > were > originall

Re: [SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread Craig Ringer
Nacef LABIDI wrote: Yes I don't issue any sort statement, and I indeed want the data to be show as it is stored in the database. That's what you're getting. PostgreSQL has an MVCC design. How it works in general terms (simplified, but I lack the expertise to give a complete explanation even if

Re: [SQL] Problems with function while migrating from Windows to Linux

2008-04-22 Thread Craig Ringer
Jan Peters wrote: Hello list, after developping my application in a Windows environment I am now migrating to the production Linux webserver. [snip] when I do e.g. a "select getgv_neu(5,'company_5',1,0)" I get the error message: ERROR: syntax error at or near "$4" at character 81 QUERY:

Re: [SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread Padam J Singh
Nacef, Simply add a SERIAL column to your table. When you add a new row, a new value will be stored in this column if you do not specify the column name in the insert query. In your select query, always order by this column. When doing an update , do not update this column. When re-ordering, u

Re: [SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread hubert depesz lubaczewski
On Tue, Apr 22, 2008 at 12:31:54PM +0200, Nacef LABIDI wrote: > When I have tested this with SQLServer it works well, since the rows doesn't > change position on the DB. > I hope that you understand my issue and I will provide any explanations if > someting isn't clear enough. well. in postgresql

Re: [SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread Pavan Deolasee
On Tue, Apr 22, 2008 at 4:01 PM, Nacef LABIDI <[EMAIL PROTECTED]> wrote: > > I am writing an application where here is some resources to plan events on. > I want to provide the user with the ability to customize the order in which > resources are displayed on the screen. To hope that the databas

Re: [SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread Nacef LABIDI
You are right about the fact that the rows don't keep the order they where created with at the start. I have verfied this. I will explain more my case : I am writing an application where here is some resources to plan events on. I want to provide the user with the ability to customize the order i

Re: [SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread hubert depesz lubaczewski
On Tue, Apr 22, 2008 at 12:10:41PM +0200, Nacef LABIDI wrote: > Yes I don't issue any sort statement, and I indeed want the data to be show > as it is stored in the database. But after updating a row (I don't update > the ID, just some fields), it keeps its same place on the DB but jumps to > the e

Re: [SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread Gurjeet Singh
On Tue, Apr 22, 2008 at 3:24 PM, Nacef LABIDI <[EMAIL PROTECTED]> wrote: > Hi all, > > I am using Postgres in a Delphi application through ODBC. I am having an > issue with updating records. > > When I create a dataset to get the records in a table then after I update > one of these records and th

Re: [SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread Thomas Kellerer
Nacef LABIDI, 22.04.2008 11:54: Hi all, I am using Postgres in a Delphi application through ODBC. I am having an issue with updating records. When I create a dataset to get the records in a table then after I update one of these records and then refresh the dataset, the record goes to the e

Re: [SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread Nacef LABIDI
Yes I don't issue any sort statement, and I indeed want the data to be show as it is stored in the database. But after updating a row (I don't update the ID, just some fields), it keeps its same place on the DB but jumps to the end of the dataset and by the way to the end of the DBGrid. Nacef On

[SQL] After updating dataset the record goes to the end of the dataset

2008-04-22 Thread Nacef LABIDI
Hi all, I am using Postgres in a Delphi application through ODBC. I am having an issue with updating records. When I create a dataset to get the records in a table then after I update one of these records and then refresh the dataset, the record goes to the end of the dataset. This is disappointi

[SQL] Problems with function while migrating from Windows to Linux

2008-04-22 Thread Jan Peters
Hello list, after developping my application in a Windows environment I am now migrating to the production Linux webserver. I backed up my database, functions and schemas and imported them again via pgAdmin III, because the first application which I used to do the transfer did not move the varia