Re: [GENERAL] Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug?
It's normal behaviour, because after the first update it will be 2 same values for m2 and you don't want that since you have a unique constraint for that column. try this: CREATE TABLE master ( m1 INT primary key , m2 int unique ) ; INSERT INTO master VALUES ( 1, 1 ) ; INSERT INTO master VALUES ( 2, 3) ; UPDATE master SET m2 = m2+1 ; - Original Message - From: Anoo Sivadasan Pillai To: Ardian Xharra Cc: pgsql-general@postgresql.org Sent: Tuesday, September 25, 2007 12:27 AM Subject: Re: [GENERAL] Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug? Hi, I am not using any sequences, The following batch can reproduce the behaviour. CREATE TABLE master ( m1 INT primary key , m2 int unique ) ; INSERT INTO master VALUES ( 1, 1 ) ; INSERT INTO master VALUES ( 2, 2) ; UPDATE master SET m2 = m2 + 1; With Cheers, Anoo S From: Ardian Xharra [mailto:[EMAIL PROTECTED] Sent: 25 September 2007 00:38 To: Anoo Sivadasan Pillai; pgsql-general@postgresql.org Cc: Anoo Sivadasan Pillai Subject: Re: [GENERAL] Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug? Probably you are using a sequence, and if so you need to update the value of sequence prior to update: SELECT setval('master_m1_seq',((SELECT id_m1 FROM master ORDER BY 1 DESC LIMIT 1)+1)); - Original Message - From: Anoo Sivadasan Pillai To: pgsql-general@postgresql.org Cc: Anoo Sivadasan Pillai Sent: Monday, September 24, 2007 3:20 AM Subject: [GENERAL] Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug? I am using PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special) on Windows 2003 server While I am trying to update a prmary key It is failing with the following message ERROR: duplicate key violates unique constraint master_pkey Can anybody explain why this happens so? Sending the script that I tried. CREATE TABLE master ( m1 INT primary key , m2 VARCHAR(100)) ; INSERT INTO master VALUES ( 1, 'm1' ) ; INSERT INTO master VALUES ( 2, 'm2' ) ; UPDATE master SET m1 = m1 + 1; Update fails with the message - ERROR: duplicate key violates unique constraint master_pkey If I insert data in the reverse order it is making no problem. Is this a Bug ? I tried , TRUNCATE TABLE master; INSERT INTO master VALUES ( 3, 'm3' ) ; INSERT INTO master VALUES ( 2, 'm2' ) ; UPDATE master SET m1 = m1 + 1; It works perfectly. Anoo S Visit our Website at www.rmesi.co.in This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information for the intended purpose only. Internet communications are not secure; therefore, RMESI does not accept legal responsibility for the contents of this message. Any views or opinions presented are those of the author only and not of RMESI. If this email has come to you in error, please delete it, along with any attachments. Please note that RMESI may intercept incoming and outgoing email communications. Freedom of Information Act 2000 This email and any attachments may contain confidential information belonging to RMESI. Where the email and any attachments do contain information of a confidential nature, including without limitation information relating to trade secrets, special terms or prices these shall be deemed for the purpose of the Freedom of Information Act 2000 as information provided in confidence by RMESI and the disclosure of which would be prejudicial to RMESI's commercial interests. This email has been scanned for viruses by Trend ScanMail. -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.488 / Virus Database: 269.13.30/1030 - Release Date: 25/09/2007 08:02
Re: [GENERAL] Kill session in PostgreSQL
You can use kill PID - Original Message - From: Ashish Karalkar To: pggeneral Sent: Tuesday, April 10, 2007 8:01 AM Subject: [GENERAL] Kill session in PostgreSQL Hello all, is there any command just like ORACLE Uses kill session to kill a particular session . tried withh linux kill -9 PID but it also kills all other sessions or am I just giving wrong signal to command kill? Thanks in advance With Regards ashish -- Check out what you're missing if you're not on Yahoo! Messenger -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.0.0/754 - Release Date: 09/04/2007 22:59
Re: [GENERAL] Why the data changes it's value by itself!
Yes, the problem was the memory (testing with memtest) I took us long to have the machine check Thanks, - Original Message - From: Richard Huxton dev@archonet.com To: Ardian Xharra [EMAIL PROTECTED] Cc: postgreSQL postgreSQL pgsql-general@postgresql.org Sent: Friday, November 17, 2006 1:12 PM Subject: Re: [GENERAL] Why the data changes it's value by itself! Ardian Xharra wrote: Does this message in application.log can be the source of problem wuaueng.dll (1204) Synchronous read page checksum error -1018 ((1:801 1:801) (0-13218) (0-14642)) occurred. Please restore the databases from a previous backup. I don't recognise this as a PostgreSQL error, although it could be part of the Windows code I suppose. Hmm... Googling a little, that appears to be an MS-Exchange error http://support.microsoft.com/kb/314917 Looks like you might have problems with your disk hardware (or RAM or motherboard, or drivers...) Run some extensive hardware tests. If you can afford to, just replace the machine. You'll be looking at a couple of days work to be sure you've fixed whatever is causing this. -- Richard Huxton Archonet Ltd ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/ -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.6/536 - Release Date: 16/11/2006 ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/
Re: [GENERAL] Why the data changes it's value by itself!
Does this message in application.log can be the source of problem wuaueng.dll (1204) Synchronous read page checksum error -1018 ((1:801 1:801) (0-13218) (0-14642)) occurred. Please restore the databases from a previous backup. Regards Ardian, - Original Message - From: Richard Huxton dev@archonet.com To: Ardian Xharra [EMAIL PROTECTED] Cc: postgreSQL postgreSQL pgsql-general@postgresql.org Sent: Friday, November 17, 2006 5:44 AM Subject: Re: [GENERAL] Why the data changes it's value by itself! Ardian Xharra wrote: For the column: date(varchar 8) '2000606' the SELECT ascii(substring(date,4,1)) from jnlsale WHERE id_jnlsale=28384 gives: 22 SELECT ascii('6'); gives 54 Hmm - a difference of 32, or a single bit (2^5). For the column: amount(float 8) 1.20932764209866e-307 the SELECT ascii(substring(amount,20,1)) from jnlsale WHERE id_jnlsale=28382 gives: 48 Sorry - this only applies to the text. I'd need to figure out the internal format of the float8 and see what happened. Well, if all the textual differences are single-bit (1,2,4,8,16,32...) I'd suspect hardware. I can't imagine the kind of bug in PostgreSQL that would cause that kind of error. I can imagine a faulty RAM chip or slowly failing hard-disk causing that kind of error though. I'd find a Linux live CD that supports memtest86 (or one of its spin-offs) and leave it testing your RAM for 24 hours or so. -- Richard Huxton Archonet Ltd ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.6/536 - Release Date: 16/11/2006 ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[GENERAL] Why the data changes it's value by itself!
Hello, We been having a problem lately with some data changing their value without modifying them. We used to backups to see the difference: this was the first backup INSERT INTO journal VALUES(28382,698,754,7116,7,0.01,'20060606','15415773',1,3,4,1,1,5,77,1,17,2,1,1,15,1,1,2,0,32252,0,14183,0,0,0,'A1',0,0); INSERT INTO journal VALUES(28383,698,3201,26018,7,21.74,'20060606','15415773',1,3,4,1,1,7,175,1,33,2,1,1,15,1,1,1,0,71451,1,14183,0,0,0,'P1',0,0); INSERT INTO journal VALUES(28384,698,3201,26018,9,1.52,'20060606','15415773',1,3,4,1,1,7,175,1,33,2,1,1,15,1,1,1,0,71451,0,14183,0,0,0,'T11',0,0); INSERT INTO journal VALUES(28385,698,3201,26018,10,1.74,'20060606','15415773',1,3,4,1,1,7,175,1,33,2,1,1,15,1,1,1,0,71451,0,14183,0,0,0,'T12',0,0); and the second backup INSERT INTO jnlsale VALUES(28382,698,754,7116,7,0.01,'2000606','1541577',1,3,4,1,1,5,77,1,17,2,1,1,15,1,1,2,0,32252,0,14183,0,0,0,'A1',0,0); INSERT INTO jnlsale VALUES(28383,698,3201,26018,7,1.20932764209866e-307,'20060606','15415773',1,3,4,1,1,7,175,1,33,2,1,1,15,1,1,1,0,71451,1,14183,0,0,0,'P1',0,0); INSERT INTO jnlsale VALUES(28384,698,3201,26018,9,1.52,'2000606','1541577',1,3,4,1,1,7,175,1,33,2,1,1,15,1,1,1,0,71451,0,14183,0,0,0,'T11',0,0); INSERT INTO jnlsale VALUES(28385,698,3201,26018,10,1.29775128722884e-154,'20060606','15415773',1,3,4,1,1,7,175,1,33,2,1,1,15,1,1,1,0,71451,0,14183,0,0,0,'T12',0,0); The values that change are: '20060606' to '2000606' 21.74 to 1.20932764209866e-307 etc Thanks in advance, Version used PostgreSQl 8.1.1 on Windows box with Windows 2000 server
Re: [GENERAL] Why the data changes it's value by itself!
No, sorry about the name of the table it's the same table. Yes, the change is in live database during a select Regards, Ardian - Original Message - From: Richard Huxton dev@archonet.com To: Ardian Xharra [EMAIL PROTECTED] Cc: postgreSQL postgreSQL pgsql-general@postgresql.org Sent: Thursday, November 16, 2006 12:30 PM Subject: Re: [GENERAL] Why the data changes it's value by itself! Ardian Xharra wrote: Hello, We been having a problem lately with some data changing their value without modifying them. We used to backups to see the difference: this was the first backup INSERT INTO journal VALUES and the second backup INSERT INTO jnlsale VALUES These are different tables. Do you have an example which shows data changing? Does it change in the live database if you select data out? Version used PostgreSQl 8.1.1 on Windows box with Windows 2000 server Upgrade to 8.1.5 as soon as is convenient. -- Richard Huxton Archonet Ltd -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.6/535 - Release Date: 15/11/2006 ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [GENERAL] Why the data changes it's value by itself!
For the column: date(varchar 8) '2000606' the SELECT ascii(substring(date,4,1)) from jnlsale WHERE id_jnlsale=28384 gives: 22 SELECT ascii('6'); gives 54 For the column: amount(float 8) 1.20932764209866e-307 the SELECT ascii(substring(amount,20,1)) from jnlsale WHERE id_jnlsale=28382 gives: 48 regards Ardian - Original Message - From: Richard Huxton dev@archonet.com To: Ardian Xharra [EMAIL PROTECTED] Cc: postgreSQL postgreSQL pgsql-general@postgresql.org Sent: Thursday, November 16, 2006 1:47 PM Subject: Re: [GENERAL] Why the data changes it's value by itself! Ardian Xharra wrote: No, sorry about the name of the table it's the same table. Yes, the change is in live database during a select OK, so it's definitely a data change. Can you get the numeric value of the character in question, and compare it to the original value SELECT ascii(substring(my_column,5,1)) WHERE ...; SELECT ascii('6'); You might want an index other than 5 of course. What I'm wondering is whether this is a single-bit error that has occurred. If it is, I'd suspect hardware problems. -- Richard Huxton Archonet Ltd -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.6/535 - Release Date: 15/11/2006 ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [GENERAL] Data corruption
Yes, the Symantec Antivirus. We are going to modify A/V to not scan the database Thanks for your time - Original Message - From: Shelby Cain [EMAIL PROTECTED] To: Ardian Xharra [EMAIL PROTECTED] Cc: postgreSQL postgreSQL pgsql-general@postgresql.org Sent: Wednesday, November 15, 2006 11:38 AM Subject: Re: [GENERAL] Data corruption Do you have antivirus software installed on the server? I seem to recall A/V software being a common source of permission denied errors when running Postgresql on Windows. Regards, Shelby Cain - Original Message From: Ardian Xharra [EMAIL PROTECTED] To: Jeff Davis [EMAIL PROTECTED] Cc: postgreSQL postgreSQL pgsql-general@postgresql.org Sent: Tuesday, November 14, 2006 1:36:48 PM Subject: Re: [GENERAL] Data corruption I'm running under Windows. PostgreSQL runs through user postgres created during the installation. The filesystem is NTFS Sponsored Link Mortgage rates near 39yr lows. $420k for $1,399/mo. Calculate new payment! www.LowerMyBills.com/lre -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.5/534 - Release Date: 14/11/2006 ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/
[GENERAL] Data corruption
Hi all, We have a database installed on Intel Xeon (Dell) and running on postgreSQL 8.1. And the database couldn't start. Here is the logfile of what happend: 2006-11-14 00:28:38 PANIC: could not write to log file 6, segment 239 at offset 6430720, length 16384: Permission denied 2006-11-14 00:28:38 CONTEXT: writing block 557 of relation 1663/16403/985708 2006-11-14 00:28:38 STATEMENT: VACUUM client abnormal program termination 2006-11-14 00:28:38 LOG: server process (PID 2868) was terminated by signal 3 2006-11-14 00:28:38 LOG: terminating any other active server processes 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 WARNING: terminating connection because of crash of another server process 2006-11-14 00:28:38 DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2006-11-14 00:28:38 HINT: In a moment you should be able to reconnect to the database and repeat your command. 2006-11-14 00:28:38 LOG: all server processes terminated; reinitializing 2006-11-14 00:28:38 LOG: database system was interrupted at 2006-11-14 00:17:21
Re: [GENERAL] Data corruption
- Original Message - From: Jeff Davis [EMAIL PROTECTED] To: Ardian Xharra [EMAIL PROTECTED] Cc: postgreSQL postgreSQL pgsql-general@postgresql.org Sent: Tuesday, November 14, 2006 2:12 PM Subject: Re: [GENERAL] Data corruption On Tue, 2006-11-14 at 13:34 -0500, Ardian Xharra wrote: Hi all, We have a database installed on Intel Xeon (Dell) and running on postgreSQL 8.1. And the database couldn't start. Here is the logfile of what happend: 2006-11-14 00:28:38 PANIC: could not write to log file 6, segment 239 at offset 6430720, length 16384: Permission denied Are you running PostgreSQL as a user other than the one that owns the data directory? Did the filesystem somehow get mounted in RO mode? Regards, Jeff Davis I'm running under Windows. PostgreSQL runs through user postgres created during the installation. The filesystem is NTFS ---(end of broadcast)--- TIP 6: explain analyze is your friend -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.5/533 - Release Date: 13/11/2006 ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [GENERAL] How to trace index to table?
If you look on pg_indexes you find the index and the table. - Original Message - From: Chris Hoover To: pgsql-general@postgresql.org Sent: Monday, October 02, 2006 9:19 AM Subject: [GENERAL] How to trace index to table? I'm trying to build some queries to gather metrics on my PG database. When looking at pg_class and pulling a row that is an index, how do I use sql to pull the table the index belongs to?Thanks,Chris No virus found in this incoming message.Checked by AVG Free Edition.Version: 7.1.407 / Virus Database: 268.12.11/460 - Release Date: 01/10/2006
Re: [GENERAL] Fatal error while installing
Go to Start/ Control Panel / Administrative tools / Computer Management / and you see Local Users and groups Delete the user from there - Original Message - From: Gibson [EMAIL PROTECTED] Cc: pgsql general pgsql-general@postgresql.org Sent: Friday, September 01, 2006 2:31 AM Subject: Re: [GENERAL] Fatal error while installing How do i remove this user?I am running on Win XP here. Joshua D. Drake wrote: Gibson wrote: I seem to get this error user postgres could not be created, user account already exists when trying to install postgres. Anyone knows how to fix this? Sounds to me like the user postgres on the OS already exists. Joshua D. Drake ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.7/434 - Release Date: 30/08/2006 ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
[GENERAL] Creating an index on PostgreSQL 7.4.3
Hello, I have a client who is still using the version 7.4.3 and creating an index like this doesn't work: CREATE INDEX client__ascname__idx ON client (TO_ASCII(lower(name),'LATIN 1')); Does exists another way of creating an indexin varchar whotake on considerationalso the accents Thanks! No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.5/301 - Release Date: 04/04/2006 ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [GENERAL] Creating an index on PostgreSQL 7.4.3
No, it doesn't work always the same message: ERROR: parser: parse error at or near ( at character 47 - Original Message - From: Martijn van Oosterhout kleptog@svana.org To: Ardian Xharra (Boxxo) [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org Sent: Wednesday, April 05, 2006 3:01 PM Subject: Re: [GENERAL] Creating an index on PostgreSQL 7.4.3 On Wed, Apr 05, 2006 at 01:59:46PM -0400, Ardian Xharra (Boxxo) wrote: Hello, I have a client who is still using the version 7.4.3 and creating an index like this doesn't work: CREATE INDEX client__ascname__idx ON client (TO_ASCII(lower(name),'LATIN 1')); Does exists another way of creating an index in varchar who take on consideration also the accents I think expression indexes need another level of parenthesis, so maybe: CREATE INDEX client__ascname__idx ON client ((TO_ASCII(lower(name),'LATIN 1'))); Have a nice day, -- Martijn van Oosterhout kleptog@svana.org http://svana.org/kleptog/ Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for doing 5% of the work and then sitting around waiting for someone else to do the other 95% so you can sue them. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.5/301 - Release Date: 04/04/2006 ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [GENERAL] Creating an index on PostgreSQL 7.4.3
Sorry, the exact version is PostgreSQL 7.3.3 on sparc-sun-solaris2.8, compiled by GCC gcc (GCC) 3.3.2 - Original Message - From: Tom Lane [EMAIL PROTECTED] To: Ardian Xharra (Boxxo) [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org; Martijn van Oosterhout kleptog@svana.org Sent: Wednesday, April 05, 2006 3:14 PM Subject: Re: [GENERAL] Creating an index on PostgreSQL 7.4.3 Ardian Xharra \(Boxxo\) [EMAIL PROTECTED] writes: No, it doesn't work always the same message: ERROR: parser: parse error at or near ( at character 47 In that case you're not really talking to a 7.4 server, but something older --- either syntax works OK for me on 7.4. regression=# create table client(name text); CREATE TABLE regression=# CREATE INDEX client__ascname__idx ON client (TO_ASCII(lower(name),'LATIN 1')); CREATE INDEX regression=# select version(); version PostgreSQL 7.4.12 on hppa-hp-hpux10.20, compiled by GCC 2.95.3 (1 row) regards, tom lane -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.5/301 - Release Date: 04/04/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.5/301 - Release Date: 04/04/2006 ---(end of broadcast)--- TIP 6: explain analyze is your friend
[GENERAL] Creating serial ID on Windows.
I'm having some troubles restoring a database on Windows and I found this difference between PostgreSQL running on Linux and Windows. When I create a table like this: CREATE TABLE fee_payment1(id_fee_payment1 serial NOT NULL) WITH OIDS; On Linux platform it will be: CREATE TABLE fee_payment1 ( id_fee_payment1 serial NOT NULL) WITH OIDS; And on Windows platform is: CREATE TABLE fee_payment1( id_fee_payment1 int4 NOT NULL DEFAULT nextval('fee_payment1_id_fee_payment1_seq'::regclass) ) WITH OIDS; So, I would like to know if this would have an impact throught restoring database. No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.2/293 - Release Date: 26/03/2006 ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [GENERAL] Query in postgreSQL version Windows
Yes it is the version 8.1.1 and the error is ERROR: missing FROM-clause entry for table pg_class I have too many queries like this in my program and I was thinking maybe is the fault of installation like I missed something. Is there anything I can do or it's the wrong way I was doing the queries in SQL - Original Message - From: Michael Fuhr [EMAIL PROTECTED] To: Ardian Xharra (Boxxo) [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org Sent: Monday, January 02, 2006 4:29 PM Subject: Re: [GENERAL] Query in postgreSQL version Windows On Mon, Jan 02, 2006 at 04:01:56PM -0500, Ardian Xharra (Boxxo) wrote: I installed PostgreSQL on windows and when I try to run some queries pgadmin says an error. What version of PostgreSQL? What's the exact error message? That often provides a clue as to what's wrong. I'll guess that the Windows box is running 8.1.x and the error is: ERROR: missing FROM-clause entry for table pg_class I know that if I change the query this it will work but is it possible to make this quey work in this way Why don't you want to rewrite the query? SELECT atthasdef FROM pg_attribute WHERE attrelid=pg_class.oid AND pg_class.relname='client_overtime' AND attname='id_client_overtime' This query works fine in PostgreSQL (Linux-Unix platform) Another guess: the Linux box is running a version of PostgreSQL older than 8.1, or if it's running 8.1 then you've enabled add_missing_from. As the 8.1 Release Notes mention, that option is now disabled by default. Rather than trying to make the query work as-is, rewrite it to be proper SQL by adding pg_class to the FROM clause. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.11/219 - Release Date: 02/01/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.11/219 - Release Date: 02/01/2006 ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [GENERAL] Query in postgreSQL version Windows
Thank you Micheal it was the add_missing_from And sorry for the last post I didn't read the whole message from you. Ardian -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.11/219 - Release Date: 02/01/2006 ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
[GENERAL] Query in postgreSQL version Windows
Hello, there I installed PostgreSQL on windows and when I try to run some query's pgadmin says an error. I know that if I change the query this it will workbut is it possible to make this quey work in this way SELECT atthasdef FROM pg_attribute WHERE attrelid=pg_class.oid AND pg_class.relname='client_overtime' AND attname='id_client_overtime' Thx
[GENERAL] Query in postgreSQL version Windows
Hello, there I installed PostgreSQL on windows and when I try to run some queries pgadmin says an error. I know that if I change the query this it will workbut is it possible to make this quey work in this way SELECT atthasdef FROM pg_attribute WHERE attrelid=pg_class.oid AND pg_class.relname='client_overtime' AND attname='id_client_overtime' This query works fine in PostgreSQL (Linux-Unix platform) Thx No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.10/218 - Release Date: 02/01/2006 ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[GENERAL] Query in postgreSQL version Windows
Hello, there I installed PostgreSQL on windows and when I try to run some queries pgadmin says an error. I know that if I change the query this it will workbut is it possible to make this quey work in this way SELECT atthasdef FROM pg_attribute WHERE attrelid=pg_class.oid AND pg_class.relname='client_overtime' AND attname='id_client_overtime' This query works fine in PostgreSQL (Linux-Unix platform) Thx No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.10/218 - Release Date: 02/01/2006 ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match