[SQL] Customised Encoding

2004-04-27 Thread kumar
Dear Friends,   Postgres 7.3.2 Runing on Linux 7.2   I would like to convert any values in between 1 to 2^16 into a single charactor. And decode that single char to get back the numeric value again. Any function to do that in Postgres SQL Server.   Please shed some light.   Thanks Kumar

[SQL] Postgres as backend to Backup System

2004-04-27 Thread Kent L. Nasveschuk
Hello, I don't know if this is the forum for this but here goes. I am interested in using Postgres as the backend to a backup system. Does anyone have any experiences or ideas on this? I want to use Postgres to store information about files, directories, archives etc written to tape. This is the t

[SQL] Performance issue

2004-04-27 Thread Michael L. Hostbaek
Howdy, I am expiriencing some performance issues, on a table in my postgres db. I cron script is being run every night (while very low db activity), that deletes all rows from the table, and injects a bunch of new data... Every day between 60.000 and 100.000 rows. Info: ppdb=> select version();

Re: [SQL] Logical comparison on Strings

2004-04-27 Thread Rajesh Kumar Mallah
kumar wrote: Dear Friends, Postgres 7.3.2 on Linux 7. I want to compare to columns and get the logical result as follows. C1 is 'YNYNY' . C2 is 'NNYYY'. I want to compare like AND and OR operators. C1 AND C2 should give result like NNYNY. C1 OR C2 should give result like YNYYY. Bit Strin

Re: [SQL] Performance issue

2004-04-27 Thread Paul Thomas
On 27/04/2004 10:12 Michael L. Hostbaek wrote: [snip] Is this normal ? If I run the same select on another table in the same database with ~40.000 rows, it takes approx 820.00ms... You would probably get better answers on the correct list but my guess is that your fsm setting might be too low for

Re: [SQL] Customised Encoding

2004-04-27 Thread Richard Huxton
On Tuesday 27 April 2004 07:54, kumar wrote: > Dear Friends, > > Postgres 7.3.2 Runing on Linux 7.2 > > I would like to convert any values in between 1 to 2^16 into a single > charactor. And decode that single char to get back the numeric value again. > Any function to do that in Postgres SQL Serve

[SQL] How to get binary value for an Integer

2004-04-27 Thread kumar
Dear Friends,    I am using postgres 7.3.2. I wanna get the binary value of number 65536. Is there anyway to get that postgres functions.   Thanks kumar  

Re: [SQL] Proper SQL syntax requested

2004-04-27 Thread Richard Huxton
On Thursday 22 April 2004 00:41, Blake wrote: > > Select * from floors Where system = 1 ORDER by make > > This sorts by the Serial ID's in column make > > I would like to be able to sort by the actual Names associated back > from the ID's. Anyway of doing this?? You don't say which table contains

Re: [SQL] How to get binary value for an Integer

2004-04-27 Thread Achilleus Mantzios
O kyrios kumar egrapse stis Apr 27, 2004 : > Dear Friends, > > I am using postgres 7.3.2. I wanna get the binary value of number 65536. Is there > anyway to get that postgres functions. SELECT 65536::bit(32); (assuming you have in mind a 32 bit arch). > > Thanks > kumar > -- -Achilleus

Re: [SQL] Customised Encoding

2004-04-27 Thread Richard Huxton
On Tuesday 27 April 2004 13:55, kumar wrote: > Hi Richar, Kumar - try to make sure you reply to the list. > It didnt work for me. > > select encode('65536'::bytea,'UTF-8') > ERROR: Cannot cast type integer to bytea > > select encode('65536'::bytea,'UTF-8') > ERROR: No such encoding as 'UTF-8'

Re: [SQL] Postgres as backend to Backup System

2004-04-27 Thread Kent L. Nasveschuk
Hello, I use mtx and mt commands to load and unload tapes from the autoloader and the drive unit. The system has evolved and is fairly elaborate. This is an automated cron job that rotates through the magazine, writing to tape sending me the log files that describes what archives, files and direct

Re: [SQL] Postgres as backend to Backup System

2004-04-27 Thread Kent L. Nasveschuk
Michael, Thanks for responding. On Tue, 2004-04-27 at 10:38, Michael Satterwhite wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Tuesday 27 April 2004 03:39, Kent L. Nasveschuk wrote: > > Hello, > > I don't know if this is the forum for this but here goes. > > > > I am interested

[SQL] SELECTing part of a matrix

2004-04-27 Thread Tony Reina
I've got a 3D matrix stored in a table. I'd like to pull back just 2 of the dimensions (specifying a constant value for the 3rd dimension). e.g. table1 == matrix1[5][10][20] I've like to get matrix[1][all][all] and have it pulled back as a 2D matrix (new_matrix1[all][all]). Any way to do th

[SQL] date arithmetic over calender year boundaries

2004-04-27 Thread Ray Jackson
Hi, The following Postgres 7.1 query extracts aggregated data for an arbitrary period within each year for sites in a table containing 30 years of temperature data. topo=> \d longterm Table "longterm" Attribute | Type | Modifier ---+--+-- site

Re: [SQL] Which SQL command creates ExclusiveLock?

2004-04-27 Thread Tom Lane
"Denis Khabas" <[EMAIL PROTECTED]> writes: > According to postgres documentation, all update operations place ROW EXCLUS= > IVE MODE locks, and=20 > EXCLUSIVE MODE is not automatically acquired by any postgres SQL command. S= > o, which command places > ExclusiveLock? It says that no SQL command a

Re: [SQL] Customised Encoding

2004-04-27 Thread kumar
The idea is I wanna store any number from 1 to 2^16 in 2 strings only - This is the requirement. Since in Unicode a 16 bit is represented in a Single chararctor. So i wanna convert any number into a 32 bit and then convert each 16 bit into one char and stored it in database. So I wanna know how t

[SQL] query optimizer dont treat correctly OR

2004-04-27 Thread Luiz Rafael Culik Guimaraes
Hello folks See the command bellow. I use some thing simmilar about an decade on Oracle, Sybase, MSSQL, DB2, etc. But with Postgresql , he generate an FULL TABLE SCAN, and consequenyly it take about 10 minutes to run (Very big table..)

Re: [SQL] query optimizer dont treat correctly OR

2004-04-27 Thread Richard Huxton
On Tuesday 27 April 2004 15:48, Luiz Rafael Culik Guimaraes wrote: > Hello folks > > See the command bellow. I use some thing simmilar about an decade on > Oracle, > Sybase, MSSQL, DB2, etc. But with Postgresql , he generate an FULL TABLE > SCAN, > and consequenyly it take about 10 minutes to run