[GENERAL] PostGreSQL and LiveWire??
On a Unix (Solaris 2.6 + Netscapte enterprise) i have to interconnect a database and an internet site. I would like to know if i can use LiveWire (netscape solution) to work with PostGreSQL. Particularely, i have to secure an access by using a user profile saved in a database. So if you have example which use PostGreSQL, it'ld be great. Thanks a lot - Fabien FERDINANDY [EMAIL PROTECTED] France -
Re: [GENERAL] Restore from dump file: parse error
Hi, To get the database creation you must use the -s option with pg_dump. (Dump out only the schema, no data) The parse error is probably due to a single quote somewhere in you text data... I use : pg_dump -D mydatabase > recover.sql
Re: [GENERAL] int8-datatype: possible bug
Hello José Soares, thank you. I tried your testcase and all input was changed in the magical value. The 'NOTICE' disappeared when I quoted the value, but the result was all the same. edahrecepten=> create table test(i8 int8); CREATE edahrecepten=> insert into test values(19980528112607 ); NOTICE: Integer input '19980528112607' is out of range; promoted to float INSERT 147055 1 edahrecepten=> select * from test; i8 --- 9223091440198811892 (1 row) edahrecepten=> insert into test values('19980528112607' ); INSERT 147056 1 edahrecepten=> select * from test; i8 --- 9223091440198811892 9223091440198811892 (2 rows) edahrecepten=> insert into test values('19980528112607'::int8); INSERT 147057 1 edahrecepten=> select * from test; i8 --- 9223091440198811892 9223091440198811892 9223091440198811892 (3 rows) edahrecepten=> select version(); version PostgreSQL 6.4.2 on mips-sgi-irix6.2, compiled by cc (1 row) So for the time being I use float8... Jelle. >Jelle Ruttenberg ha scritto: > >> Hello all, >> >> when I try to put a numeric 'timestamp' like 19980528112607 into an >> int8-datatype I get the notice 'NOTICE: Integer input '19980528112607' >> is out of range; promoted to float' and the value is put in the database >> as 9223091508918288644. >> It doesn't matter if I change the value: it will allways be the magical >> value 9223091508918288644. >> >> When I use the float8-datatype it all goes well. >> >> Is this a bug in PostgreSQL or has it something to do with >> platform-specific limitations? >> >> Thanks, >> >> Jelle. >> >> PostgreSQL: 6.4.2 >> Platform: SGI IRIX 6.2. IP22 >> >> -- >>NEROC Publishing Solutions >> >> Jelle Ruttenberg >> >> De Run 1131, 5503 LB VeldhovenPhone : +31-(0)40-2586641 >> P.O.Box 133, 5500 AC VeldhovenFax: +31-(0)40-2541893 >> The Netherlands E-mail : [EMAIL PROTECTED] >> -- > >Let me try on v6.5beta1... > >prova=> create table test(i8 int8); >CREATE >prova=> insert into test values(19980528112607 ); >NOTICE: Integer input '19980528112607' is out of range; promoted to float >INSERT 145481 1 >prova=> insert into test values('19980528112607' ); >INSERT 145482 1 >prova=> insert into test values('19980528112607'::int8); >INSERT 145483 1 >prova=> select * from test; >i8 >-- >19980528112607 >19980528112607 >19980528112607 >(3 rows) > > >Seems that works fine. And now trying bounds... > >prova=> insert into test values(-9223372036854775808); >NOTICE: Integer input '9223372036854775808' is out of range; promoted to >float >ERROR: Floating point conversion to int64 is out of range >prova=> insert into test values('-9223372036854775808'); >INSERT 145486 1 >prova=> insert into test values(9223372036854775807); >NOTICE: Integer input '9223372036854775807' is out of range; promoted to >float >ERROR: Floating point conversion to int64 is out of range >prova=> insert into test values('9223372036854775807'); >INSERT 145487 1 >prova=> select * from test; > i8 > > 19980528112607 > 19980528112607 > 19980528112607 >-9223372036854775808 > 9223372036854775807 >(5 rows) > > >It works if the data is enclosed with ''. :) > >prova=> select version(); >version >--- >PostgreSQL 6.5.0 on i586-pc-linux-gnulibc1, compiled by gcc 2.7.2.1 >(1 row) > >Jose' > > -- NEROC Publishing Solutions Jelle Ruttenberg De Run 1131, 5503 LB VeldhovenPhone : +31-(0)40-2586641 P.O.Box 133, 5500 AC VeldhovenFax: +31-(0)40-2541893 The Netherlands E-mail : [EMAIL PROTECTED] --
Re: [GENERAL] int8-datatype: possible bug
Jelle Ruttenberg ha scritto: Hello all, when I try to put a numeric 'timestamp' like 19980528112607 into an int8-datatype I get the notice 'NOTICE: Integer input '19980528112607' is out of range; promoted to float' and the value is put in the database as 9223091508918288644. It doesn't matter if I change the value: it will allways be the magical value 9223091508918288644. When I use the float8-datatype it all goes well. Is this a bug in PostgreSQL or has it something to do with platform-specific limitations? Thanks, Jelle. PostgreSQL: 6.4.2 Platform: SGI IRIX 6.2. IP22 -- NEROC Publishing Solutions Jelle Ruttenberg De Run 1131, 5503 LB Veldhoven Phone : +31-(0)40-2586641 P.O.Box 133, 5500 AC Veldhoven Fax : +31-(0)40-2541893 The Netherlands E-mail : [EMAIL PROTECTED] -- Let me try on v6.5beta1... prova=> create table test(i8 int8); CREATE prova=> insert into test values(19980528112607 ); NOTICE: Integer input '19980528112607' is out of range; promoted to float INSERT 145481 1 prova=> insert into test values('19980528112607' ); INSERT 145482 1 prova=> insert into test values('19980528112607'::int8); INSERT 145483 1 prova=> select * from test; i8 -- 19980528112607 19980528112607 19980528112607 (3 rows) Seems that works fine. And now trying bounds... prova=> insert into test values(-9223372036854775808); NOTICE: Integer input '9223372036854775808' is out of range; promoted to float ERROR: Floating point conversion to int64 is out of range prova=> insert into test values('-9223372036854775808'); INSERT 145486 1 prova=> insert into test values(9223372036854775807); NOTICE: Integer input '9223372036854775807' is out of range; promoted to float ERROR: Floating point conversion to int64 is out of range prova=> insert into test values('9223372036854775807'); INSERT 145487 1 prova=> select * from test; i8 19980528112607 19980528112607 19980528112607 -9223372036854775808 9223372036854775807 (5 rows) It works if the data is enclosed with ''. :) prova=> select version(); version --- PostgreSQL 6.5.0 on i586-pc-linux-gnulibc1, compiled by gcc 2.7.2.1 (1 row) Jose'
Re: [GENERAL] int8-datatype: possible bug
Seems that your platform has problems with int8. Here the begining of ../contrib/int8/README from Thomas G. Lockhart. Try to ask him :) --- Thomas G. Lockhart <[EMAIL PROTECTED]> This is a first attempt at 64-bit integer arithmetic for Postgres. The code should support any 64-bit architecture and any 32-bit machine using a recent GNU C compiler. At the moment, DEC-Alpha and Linux/gcc are explicitly supported. The code uses "long long int" support in GNU C on 32-bit machines. This type is an extension to ANSI-C, and may not appear on any other compiler. The modules are built and installed as user-defined types, so destination directories are pointing away from the standard Postgres areas. Other compilers and architectures should be supportable, so please let me know what changes were required to run on your machine, and I will fold those into this standard distribution. -- Jelle Ruttenberg ha scritto: > Hello José Soares, > > thank you. I tried your testcase and all input was changed in the magical > value. The 'NOTICE' disappeared when I quoted the value, but the result > was all the same. > > edahrecepten=> create table test(i8 int8); > CREATE > edahrecepten=> insert into test values(19980528112607 ); > NOTICE: Integer input '19980528112607' is out of range; promoted to float > INSERT 147055 1 > edahrecepten=> select * from test; > i8 > --- > 9223091440198811892 > (1 row) > > edahrecepten=> insert into test values('19980528112607' ); > INSERT 147056 1 > edahrecepten=> select * from test; > i8 > --- > 9223091440198811892 > 9223091440198811892 > (2 rows) > > edahrecepten=> insert into test values('19980528112607'::int8); > INSERT 147057 1 > edahrecepten=> select * from test; > i8 > --- > 9223091440198811892 > 9223091440198811892 > 9223091440198811892 > (3 rows) > > edahrecepten=> select version(); > version > > PostgreSQL 6.4.2 on mips-sgi-irix6.2, compiled by cc > (1 row) > > So for the time being I use float8... > > Jelle. > > >Jelle Ruttenberg ha scritto: > > > >> Hello all, > >> > >> when I try to put a numeric 'timestamp' like 19980528112607 into an > >> int8-datatype I get the notice 'NOTICE: Integer input '19980528112607' > >> is out of range; promoted to float' and the value is put in the database > >> as 9223091508918288644. > >> It doesn't matter if I change the value: it will allways be the magical > >> value 9223091508918288644. > >> > >> When I use the float8-datatype it all goes well. > >> > >> Is this a bug in PostgreSQL or has it something to do with > >> platform-specific limitations? > >> > >> Thanks, > >> > >> Jelle. > >> > >> PostgreSQL: 6.4.2 > >> Platform: SGI IRIX 6.2. IP22 > >> > >> -- > >>NEROC Publishing Solutions > >> > >> Jelle Ruttenberg > >> > >> De Run 1131, 5503 LB VeldhovenPhone : +31-(0)40-2586641 > >> P.O.Box 133, 5500 AC VeldhovenFax: +31-(0)40-2541893 > >> The Netherlands E-mail : [EMAIL PROTECTED] > >> -- > > > >Let me try on v6.5beta1... > > > >prova=> create table test(i8 int8); > >CREATE > >prova=> insert into test values(19980528112607 ); > >NOTICE: Integer input '19980528112607' is out of range; promoted to float > >INSERT 145481 1 > >prova=> insert into test values('19980528112607' ); > >INSERT 145482 1 > >prova=> insert into test values('19980528112607'::int8); > >INSERT 145483 1 > >prova=> select * from test; > >i8 > >-- > >19980528112607 > >19980528112607 > >19980528112607 > >(3 rows) > > > > > >Seems that works fine. And now trying bounds... > > > >prova=> insert into test values(-9223372036854775808); > >NOTICE: Integer input '9223372036854775808' is out of range; promoted to > >float > >ERROR: Floating point conversion to int64 is out of range > >prova=> insert into test values('-9223372036854775808'); > >INSERT 145486 1 > >prova=> insert into test values(9223372036854775807); > >NOTICE: Integer input '9223372036854775807' is out of range; promoted to > >float > >ERROR: Floating point conversion to int64 is out of range > >prova=> insert into test values('9223372036854775807'); > >INSERT 145487 1 > >prova=> select * from test; > > i8 > > > > 19980528112607 > > 19980528112607 > > 19980528112607 > >-9223372036854775808 > > 9223372036854775807 > >(5 rows) > > > > > >It works if the data is enclosed with ''. :) > > > >prova=> select version(); > >version > >--- > >PostgreSQL 6.5.0 on i586-pc-linux-gnulibc1, compiled by gcc 2.
[GENERAL] Selecting from arrays
Sorry if this has been answered before but a dejanews search turned up nothing relevant. I'm trying to select from a table which has a couple of array columns, and I want to constrain the select on those columns, i.e. something like (pseudo-code) select date,loc from results where value appears in temperature results table: dateloc temperature (int4[]) 12/01/98 4th & Main {12, 14, 14, 15, 17, 19, 25, ...} 12/04/98 Station 4{12, 13, 14, 666, 18, 20, 24, ...} I want to select only those rows where one of the recorded temps is equal to , say, 17 , and also to select a range (rows where temp > 20, or where temp < 10). I might also want to select rows where the temp could not be measured (indicated by 666) at a certain period. I can do it if I step through each of the temperature values and compare each one, but this seems needlessly inefficient. Is there a quick way to retrieve these rows? Simon. -- Caveat lector Simon Drabble Somewhere in cyberspace [EMAIL PROTECTED]
Re: [GENERAL] Trying using Postgresql on FreeBSD
With FreeBSD, you should really use the port; it saves you much grief. I recommend it! cd /usr/ports/databases/postgresql && make install (with a fresh ports tree, which you get with "cvsup /usr/share/examples/cvsup/ports-supfile"). Regards, Palle "Allan C. Lemos" wrote: > > Hi, > I'm running FreeBSD 2.8 and I downloaded and installed PostgreSQL 6.4. I > can start postmaster (-i), but when I try to run createdb, to create a > database, I get a output saying: > Connection to database 'template1' failed. > pqReadData() --backend closed the channel unexpectedly. > This probably means the backend terminated abnormally before or while > processing the request. > createdb: database creation failed on userxx > > --- > Allan Cardech de Lemos e-mail: [EMAIL PROTECTED] > Univ. Federal Rural do Rio de Janeiro http://www.ufrrj.br > Coordenadoria de Informatica Phone (+55) (21) 6821349 > Rodovia Br. 465 Km 7 - Seropedica Fax (+55) (21) 6821070 > CEP 23890-000 > ---