Re: [GENERAL] selecting random rows

2003-09-12 Thread Dennis Gearon
If you have a nice small Primary key on the table, you can so something like this: SELECT field_list FROM table WHERE primary_key IN( SELECT primary_key, FROM table ORDER by RANDOM() LIMIT your_limit); This may not be the exact sequence, and there is some workarounds for some slo

Re: [GENERAL] Picture with Postgres and Delphi

2003-09-12 Thread Tom Lane
Network Administrator <[EMAIL PROTECTED]> writes: > Quoting Tom Lane <[EMAIL PROTECTED]>: >> Commonly this means that you open a "handle" or "cursor" referring to >> one particular blob and then read or write it through that handle. > I understand the value of handles but aren't cursors used to br

Re: [GENERAL] selecting random rows

2003-09-12 Thread Bruce Momjian
Joseph Shraibman wrote: > Is there a way to get random rows besides ORDER BY random()? The problem with ORDER > BY > random() is that is has to get all the rows from the table before the results are > returned. Yes, I think one person's idea was to assign a unique value to every row, then do:

[GENERAL] selecting random rows

2003-09-12 Thread Joseph Shraibman
Is there a way to get random rows besides ORDER BY random()? The problem with ORDER BY random() is that is has to get all the rows from the table before the results are returned. ---(end of broadcast)--- TIP 9: the planner will ignore your desire t

Re: [GENERAL] NFS performance tuning

2003-09-12 Thread Bruce Momjian
Joseph Shraibman wrote: > Is it considered safe to run postgres over nfs if the sync option is used? No, because NFS is not atomic in its operations. However, a number of people are running PostgreSQL over NFS to network attached storage devices, and it seems to run fine --- I just am not sure wh

[GENERAL] library version problem, 7.3.2, php, redhat linux

2003-09-12 Thread Richard Welty
ok, i'm confused. i have two systems. one is redhat 7.1 (a server in colo, reasonably current), the other is 8.0 (my laptop). the server in colo is running postgresql 7.3.2 along with redhat's updated versions of apache and php for 7.1 (the php version is 4.1.2) on this server, php can access post

[GENERAL] Converting database-encoding from SQL_ASCII to UNICODE?????

2003-09-12 Thread Amin Schoeib
Title: Converting database-encoding from SQL_ASCII to UNICODE? Hi, I have a database with encoding SQL_ASCII. Now I need to convert the encoding to UNICODE. Can somebody tell me how I can do that Thanxx Schoeib 4Tek Gesellschaft für angewandte Informationstechnologien mbH Sc

Re: [GENERAL] library version problem, 7.3.2, php, redhat linux

2003-09-12 Thread Nigel J. Andrews
On Fri, 12 Sep 2003, Oliver Elphick wrote: > On Fri, 2003-09-12 at 07:21, Nigel J. Andrews wrote: > > On Thu, 11 Sep 2003, Richard Welty wrote: > ... > > > [Thu Sep 11 16:17:25 2003] [notice] caught SIGTERM, shutting down > > > PHP Warning: Unable to load dynamic library '/usr/lib/php4/pgsql.so'

Re: [GENERAL] library version problem, 7.3.2, php, redhat linux

2003-09-12 Thread Nigel J. Andrews
On Thu, 11 Sep 2003, Richard Welty wrote: > ok, i'm confused. > > i have two systems. one is redhat 7.1 (a server in colo, reasonably > current), the other is 8.0 (my laptop). the server in colo is running > postgresql 7.3.2 along with redhat's updated versions of apache and php for > 7.1 (the ph

[GENERAL] plPHP for windows

2003-09-12 Thread Marek Lewczuk
Hi, CommandPrompt team have made PG language based on PHP - plPHP. It is very interesting for people (like me) who work with PHP for years. As I'm windows user I need to have windows DLL library of this language (like plperl.dll). Anybody knows how to compile it on windows ?? More info about this:

[GENERAL] psql prompt

2003-09-12 Thread Claudio Lapidus
Hello The command prompt for psql defaults to the database name, but is there a way to change it to some other string/value? TIA, cl. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] library version problem, 7.3.2, php, redhat linux

2003-09-12 Thread Richard Welty
On Fri, 12 Sep 2003 07:21:19 +0100 (BST) "Nigel J. Andrews" <[EMAIL PROTECTED]> wrote: > On Thu, 11 Sep 2003, Richard Welty wrote: > > > [Thu Sep 11 16:17:25 2003] [notice] caught SIGTERM, shutting down > > PHP Warning: Unable to load dynamic library '/usr/lib/php4/pgsql.so' > > - libpq.so.2: c

Re: [GENERAL] Table OraclexPostgresql

2003-09-12 Thread Richard Huxton
On Friday 12 September 2003 12:41, Jose-Lopes Antunes wrote: > Hi, > > I migrated one table from oracle to postgresql. I used a PgadminII. But > the table allocated, in Oracle, 152MB and in Postgresql , after migration, > the space was 568MB. > Anybody help me? Well, PG's files are named after th

[GENERAL] Between(Interval of two dates) in Postgres

2003-09-12 Thread Amin Schoeib
Title: Between(Interval of two dates) in Postgres Hi, can somebody tell me How I can use the Oracle between function in Postgres? Like this: Select name from test Where date_f between '31.01.2000' And '31.01.2003' Thanxx Schoeib 4Tek Gesellschaft für angewandte Informationstechn

Re: [GENERAL] Between(Interval of two dates) in Postgres

2003-09-12 Thread Pavel Stehule
Hello set DateStyle TO German ; SET testdb011=> select current_date between '31.01.2000' and '31.01.2004'; ?column? -- t regards Pavel On Fri, 12 Sep 2003, Amin Schoeib wrote: > > Hi, > can somebody tell me > How I can use the Oracle between function in Postgres? > Like this: > Sel

Re: [GENERAL] State of Beta 2

2003-09-12 Thread Manfred Koizar
On Thu, 11 Sep 2003 14:24:25 -0700, Sean Chittenden <[EMAIL PROTECTED]> wrote: >Agreed, but if anyone has a table with close to 1600 columns in a >table... This 1600 column limit has nothing to do with block size. It is caused by the fact that a heap tuple header cannot be larger than 255 bytes,

Re: [GENERAL] State of Beta 2

2003-09-12 Thread Tom Lane
Kaare Rasmussen <[EMAIL PROTECTED]> writes: > I believe this has been discussed before, but it does not seem to be a small > or an easy task to implement. Yes, it's been discussed to death, and it isn't easy. See the archives for Lamar Owen's eloquent rants on the subject, and various hackers' f

Re: [GENERAL] State of Beta 2

2003-09-12 Thread Nigel J. Andrews
On Fri, 12 Sep 2003, Ron Johnson wrote: > On Fri, 2003-09-12 at 10:50, Andrew Rawnsley wrote: > > Small soapbox moment here... > > > > ANYTHING that can be done to eliminate having to do an initdb on > > version changes would make a lot of people do cartwheels. 'Do a > > dump/reload' sometimes

Re: [GENERAL] State of Beta 2

2003-09-12 Thread Alvaro Herrera
On Fri, Sep 12, 2003 at 03:48:48PM -0700, Joshua D. Drake wrote: > The initdb is not always a bad thing. In reality the idea of just > being able to "upgrade" is not a good thing. Just think about the > differences between 7.2.3 and 7.3.x... The most annoying (although > appropriate) one being

Upgrading (was Re: [GENERAL] State of Beta 2)

2003-09-12 Thread Ron Johnson
On Fri, 2003-09-12 at 17:01, Kaare Rasmussen wrote: > > He is right, it might be a good idea to head this problem 'off at the > > pass'. I am usually pretty good at predicting technilogical trends. I've > > Well, the only solution I can see is to make an inline conversion tool that > knows about

Re: [GENERAL] State of Beta 2

2003-09-12 Thread Joshua D. Drake
Hello, The initdb is not always a bad thing. In reality the idea of just being able to "upgrade" is not a good thing. Just think about the differences between 7.2.3 and 7.3.x... The most annoying (although appropriate) one being that integers can no longer be ''. If we provide the ability to

Re: [GENERAL] Why do I need to pass value for Serial type in Insert/Update?

2003-09-12 Thread Martin Marques
El Vie 12 Sep 2003 16:22, Duffey, Kevin escribió: > I don't know if jdbc/java code requires this, but when I use two gui admin > tools I found, and I insert a row into the table using their row editor > feature, both require me to enter a number for the Serial type. I thought > this type was used t

Re: [GENERAL] State of Beta 2

2003-09-12 Thread Kaare Rasmussen
> He is right, it might be a good idea to head this problem 'off at the > pass'. I am usually pretty good at predicting technilogical trends. I've Well, the only solution I can see is to make an inline conversion tool that knows about every step from earlier versions. I believe this has been dis

Re: [GENERAL] State of Beta 2

2003-09-12 Thread Dennis Gearon
Ron Johnson wrote: On Fri, 2003-09-12 at 10:50, Andrew Rawnsley wrote: Small soapbox moment here... ANYTHING that can be done to eliminate having to do an initdb on version changes would make a lot of people do cartwheels. 'Do a dump/reload' sometimes comes across a bit casually on the lists

Re: [GENERAL] difference when using 'distinct on'

2003-09-12 Thread Stephan Szabo
On Fri, 12 Sep 2003, Johnson, Shaunn wrote: > Howdy: > > Can someone tell what the difference (and why > you would use it) is between the following: > > [snip] > select distinct on (col_1, col_2), > col_1, > col_2, > col_3 > from t_table > > -- > > select distinct > col_1, > col_2, > col_3 > from