Re: [SQL] Increment a sequence by more than one

2007-08-03 Thread Scott Marlowe
On 8/3/07, Steve Midgley [EMAIL PROTECTED] wrote: Hi, I'm writing an import app in a third party language. It's going to use copy to to move data from STDIN to a postgres (8.2) table. There are some complexities though: it's going to copy the records to a versioned table first, and then

Re: [SQL] Increment a sequence by more than one

2007-08-03 Thread Scott Marlowe
On 8/3/07, Steve Midgley [EMAIL PROTECTED] wrote: Hi Scott, Thanks for this info (and Michael too!). Let me see if I understand your suggestion. I would run these three commands in sequence: # select nextval('[my_seq_name]'); returns = 52 [I believe that the sequence is at 52] # alter

Re: [SQL] Increment a sequence by more than one

2007-08-03 Thread Scott Marlowe
Oh, another point. You should run the alter sequence m increment 5000; select nextval('m'); alter sequence m increment 1; one right after the other to reduce the number of 5000 wide holes in your sequence. Or, given the size of bigint, you could just set the increment to 5000 and leave it

Re: [SQL] How do I connect postgres table structures and view structures to an existing svn repository?

2007-08-01 Thread Scott Marlowe
On 8/1/07, John Mitchell [EMAIL PROTECTED] wrote: I am trying to store schema definitions in version-control which I can do by saving the definition and then importing into svn, but I would like it to be automatic , so that when an update occurs to a table or view within postgres then that

Re: [SQL] Authentification failed

2007-08-01 Thread Scott Marlowe
On 8/1/07, Judith [EMAIL PROTECTED] wrote: Hello everybody!! I'm trying in SUSE to connect to a postgres db and this is the error: Ident Authentification failed for user root I'm already created the user with createuser root, but the error persist, I would aprecciate some help,

Re: [SQL] Connection Limit

2007-07-30 Thread Scott Marlowe
On 7/30/07, Jon Horsman [EMAIL PROTECTED] wrote: Hello, I have a server running postgres 7.4.13 and am starting to see errors FATAL: connection limit exceeded for non-superusers. I'm not sure which one of my applications are hogging all of the connections, is there a way debug this

Re: [SQL] Informix Schema - PostgreSQL ?

2007-07-03 Thread Scott Marlowe
Mark Fenbers wrote: I am an ex-Informix convert. Informix used the term schema to refer to the SQL-format definition of how a table or view was created. E.g., CREATE TABLE john ( char(8) lid, ...); Some views we have are quite complex (and not created by me) and I want to create a similar

Re: [SQL] subtract a day from the NOW function

2007-06-07 Thread Scott Marlowe
Campbell, Lance wrote: Michael, So based on your feedback would it be better to do option A or B below? 1) I have a timestamp field, some_timestamp, in table some_table. 2) I want to compare field some_timestamp to the current date - 1 day. I need to ignore hours, minutes and seconds. You

Re: [SQL] query to select a linked list

2007-05-09 Thread Scott Marlowe
On Wed, 2007-05-09 at 08:24, Gregory Stark wrote: Louis-David Mitterrand [EMAIL PROTECTED] writes: Each message a unique id_forum and an id_parent pointing to the replied post (empty if first post). How can I build an elegant query to select all messages in a thread? You would need

Re: [SQL] query to select a linked list

2007-05-09 Thread Scott Marlowe
On Wed, 2007-05-09 at 08:29, Aaron Bono wrote: On 5/9/07, Louis-David Mitterrand [EMAIL PROTECTED] wrote: Hi, To build a threaded forum application I came up the following schema: forum -- id_forum | integer| not null

Re: [SQL] Retrieve month from date

2007-04-20 Thread Scott Marlowe
On Fri, 2007-04-20 at 12:30, RPK wrote: What this query will return: Select Extract(Month from 4/20/2007) from dual; I suspect dual is not for PGSQL but Oracle. But I need to run the above query. What is the replacement of dual in PGSQL. Well, you're going to have to create a special

Re: [SQL] Question on interval

2007-04-20 Thread Scott Marlowe
On Fri, 2007-04-20 at 13:53, Wei Weng wrote: Hi all. How do I write a query that converts an interger to the interval type? Like convert integer 10 to INTERVAL '10 seconds'? The integer is a column in a table though, so it is more like convert integer tbl.theInteger to INTERVAL

Re: [SQL] Generating dates prior to generate_series

2007-04-05 Thread Scott Marlowe
On Wed, 2007-04-04 at 07:00, Roger Tannous wrote: I'm using PostgreSQL version 7.3.2, and generate_series() is not available, so this is a function to generate a series dates. The function goes backwards if the second argument is less than the first one. Check the two select statements at

Re: [SQL] Serial

2007-04-03 Thread Scott Marlowe
On Tue, 2007-04-03 at 04:20, Shavonne Marietta Wijesinghe wrote: Ok so i'm posting alot in the forums. Anyway for a change i have another problem ^___^ I have a table that has a field n_gen serial NOT NULL ermm let me explain. I have 5 records inserted (n_gen = 1, 2, 3, 4, 5) At a

Re: [SQL] Sequence vs Serial

2007-04-01 Thread Scott Marlowe
Daniel CAUNE [EMAIL PROTECTED] Said: I was wondering when it is better to choose sequence, and when it is better to use serial. The serial type is a sequence with default parameters (http://www.postgresql.org/docs/8.2/static/datatype-numeric.html#DATATYPE-SERIAL). Actually, I never use

Re: [SQL] Alter Table

2007-03-15 Thread Scott Marlowe
On Thu, 2007-03-15 at 08:35, Shavonne Marietta Wijesinghe wrote: When i alter a table and add a new column it always adds it to the end of the table. Is there any way to tell it to add the new column at the 5th position or to add the new column after a surtain column. No, but the good news is

Re: [SQL] postgres configuration

2007-03-13 Thread Scott Marlowe
On Tue, 2007-03-13 at 15:48, Sumeet wrote: On 3/13/07, Andrej Ricnik-Bay [EMAIL PROTECTED] wrote: On 3/14/07, Sumeet [EMAIL PROTECTED] wrote: Hi All, Hi, Sorry if this is the wrong list to ask this question. General woould have been better

Re: [SQL] index not being used. Why?

2007-03-09 Thread Scott Marlowe
On Fri, 2007-03-09 at 09:01, Gerardo Herzig wrote: Hi all. I have this 2 relations SNIP Index Cond: ((upper((word)::text) ~=~ 'TEST'::character varying) AND (upper((word)::text) ~~'TESU'::character varying)) - Hash (cost=9.08..9.08 rows=408 width=55) - Seq

Re: [SQL] system tables inquiry db Link inquiry

2007-02-28 Thread Scott Marlowe
On Wed, 2007-02-28 at 12:19, Karthikeyan Sundaram wrote: Hi, We are using Postgres 8.1.0 Stop. Do not pass go, do not collect $200. Update your postgresql installation now to 8.1.8. There were a lot of bugs fixed between 8.1.0 and 8.1.8. After that... Question No 1: =

Re: [SQL] Change Default Database

2007-02-26 Thread Scott Marlowe
On Mon, 2007-02-26 at 10:52, Rommel the iCeMAn wrote: Hi list, I wrote a database creation script that begins with commands to drop the existing database (if it exists) and create it from scratch. These commands execute fine, the problem is that all subsequent commands are executed on the

Re: [SQL] Change Default Database

2007-02-26 Thread Scott Marlowe
On Mon, 2007-02-26 at 14:52, Rommel the iCeMAn wrote: Hi again, Apologies for the HTML. This is an SQL script, it was generated by doing a schema-only database dump using pgAdminIII (which in turn uses pgdump I believe). I've attached the entire script. I was attempting to run this

Re: [SQL] Change Default Database

2007-02-26 Thread Scott Marlowe
On Mon, 2007-02-26 at 16:02, Rommel the iCeMAn wrote: I seem to be blundering a lot today! I thought I was replying to the entire list, didn't realize I replied to one person :-) Nothing was wrong with my script, I assumed that since it was generated by pgAdmin that I could run it inside

Re: [SQL] how do I to generate a sequence Range or Set of integer constants

2007-02-23 Thread Scott Marlowe
On Fri, 2007-02-23 at 12:25, Stefan Becker wrote: dear SQL friends, What I want to do might be done differantly. Right now I can't think of another solution other than a select statement I would like to create a sequence range of integer constants. Join this sequence against a ID Range

Re: [SQL] cartesian product

2007-02-19 Thread Scott Marlowe
On Mon, 2007-02-19 at 10:58, Salman Tahir wrote: Hi, I have a query regarding an SQL statement I'm trying to execute. I have the following table: sequence -+ AK AKCMK CMKA I execute the following statement (Cartesian product): SELECT p1.sequence as sequence1,

Re: [SQL] cartesian product

2007-02-19 Thread Scott Marlowe
On Mon, 2007-02-19 at 10:58, Salman Tahir wrote: Hi, I have a query regarding an SQL statement I'm trying to execute. I have the following table: sequence -+ AK AKCMK CMKA I execute the following statement (Cartesian product): SELECT p1.sequence as sequence1,

Re: [SQL] [ADMIN] Deadlock on transaction

2007-02-12 Thread Scott Marlowe
On Mon, 2007-02-12 at 12:08, Ezequias Rodrigues da Rocha wrote: I mean really deadlock. Other transactions can't access the database until the main transaction is complete. A question: PostgreSQL doesn't permit multiple transactions concurrently ? Again, that's not a deadlock. A deadlock

Re: [SQL] Droping indexes

2007-01-16 Thread Scott Marlowe
On Tue, 2007-01-16 at 07:51, Mario Behring wrote: Hi all, Please, if I drop all indexes from a table, can I recreate them after performing a vacuum full at this table? I mean, I do not know details about the indexes, so what I am asking is if I issue a REINDEX on this table, will it create

Re: [SQL] deleting records from a table

2007-01-12 Thread Scott Marlowe
On Fri, 2007-01-12 at 11:45, Mario Behring wrote: Hi all, Simple question: once I execute the delete statement, does it free disk space immediatelly? Does Postgres uses something like a datafile with a pre-defined size like Oracle does?? Take a look here:

Re: [SQL] Nested select

2006-11-07 Thread Scott Marlowe
On Mon, 2006-11-06 at 05:08, Hubert Retif wrote: Hi, I am migrating my application from MySQL to Postgresql and have met following situation: SELECT (sum(sold_price)/(select sum(sold_price) from car_archive))*100 as CA_pcent, reason_text FROM car_archive group by reason_text

Re: [SQL] fetching unique pins in a high-transaction environment...

2006-11-06 Thread Scott Marlowe
On Sun, 2006-10-29 at 10:36, Bobus wrote: Hi, I posted this question to the general forum, but then discovered this one which I think is more appropriate. Apologies for the cross-post. We are in the process of porting an application from SQL Server to PostgresQL. We have a table which

Re: [SQL] Database recovery in postgres 7.2.4.

2006-11-06 Thread Scott Marlowe
On Mon, 2006-10-30 at 04:25, Santosh wrote: Hi All. My setup is as follows: OS: Sun Solaris 5.8. Postgres: 7.2.4 Just so you know, 7.2 is ancient. You should, at a minimum be running the latest 7.2 release, 7.2.8. You should really look into upgrading to a later version as soon as

Re: [SQL] fetching unique pins in a high-transaction environment...

2006-11-06 Thread Scott Marlowe
On Mon, 2006-11-06 at 14:04, Richard Broersma Jr wrote: Best practice, to me, is to do a couple things. One, create a sequence and set it to the first available pin number. Let's say you have pins available from the number 1 to . Create a default sequence, it'll start on 1. Then,

Re: [SQL] How to query information schema from shell script

2006-10-27 Thread Scott Marlowe
On Fri, 2006-10-27 at 10:12, Jon Horsman wrote: In my original email i forgot to mentioned i need to know if the database exists or not from the shell script. If it doesn't exist i would then create it. Currently i was just creating the db everytime our db script is run (since it doesn't

Re: [SQL] i have table

2006-10-04 Thread Scott Marlowe
On Wed, 2006-10-04 at 13:02, Aaron Bono wrote: On 10/4/06, Daryl Richter [EMAIL PROTECTED] wrote: On 10/4/06 12:20 PM, Aaron Bono [EMAIL PROTECTED] wrote: So do it as needed and convert your application slowly. I just name my views as

Re: [SQL] Group by minute

2006-09-22 Thread Scott Marlowe
On Fri, 2006-09-22 at 10:52 -0300, Ezequias Rodrigues da Rocha wrote: Hil list, I have a query but my IDE (Delphi) does not accept to_char capability. Is there a way to reproduce the same query without using to_char function ? Here is my query: SELECT to_char(quando,'dd/MM/

Re: [SQL] help with pagila

2006-09-01 Thread Scott Marlowe
On Fri, 2006-09-01 at 12:26, Walter Cruz wrote: So I can assume that the MySQL implementation is strange? (It accepts that kind of query) Yes, according to the SQL spec, you should generally get an error when you run a query like this: select field1, field2 from table group by field1 since

Re: RES: [SQL] Lock Problem

2006-08-24 Thread Scott Marlowe
On Thu, 2006-08-24 at 16:12, André José Guergolet wrote: Sorry, I have a table with 360 rows, in this table I control the state of machines on network: IpState StateDate 172.20.0.39 Running 2006-08-23 00:00:00 172.20.0.59 Running

Re: [SQL] SQL92 compliance

2006-08-23 Thread Scott Marlowe
On Wed, 2006-08-23 at 12:40, Tom Lane wrote: Peter Eisentraut [EMAIL PROTECTED] writes: Am Mittwoch, 23. August 2006 03:40 schrieb Daniel CAUNE: Is AS in SELECT my_column AS my_name FROM my_table mandatory to be SQL92 compliant? No. I have a patch at

Re: [SQL] Query response time

2006-08-15 Thread Scott Marlowe
On Fri, 2006-08-11 at 08:58, Jonathan Sinclair wrote: Hi all. Thanks for your help so far. However after configuring my system I am still getting major lag times with a couple of queries. The first, which suffers from the '538/539'(see old email included below) bug, is caused by running the

Re: [SQL] Breaking up a query

2006-08-15 Thread Scott Marlowe
On Thu, 2006-08-10 at 17:53, Saad Anis wrote: Hi Guys, A fellow at work has written the SQL below to retrieve some data from multiple tables. Obviously it is inefficient and unnecessarily complex, and I am trying to break it into 2 or more queries so as to enhance performance. Nope, that's

Re: [SQL] viewing the description of tables from python DB-API

2006-08-02 Thread Scott Marlowe
On Tue, 2006-08-01 at 18:14, Rodrigo De Leon wrote: On 8/1/06, Daniel Joo [EMAIL PROTECTED] wrote: Hi all, Is there a way to view the list of all tables from python (or any other languages for that matter) DB-API? What I'm looking for is a command similar to the meta-command '\d'

Re: [SQL] primary keys as TEXT

2006-07-28 Thread Scott Marlowe
On Fri, 2006-07-28 at 03:37, Manlio Perillo wrote: Hi. There can be performancs problems in having primary keys of type TEXT? What about having a primary key of 3 columns (all of type TEXT)? The biggest problem with using text as a primary key or foreign key is that text types are locale

Re: [SQL] Disk is full, what's cool to get rid of?

2006-07-27 Thread Scott Marlowe
I can't tell you the number of times that little trick has saved my life. On Thu, 2006-07-27 at 11:32, Jeff Frost wrote: You can probably just tune2fs -m 0 device name to give yourself enough space to get out of the jam before you go deleting things. Then you might want to vacuum full

Re: [SQL] System catalog table privileges

2006-07-21 Thread Scott Marlowe
On Fri, 2006-07-21 at 11:19, Hilary Forbes wrote: Aaron Thanks for this one - I had actually wondered about doing that but the trouble is that they say that they need up to the minute reports not as of last night. Indeed, I do have another app where I do just that because I find that

Re: [SQL] MS-SQL-Postgres sync

2006-07-10 Thread Scott Marlowe
Look at slony. On Mon, 2006-07-10 at 11:06, Forums @ Existanze wrote: We are looking for the exact thing but with two PostgreSQL databases __ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Re: [SQL] MS-SQL-Postgres sync

2006-07-10 Thread Scott Marlowe
On Mon, 2006-07-10 at 11:25, Andrew Sullivan wrote: On Mon, Jul 10, 2006 at 11:27:52AM -0400, Kevin Bednar wrote: Looking to keep 2 databases in sync, at least semi-realtime if possible, although running a batch update every x mins wouldn't be out of the question. One db is postgres and

Re: [SQL] MS-SQL-Postgres sync

2006-07-10 Thread Scott Marlowe
real hard though. Kevin -Original Message- From: Scott Marlowe [EMAIL PROTECTED] To: Forums @ Existanze [EMAIL PROTECTED] Cc: pgsql-sql@postgresql.org Date: Mon, 10 Jul 2006 13:31:35 -0500 Subject: Re: [SQL] MS-SQL-Postgres

Re: [SQL] Alternative to serial primary key

2006-07-07 Thread Scott Marlowe
On Fri, 2006-07-07 at 03:07, David Clarke wrote: Yep, this was pretty much where I started from and I totally agree with you regarding premature optimisation. I would point out that md5 hash is 128 bits or 16 bytes and not 32 Unless you're going to store them as a binary field, the standard

Re: [SQL] Atomar SQL Statement

2006-07-07 Thread Scott Marlowe
On Fri, 2006-07-07 at 13:07, Stephan Szabo wrote: On Fri, 7 Jul 2006, Michael Glaesemann wrote: On Jul 7, 2006, at 7:55 , Weber, Johann (ISS Kassel) wrote: My concern: in a multi threaded environment, can a second thread interrupt this statement and eventually insert the same email

Re: [SQL] Alternative to serial primary key

2006-07-06 Thread Scott Marlowe
On Thu, 2006-07-06 at 05:16, David Clarke wrote: I posted a couple of weeks back a question regarding the use of a 100 char column as a primary key and the responses uniformily advised the use of a serial column. My concern is that the key is effectively abstract and I want to use the column

Re: [SQL] Alternative to serial primary key

2006-07-06 Thread Scott Marlowe
On Thu, 2006-07-06 at 16:43, Aaron Bono wrote: On 7/6/06, David Clarke [EMAIL PROTECTED] wrote: To recap, yes there is only a single column, yes it is varchar. I need to do a lookup on the address column which is unique and use it as a foreign key in

Re: [SQL] Alternative to serial primary key

2006-07-06 Thread Scott Marlowe
On Thu, 2006-07-06 at 16:45, Sander Steffann wrote: Hi, But having a hash function over the address column as the primary key means I can always regenerate my primary key Warning: don't attach a meaning to a primary key, as it might change And as long as it has cascading updates and

Re: Fwd: [SQL] Start up question about triggers

2006-06-26 Thread Scott Marlowe
On Mon, 2006-06-26 at 08:59, Forums @ Existanze wrote: Hello again, The problem is not tracking WHAT changed, this can be done, as we have discussed in this thread, the problem is how to replicate the necessary commands that will alter a mirror database to reflect what has been changed,

Re: [SQL] Advanced Query

2006-06-06 Thread Scott Marlowe
On Tue, 2006-06-06 at 10:30, Richard Broersma Jr wrote: Personally: I think your posts are getting annoying. This isn't SQLCentral. Learn to write your own damn queries or even better - buy a book on SQL... Personally: (being a newbie with an interest in developing a strong rdms

Re: [SQL] Am I crazy or is this SQL not possible

2006-06-01 Thread Scott Marlowe
On Thu, 2006-06-01 at 14:47, Yasir Malik wrote: It is a hack, but when someone wants you to do something in a way different from the norm, aren't they asking for a hack? SQL Server does something like select top (1) from I am thinking this is NOT a SQL-99 standard. This was

Re: [SQL] Find min and max values across two columns?

2006-05-15 Thread Scott Marlowe
On Mon, 2006-05-15 at 16:40, Emi Lu wrote: Hello, I tried select greatest(max(a), max(b)) from public.test, but I got the following errors: ERROR: function greatest(integer, integer) does not exist HINT: No function matches the given name and argument types. You may need to add

Re: [SQL] Flight numbers data

2006-03-29 Thread Scott Marlowe
On Wed, 2006-03-29 at 02:17, Achilleus Mantzios wrote: Hi, i am in the process of writing an application about tickets, flights, etc, and i am thinking of getting the primitive data ready at the begining and doing it the right way, (e.g. the user will just select a flight number and doesnt

Re: [SQL] generate_series to return row that doesn't exist in

2006-03-24 Thread Scott Marlowe
On Fri, 2006-03-24 at 14:30, MaXX wrote: Hi, I have a table wich contains aggregated data, table stats_activity logtime timestamptz, count int given this dataset 2006-03-24 03:00:00+01;55 2006-03-24 04:00:00+01;33 2006-03-24 06:00:00+01;46 2006-03-24 07:00:00+01;63

Re: [SQL] Referential integrity broken (8.0.3), sub-select help

2006-03-21 Thread Scott Marlowe
On Tue, 2006-03-21 at 08:58, [EMAIL PROTECTED] wrote: Hello, I've got 2 tables, url (U), and bookmark (B), with bookmark pointing to url via FK. Somehow I ended up with some rows in B referencing non-existent rows in U. This sounds super strange and dangerous to me, and it's not clear to

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Scott Marlowe
On Mon, 2006-03-20 at 02:06, Eugene E. wrote: http://dev.mysql.com/doc/refman/5.0/en/news-5-0-19.html --- cut --- mysql no longer terminates data value display when it encounters a NUL byte. Instead, it displays NUL bytes as spaces. (Bug #16859) --- cut --- Everyone here realizes that this

Re: [HACKERS] [SQL] Interval subtracting

2006-03-08 Thread Scott Marlowe
On Wed, 2006-03-08 at 06:07, Markus Schaber wrote: Hi, Scott, Scott Marlowe wrote: But it isn't '-2 months, -1 day'. I think what you are saying is what I am saying, that we should make the signs consistent. Pretty much. It just seems wrong to have different signs in what

Re: [SQL] pg_dump and diffrent sizes

2006-03-03 Thread Scott Marlowe
On Fri, 2006-03-03 at 14:10, Maciej Piekielniak wrote: Hello pgsql-sql, I dump db with pg_dump v.8.1.3 on database postgresql server 7.4.7. Data directory with my db on pg 7.4.7 had 1,8GB and file with dump had 2,7GB. Database have blob fields. When I restore db on pg 8.1 - data

Re: [SQL] Replication - state of the art?

2006-03-01 Thread Scott Marlowe
On Wed, 2006-03-01 at 11:51, Bryce Nesbitt wrote: I'm interested in creating a mirror database, for use in case one our primary machine goes down. Can people here help sort out which of the several replication projects is most viable? As far as I can tell, the winner is slony1 at

Re: [SQL] Interval subtracting

2006-03-01 Thread Scott Marlowe
On Wed, 2006-03-01 at 14:18, Bruce Momjian wrote: Stephan Szabo wrote: justify_days doesn't currently do anything with this result --- it thinks its charter is only to reduce day components that are = 30 days. However, I think a good case could be made that it should normalize

Re: [SQL] Update in all tables

2006-02-22 Thread Scott Marlowe
On Wed, 2006-02-22 at 12:08, Judith wrote: Hello everybody I need to update a field with the same value in the tables of my data base but this field exists in almost all tables and has the same value, I don't want to code a script, so my question is if there is some way to update that

Re: [SQL] Update in all tables

2006-02-22 Thread Scott Marlowe
On Wed, 2006-02-22 at 15:13, Andrew Sullivan wrote: On Wed, Feb 22, 2006 at 11:59:06AM -0600, Judith Altamirano Figueroa wrote: Hello everybody I need to update a field with the same value in the tables of my data base but this field exists in almost all tables and has the same value, I

Re: [SQL] DB design and foreign keys

2005-12-13 Thread Scott Marlowe
On Tue, 2005-12-13 at 12:16, Gianluca Riccardi wrote: hello all, i'm usign PostgreSQL 7.4.7 in a Debian 3.1 following is the SQL schema of my (very)small DB for a (very small)web business application: CREATE TABLE orders ( id serial, order_code serial, customer_code integer

Re: [SQL] child fk problem

2005-11-30 Thread Scott Marlowe
On Wed, 2005-11-30 at 12:42, Luis Silva wrote: I there, I'm trying to work with postgre, but i'm having a problem with inherits. I have a table (parent) that as an fk to another table. When i create a child, i loose the connection to the other table. i dont need to insert values in the parent

Re: [SQL] why vacuum

2005-10-26 Thread Scott Marlowe
On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote: hi, i was in a minor flame war with a mysql guy - his major grouse was that 'I wouldnt commit mission critical data to a database that needs to be vacuumed once a week'. So why does pg need vacuum? The absolutely funniest thing about

Re: [SQL] why vacuum

2005-10-26 Thread Scott Marlowe
On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote: hi, i was in a minor flame war with a mysql guy - his major grouse was that 'I wouldnt commit mission critical data to a database that needs to be vacuumed once a week'. So why does pg need vacuum? Oh man oh man. After reading the

Re: [SQL] why vacuum

2005-10-26 Thread Scott Marlowe
On Wed, 2005-10-26 at 11:09, Jan Wieck wrote: On 10/26/2005 11:19 AM, Scott Marlowe wrote: On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote: hi, i was in a minor flame war with a mysql guy - his major grouse was that 'I wouldnt commit mission critical data to a database that needs

Re: [SQL] why vacuum

2005-10-26 Thread Scott Marlowe
On Wed, 2005-10-26 at 11:12, Tom Lane wrote: Scott Marlowe [EMAIL PROTECTED] writes: On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote: i was in a minor flame war with a mysql guy - his major grouse was that 'I wouldnt commit mission critical data to a database that needs

Re: [SQL] Blank-padding

2005-10-24 Thread Scott Marlowe
On Sat, 2005-10-22 at 00:39, Chris Travers wrote: Tom Lane wrote: Dean Gibson (DB Administrator) [EMAIL PROTECTED] writes: I remember that discussion, and I was for the change. However, upon doing some testing after reading the above, I wonder if the blank-stripping isn't too

Re: [SQL]

2005-10-18 Thread Scott Marlowe
On Thu, 2005-10-13 at 10:31, Shavonne Marietta Wijesinghe wrote: how can i do a query with 2 databases?? This is only supported by an add on called dblink, and it's a little bit klunky. Could schemas solve your problem? ---(end of broadcast)---

Re: [SQL] pg, mysql comparison with group by clause

2005-10-13 Thread Scott Marlowe
On Wed, 2005-10-12 at 20:13, Greg Stark wrote: Scott Marlowe [EMAIL PROTECTED] writes: Hehe. When I turn on my windshield wipers and my airbag deploys, is it a documented feature if the dealership told me about this behaviour ahead of time? Well it's more like my car where

Re: [SQL] pg, mysql comparison with group by clause

2005-10-13 Thread Scott Marlowe
On Thu, 2005-10-13 at 13:26, Greg Stark wrote: Scott Marlowe [EMAIL PROTECTED] writes: Sorry, but it's worse than that. It is quite possible that two people could run this query at the same time and get different data from the same set and the same point in time. That shouldn't happen

Re: [SQL] pg, mysql comparison with group by clause

2005-10-12 Thread Scott Marlowe
On Wed, 2005-10-12 at 16:54, Greg Stark wrote: Stephan Szabo [EMAIL PROTECTED] writes: On Tue, 11 Oct 2005, Rick Schumeyer wrote: I'm not sure what I was thinking, but I tried the following query in pg: SELECT * FROM t GROUP BY state; pg returns an error. Mysql, OTOH,

Re: [SQL] pg, mysql comparison with group by clause

2005-10-11 Thread Scott Marlowe
On Tue, 2005-10-11 at 16:12, Rick Schumeyer wrote: I'm not sure what I was thinking, but I tried the following query in pg: SELECT * FROM t GROUP BY state; pg returns an error. Mysql, OTOH, returns the first row for each state. (The first row with AK, the first row with PA, etc.)

Re: [SQL] Selecting records not present in related tables

2005-10-06 Thread Scott Marlowe
On Thu, 2005-10-06 at 14:43, Hector Rosas wrote: Hello, I'm trying to select records in a table not present in a related table, in example, I've a table with message information (subject, message, date, etc) and another (usermessages) with where user(s) has that message, its state, etc.

Re: [SQL] Selecting count of details along with details columns

2005-09-29 Thread Scott Marlowe
On Thu, 2005-09-29 at 14:08, Axel Rau wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Exactly, that query works as I expected. Thank you. Can you answer this question as well: Looking for a workaround, I learned that aggregate functions are not allowed in WHERE clauses. Question:

Re: [SQL] insert only if conditions are met?

2005-08-31 Thread Scott Marlowe
On Wed, 2005-08-31 at 14:54, Jim C. Nasby wrote: SELECT sum(hours) FROM table WHERE emp_name = 'JSMITH' AND work_date = '8-15-2005'::date will give you the hours. So... INSERT INTO table SELECT blah WHERE (SELECT sum(hours) FROM table WHERE emp_name = 'JSMITH' AND work_date =

Re: [SQL] booleans and nulls

2005-08-30 Thread Scott Marlowe
On Sat, 2005-08-20 at 21:25, Matt L. wrote: Out of curiousity, 1. Does a boolean column occupy 1byte of disk whether or not the value is null or not? No. Nulls are stored, one bit per, to a byte at a time. I.e. if you have 8 null fields, they are stored in the same byte. 2. Is matching

Re: [SQL] how to do a select * and decrypt a column at the same

2005-08-24 Thread Scott Marlowe
On Tue, 2005-08-16 at 14:53, The One wrote: Hello, I have a table with one encrypted column. How can I do a select statement such that it will select all columns from the table and at the same time will decrypt it too? A view should be able to do that... ---(end of

Re: [SQL] Generating a range of integers in a query

2005-07-13 Thread Scott Marlowe
On Wed, 2005-07-13 at 04:13, Aaron Bingham wrote: Hello, I've got an interesting problem: I need to select all possible values of an attribute that do /not/ occur in the database. This would be easy (in my case at least) if there were a way to generate a table containing all integers

Re: [SQL] getting back autonumber just inserted

2005-07-07 Thread Scott Marlowe
On Thu, 2005-07-07 at 15:14, Theodore Petrosky wrote: you have to use currval inside a transaction... begin; insert something that increments the counter; select currval('sequence_name'); end; using currval inside a transaction guarantees that the value is correct for your insert

Re: [SQL] ORDER records based on parameters in IN clause

2005-06-29 Thread Scott Marlowe
On Wed, 2005-06-29 at 09:22, Russell Simpkins wrote: fair enough. but a simple order by id would never work. Try this: select *, case when id=2003 then 1 when id=1342 then 2 when id=799 then 3 when id=1450 then 4

Re: [SQL] ENUM like data type

2005-06-28 Thread Scott Marlowe
On Tue, 2005-06-28 at 13:22, Martín Marqués wrote: El Mar 28 Jun 2005 13:58, PFC escribió: Here is where I get uncertain as to if this is possible. My idea is to create a pseudo type that triggers the creation of it's lookup tables the same way the SERIAL type triggers creation of a

Re: [SQL] SELECT very slow

2005-06-16 Thread Scott Marlowe
On Wed, 2005-06-15 at 17:08, Thomas Kellerer wrote: PFC wrote on 15.06.2005 22:04: It's not the program or Java. The same program takes about 20 seconds with Firebird and the exactly same data. Hm, that's still very slow (it should do it in a couple seconds like my PC

Re: [SQL] Tip ?

2005-05-24 Thread Scott Marlowe
On Tue, 2005-05-24 at 13:26, Alain wrote: This tip was at the end of a message (from Szcs Gbor). TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match it looks very important, but I cannot understand it. Sound as a small

Re: [SQL] Does Postgresql have a similar pseudo-column ROWNUM as

2005-05-20 Thread Scott Marlowe
On Fri, 2005-05-20 at 13:27, Keith Worthington wrote: Scott, I realize that this thread went off in another direction however your suggestion proved very helpful for a problem that I was trying to solve. I wanted the row number of a set returned by a function. Here is a chopped version

Re: [SQL] Does Postgresql have a similar pseudo-column ROWNUM as

2005-05-17 Thread Scott Marlowe
On Thu, 2005-05-12 at 14:07, [EMAIL PROTECTED] wrote: Hi: Oracle has a pseudo-column ROWNUM to return the sequence number in which a row was returned when selected from a table. The first row ROWNUM is 1, the second is 2, and so on. Does Postgresql have a similar pseudo-column ROWNUM as

Re: [SQL] ERROR: unterminated quoted string... help

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 13:15, Postgres Admin wrote: Hi I'm trying to insert encrypted data into the database and I'm noticing error dealing with quotes. Below is the error print out... suggestions and/or at least point me in the direction to find a solution, Thanks, J INSERT

Re: [SQL] Replacing a table with constraints

2005-05-13 Thread Scott Marlowe
Are the constraints deferrable? If they are, then you can replace the data with a single transaction. If not, then you'll have to look at disabling triggers for the update. On Fri, 2005-05-13 at 14:55, Mark Fenbers wrote: True, but Counties has about 8 or 9 rules, view, or pk constraints

Re: [SQL] pg_dump without data

2005-05-06 Thread Scott Marlowe
On Fri, 2005-05-06 at 04:14, Kenneth Gonsalves wrote: how do i get a dump of a postgresql database without the data? pg_dump -s for the schema pg_dumpall -g for the globals, like usernames and all. ---(end of broadcast)--- TIP 4: Don't 'kill -9'

Re: [SQL] How to install Postgres that supports 64-bit

2005-04-22 Thread Scott Marlowe
On Fri, 2005-04-22 at 00:30, Dinesh Pandey wrote: How to install Postgres 8.0.1 that supports 64-bit integer/date-time. # ./configure --prefix=/usr/local/pgsql --with-tclconfig=/usr/local/lib --with-tcl checking build system type... sparc-sun-solaris2.8 checking host system

Re: [SQL] Getting the output of a function used in a where clause

2005-04-12 Thread Scott Marlowe
Why not just do: SELECT zipcode, zipdist($lat1d,$lon1d,lat,long) as distance from zipcodes where zipdist($lat1d,$lon1d,lat,long) = $dist;; On Mon, 2005-04-11 at 20:25, Bill Lawrence wrote: Boy I sure thought that would work... I received the following from postgres: ERROR: Attribute

Re: [SQL] getting count for a specific querry

2005-04-12 Thread Scott Marlowe
On Tue, 2005-04-12 at 14:29, Vivek Khera wrote: On Apr 8, 2005, at 4:50 PM, Scott Marlowe wrote: Do you run your 2650s with hyperthreading on? I found that slowed mine down under load, but we never had more than a couple dozen users hitting the db at once, so we may well have had

Re: [SQL] getting count for a specific querry

2005-04-12 Thread Scott Marlowe
On Tue, 2005-04-12 at 15:32, Vivek Khera wrote: On Apr 12, 2005, at 4:23 PM, Scott Marlowe wrote: How much memory is in the box? I've heard horror stories about performance with 2 gigs of ram, which is why I made them order mine with 2 gigs. Does the 3/DC have battery backed cache set

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Scott Marlowe
On Fri, 2005-04-08 at 15:23, Vivek Khera wrote: On Apr 8, 2005, at 3:23 PM, Joel Fradkin wrote: I set up the data on 4 10k scsi drives in a powervault and my wal on 2 15k drives. I am using links to those from the install directory. It starts and stops ok this way, but maybe it

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Scott Marlowe
On Fri, 2005-04-08 at 15:36, Vivek Khera wrote: On Apr 8, 2005, at 4:31 PM, Scott Marlowe wrote: Note that there are several different RAID controllers you can get with a DELL. I had good luck with the PERC 4C (AMI MegaRAID based) at my I've had bad luck regarding speed with *all

<    1   2   3   4   >