Re: [SQL] [GENERAL] SQL update function faililed in Webmin Interface

2004-10-20 Thread Scott Marlowe
On Wed, 2004-10-20 at 01:03, Kathiravan Velusamy wrote: > Hello All, >I am a newbie to PostgreSQL. I am using postgreSQL 7.4.5 in > HP-Unix 11.11 PA , and 11.23 PA. > I have a problem with postgreSQL Webmin (Webmin Version > 1.070) testing in update function. > This

Re: [SQL] [GENERAL] Log

2004-10-25 Thread Scott Marlowe
On Fri, 2004-10-22 at 07:52, Davide Negri wrote: > Hello, > > i have installed the 8.0 beta3-dev1 version of postgres on my pc, and > I want to disable log. How can I do? It is possible to disable and > donât write all the log, or how can I write all the log in a specific > directory?? If you us

Re: [SQL] Column with recycled sequence value

2005-01-13 Thread Scott Marlowe
On Thu, 2005-01-13 at 11:08, KÃPFERL Robert wrote: > Hi, > > suppose I have a let's say heavy used table. There's a column containing > UNIQUE in4 > values. The data type musn't exceed 32-Bit. Since however the table is heavy > used 2^32 will be reached soon and then? There are far less than 4G-re

Re: [SQL] Column with recycled sequence value

2005-01-13 Thread Scott Marlowe
On Thu, 2005-01-13 at 15:19, Michael Fuhr wrote: > On Thu, Jan 13, 2005 at 02:48:47PM -0600, Scott Marlowe wrote: > > On Thu, 2005-01-13 at 11:08, KÃPFERL Robert wrote: > > > > suppose I have a let's say heavy used table. There's a column containing > > >

Re: [SQL] Column with recycled sequence value

2005-01-13 Thread Scott Marlowe
On Thu, 2005-01-13 at 15:43, Andrew Sullivan wrote: > On Thu, Jan 13, 2005 at 03:31:54PM -0600, Scott Marlowe wrote: > > Any method that tries to reuse sequence numbers is a bad idea (TM) and > > Why? I can think of a dozen cases where it can be useful. It just > depends

Re: [SQL] number os commands inside transaction block

2005-01-31 Thread Scott Marlowe
On Mon, 2005-01-31 at 16:29, Luiz Rafael Culik Guimaraes wrote: > Hi Michael Fuhr > >> how i can increse the number of commands in an transaction block > > > > What do you mean? What problem are you trying to solve? > > iÂm trying to solve the follow message > current transaction is aborted, quer

Re: [SQL] MSSQL versus Postgres timing

2005-02-01 Thread Scott Marlowe
On Tue, 2005-02-01 at 10:54, Joel Fradkin wrote: > All is moving along well. > > I have all my views and data and am testing things out a bit. > > A table with 645,000 records for associates has view (basically select > * from tblassociates where clientnum = âtestâ) What does explain analyze s

Re: [SQL] getting back autonumber just inserted

2005-02-03 Thread Scott Marlowe
On Thu, 2005-02-03 at 16:16, lorid wrote: > I could have sworn I kept a copy of prior emails that discussed how to > get back a value that was just inserted into a autonumber (or in > postgresql case a sequence number) If you know the name of the sequence the number came from you can use currva

Re: [SQL] More efficient OR

2005-02-16 Thread Scott Marlowe
On Wed, 2005-02-16 at 10:02, Keith Worthington wrote: > Hi All, > > In several of my SQL statements I have to use a WHERE clause that contains > mutiple ORs. i.e. > > WHERE column1 = 'A' OR > column1 = 'B' OR > column1 = 'C' > > Is there a more efficient SQL statement that accomplis

Re: [SQL] Postgres performance

2005-03-02 Thread Scott Marlowe
On Tue, 2005-03-01 at 04:52, mauro wrote: > > Not always, AFAICT. The four most common reasons why PG tests slower > > than Mysql are: > > 1. You haven't configured or have misconfigured PostgreSQL. > > 2. You are testing a MySQL-tuned application (lots of small, simple > > queries, no views, no

Re: [SQL] Postgres performance

2005-03-02 Thread Scott Marlowe
On Wed, 2005-03-02 at 15:45, PFC wrote: > > The reason PostgreSQL is slower is because it (and by extension the team > > behind it) cares about your data. > > Sure, postgres is (a bit but not much) slower for a simple query like > SELECT * FROM one table WHERE id=some number, and postgres

Re: [SQL] best way to auto-update a field when row is updated

2005-03-10 Thread Scott Marlowe
On Thu, 2005-03-10 at 14:09, Henry Ortega wrote: > I have the following table > > FIELD_A| FIELD_B | TSTAMP > > x y

Re: [SQL] "Flattening" query result into columns

2005-03-21 Thread Scott Marlowe
On Mon, 2005-03-21 at 15:57, Thomas Borg Salling wrote: > I am looking for a way to âflattenâ a query result, so that rows are > âtransposedâ into columns, just as asked here for oracle: > > http://groups.google.dk/groups?hl=da&lr=&client=firefox-a&rls=org.mozilla:en-US:official&selm=aad10be0.0401

Re: [SQL] Postgres 7.3 migrate to 8.0 date problems.

2005-03-28 Thread Scott Marlowe
On Mon, 2005-03-28 at 13:44, Thomas Seeber wrote: > Hi, > > We were upgrading from postgres 7.3 -> 8.0 and having a little > problems importing dates from some of our data sources. Say we have a > date like '2004-17-05'. In postgres 7.3, postgres would intrept this > as Year Day Month automatica

Re: [SQL] cost of CREATE VIEW ... AS SELECT DISTINCT

2005-03-28 Thread Scott Marlowe
On Mon, 2005-03-28 at 15:43, T E Schmitz wrote: > Hello, > How expensive would it be to maintain the following VIEW: > > CREATE VIEW origin AS SELECT DISTINCT origin FROM transaktion > > if there is in index on transaktion.origin; the table transaktion has > thousands of records and there are on

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Scott Marlowe
On Fri, 2005-04-08 at 12:08, Joel Fradkin wrote: > Thanks all. > I might have to add a button to do the count on command so they don't get > the hit. > I would want it to return the count of the condition, not the currently > displayed number of rows. > > Is there any other database engines that p

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 ma

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Scott Marlowe
On Fri, 2005-04-08 at 15:35, Bob Henkel wrote: > On Apr 8, 2005 3:23 PM, Vivek Khera <[EMAIL PROTECTED]> 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 >

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'v

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Scott Marlowe
On Fri, 2005-04-08 at 15:41, Vivek Khera wrote: > On Apr 8, 2005, at 4:35 PM, Bob Henkel wrote: > > > desktop SATA drive with no RAID? I'm by any means as knowledgeable > > about I/O > > setup as many of you are but my 2 cents wonders if the Dell RAID is > > really > > that much slower than a co

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 "d

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 > >

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. D

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 syst

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] 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 > att

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 "

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 > > >

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 > vers

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 Szűcs Gábor). > > > 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

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 l

Re: [SQL] Unique primary index?

2005-06-28 Thread Scott Marlowe
On Tue, 2005-06-28 at 12:01, PFC wrote: > > > > What are the major differences between Unique, primary index & just > > plain index? > > > > When creating tables I nominate one of these, but not sure what the > > difference is? > index is... an index ! > > UNIQUE is an index which won't allow du

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 c

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] 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 inser

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 integer

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... ---(en

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 matc

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] Why doesn't the SERIAL data type automatically have a

2005-09-27 Thread Scott Marlowe
On Mon, 2005-09-26 at 20:03, Tom Lane wrote: > Ferindo Middleton Jr <[EMAIL PROTECTED]> writes: > > Is there some reason why the SERIAL data type doesn't automatically have > > a UNIQUE CONSTRAINT. > > It used to, and then we decoupled it. I don't think "I have no use for > one without the other

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. > > Q

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. Rec

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",

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 erro

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

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 se

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)--- T

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-strip

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 ar

Re: [SQL] Combining two SELECTs by same filters

2005-10-26 Thread Scott Marlowe
On Wed, 2005-10-26 at 10:16, Volkan YAZICI wrote: > => SELECT > -> (SELECT count(id) FROM sales > -> WHERE id = 2 > -> AND date_trunc('hour', dt) = '2005-10-25 21:00:00'), > -> (SELECT count(id) FROM sales > -> WHERE id = 2 > -> AND date_trunc('hour', dt) =

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 > >> '

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 cri

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 par

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 i

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 va

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 > http

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: [HACKERS] [SQL] Interval subtracting

2006-03-01 Thread Scott Marlowe
On Wed, 2006-03-01 at 14:27, Bruce Momjian wrote: > Scott Marlowe wrote: > > 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 > > > > > thi

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 d

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.

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 t

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 n

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

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] How to copy data between joined columns?

2006-04-07 Thread Scott Marlowe
On Fri, 2006-04-07 at 15:32, Bryce Nesbitt wrote: > I have a need to copy/update data from one column to another, based on a > join condition. Is this easy to do in pure SQL? I have google'ed > without luck for a easy solution (that's not Microsoft specific, that > is). For example: > > postgre

Re: [SQL] LinkedList

2006-04-26 Thread Scott Marlowe
On Wed, 2006-04-26 at 11:09, Ray Madigan wrote: > I have a table that I created that implements a linked list. I am not an > expert SQL developer and was wondering if there are known ways to traverse > the linked lists. Any information that can point me in the direction to > figure this out would

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

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.

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 > sk

Re: [SQL] How to get list of days between two dates?

2006-06-06 Thread Scott Marlowe
On Tue, 2006-06-06 at 16:17, Aaron Bono wrote: > Though there may be a more eligant way to do it, when we did things > like this in the past we created a function (or stored procedure) that > got the min and max dates and then created a result set that iterated > through the dates to create a virtu

Re: [SQL] empty set

2006-06-08 Thread Scott Marlowe
On Thu, 2006-06-08 at 16:40, CG wrote: > PostgreSQL 8.1 > > I've been trying to write a SQL prepare routine. One of the challenging > elements I'm running into is an empty set ... > > "select foo from bar where foo in ? ;" > > What if "?" is an set with zero elements? What is the proper value to

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] 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 colum

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 k

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

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 standar

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 th

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 PROTEC

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

Re: [SQL] MS-SQL<->Postgres sync

2006-07-10 Thread Scott Marlowe
ould work. Didnt look real hard though. > > Kevin > > > -Original Message- > From: Scott Marlowe <[EMAIL PROTECTED]> > To: "Forums @ Existanze" <[EMAIL PROTECTED]> > Cc: pgsql-sql@postgresql.org >

Re: [SQL] How to find entries missing in 2nd table?

2006-07-11 Thread Scott Marlowe
On Tue, 2006-07-11 at 09:19, [EMAIL PROTECTED] wrote: > Hi, > I realize I probably lost my marbles but I've been having a god > awful time with a single query: > > control: > > > controller_id pk; > > > datapack: > > controller_id fk; > >

Re: [SQL] How to find entries missing in 2nd table?

2006-07-12 Thread Scott Marlowe
On Wed, 2006-07-12 at 03:06, Exner, Peter wrote: > Hi, > > what about > > SELECT controller_id FROM control > WHERE controller_id NOT IN > (SELECT DISTINCT controller_id FROM datapack); That one works too, but it's generally not as fast as the left join / is null query on large tables. Give th

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 tha

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 " to give yourself enough > space to get out of the jam before you go deleting things. Then you might > want to vacuum full afterwards.

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] Sequences

2009-07-04 Thread Scott Marlowe
Easiest way is with pg_dump -s -t tablename dbname On Sat, Jul 4, 2009 at 6:35 AM, Jasmin Dizdarevic wrote: > Nice Information. Does somebody know how to get the complete > create-statement of an existing table/view? > > 2009/7/3 Chris Browne >> >> Andre Rothe writes: >> > Where are stored the s

Re: [SQL] Best way to simulate Booleans

2009-07-06 Thread Scott Marlowe
On Mon, Jul 6, 2009 at 7:22 PM, Peter Headland wrote: > I know, I know, PostgreSQL has Booleans that work very nicely. > Unfortunately, I have to create a schema that will work on Oracle as well as > PostgreSQL, by which I mean that a single set of Java/JDBC code has to work > with both databases.

Re: [SQL] Request new version to support "on commit drop" for create temp table ... as select ?

2009-07-14 Thread Scott Marlowe
On Tue, Jul 14, 2009 at 10:47 AM, Tom Lane wrote: > Emi Lu writes: >> I googled to find that "on commit drop" does not support: > >> (a) create temp table as select * from table1 where 1<>2; >> http://archives.postgresql.org/pgsql-sql/2005-09/msg00153.php > > Ah, the pitfalls of believing that the

Re: [SQL] De-duplicating rows

2009-07-17 Thread Scott Marlowe
On Thu, Jul 16, 2009 at 9:07 PM, Christophe wrote: > The Subject: is somewhat imprecise, but here's what I'm trying to do.  For > some reason, my brain is locking up over it. > > I'm moving a 7.2 (yes) database to 8.4.  In the table in question, the > structure is along the lines of: > >        ser

Re: [SQL] Call Procedure From Trigger Function

2009-08-19 Thread Scott Marlowe
On Wed, Aug 19, 2009 at 3:53 PM, Doug Pisarek wrote: > I am in the process of coverting an Oracle 10.2.0.3 database to Postgresql > 8.3. I have a number of triggers in Oracle that make a call to packages. > I know I will need to re-write the Oracle packages to postgres functions. > The issue which

Re: [SQL] Rewrite without correlated subqueries

2009-08-20 Thread Scott Marlowe
On Thu, Aug 20, 2009 at 3:16 PM, bricklen wrote: > Interesting idea. Preferably this operation could be done in straight SQL in > a single transaction, to fit in with the way our application works, but if > that's not possible I may need to go the temporary table route. Temp tables can be included

Re: [SQL] Odd sort behaviour

2009-09-01 Thread Scott Marlowe
On Tue, Sep 1, 2009 at 3:01 PM, Rob Sargent wrote: > Since when does "." sort as "nothing at all" Since you set your locale equal to something like en_US instead of C -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mai

Re: [SQL] How to simulate (run) the function

2009-09-04 Thread Scott Marlowe
On Fri, Sep 4, 2009 at 8:43 PM, bilal ghayyad wrote: > Hello; > > I have an SQL function and I need to know how to simulate it (calling it and > pass for it the argument and see what the value it returns), HOW? Can I do > this from the pgAdminIII GUI or from the CLI? > > This method help to check

Re: [SQL] Working slow

2009-09-21 Thread Scott Marlowe
On Mon, Sep 21, 2009 at 7:58 AM, Judith Altamirano wrote: > hello every body, I'm having a data base in a point of sale that is getting > frozen, I already have run a vacuum -z -d to reindex the data base and > nothing happens.. Some suggestions to speed the process, Do you guys > think that t

Re: [SQL] Can i customize null-padding for outer joins?

2009-09-30 Thread Scott Marlowe
On Thu, Oct 1, 2009 at 12:19 AM, Shruthi A wrote: > Hello, > > I have a query where I full-outer-join 2 tables, and all the columns other > than the join column are numerical columns. For my further calculations i > need to pad the unmatched tuples with 0 (zero) instead of NULL so that I can > per

Re: [SQL] Pg_Restore with --clean option

2009-09-30 Thread Scott Marlowe
On Wed, Sep 30, 2009 at 11:14 PM, Jyoti Seth wrote: > > I want to restore data of a single table. Before restoring the data I > disabled all the triggers and constraints on that table. I used the restore > command with --clean option so that data gets deleted from that table and > then fresh data

Re: [SQL] reading last inserted record withoud any autoincrement field

2009-10-05 Thread Scott Marlowe
On Sun, Oct 4, 2009 at 1:34 PM, Rob Sargent wrote: > Osvaldo Kussama wrote: >> >> 2009/10/4 mohammad qoreishy >> >>> >>> How can get last inserted record in a table without any autoincrement >>> filed? >>> I need to  frequently fetch the last inserted record. >>> If I must use the "Cursor" please

Re: [SQL] question about timestamp with tz

2009-10-22 Thread Scott Marlowe
On Thu, Oct 22, 2009 at 2:41 PM, the6campbells wrote: > Question.. is there a way that I can get Postgres to return the tz as > supplied on the insert statement PostgreSQL converts the timezone to GMT and stores it with no offset, then adds an offset based on the TZ of the client requesting it ba

  1   2   3   4   >