Re: [SQL] trying to repair a bad header block

2008-10-29 Thread Scott Marlowe
On Wed, Oct 29, 2008 at 4:23 PM, Tom Lane [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: There is a way to 'correct' or blank the values somehow? I guess im going to lose some data, iisnt... If you can tolerate losing the data on that page, just zero out the entire 8K page. dd from

Re: [SQL] trying to repair a bad header block

2008-10-29 Thread Scott Marlowe
On Wed, Oct 29, 2008 at 6:36 PM, Tom Lane [EMAIL PROTECTED] wrote: Scott Marlowe [EMAIL PROTECTED] writes: On Wed, Oct 29, 2008 at 4:23 PM, Tom Lane [EMAIL PROTECTED] wrote: If you can tolerate losing the data on that page, just zero out the entire 8K page. dd from /dev/zero is the usual tool

Re: [SQL] trying to repair a bad header block

2008-10-29 Thread Scott Marlowe
On Wed, Oct 29, 2008 at 7:24 PM, Scott Marlowe [EMAIL PROTECTED] wrote: Oh, and to reply to myself and the original poster, you need to figure out what's causing the pages to get damaged. IT's usually bad hardware, then a buggy driver, then a buggy kernel / OS that can cause it. Run lots

Re: [SQL] Updating Query of 1 table from data in another

2008-10-15 Thread Scott Marlowe
On Wed, Oct 15, 2008 at 8:16 AM, Chris Preston [EMAIL PROTECTED] wrote: Thanks scott Does this work with 8.1 (that's what I'm using) When I try to create the b table I get a message Yep. Post a self-contained example of what's not working. ERROR: there is no unique constraint matching

Re: [SQL] effectiveness tool

2008-10-14 Thread Scott Marlowe
On Tue, Oct 14, 2008 at 4:34 PM, Judith Altamirano [EMAIL PROTECTED] wrote: Hello everybody!! I just want to know if there be some tool to analize the performance of a query, I mean to qualify the effectiveness, speed, if I have the correct indexes. Google pg fouine. -- Sent via pgsql-sql

Re: [SQL] replicating a table in several databases

2008-10-14 Thread Scott Marlowe
On Fri, Oct 10, 2008 at 8:59 AM, Chris Browne [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] (Gerardo Herzig) writes: Hi all. Im facing a situation where i have to replicate a table from database A in databases B,C,F and so on. The first (and only) thing i have in mind is using triggers with

Re: [SQL] Updating Query of 1 table from data in another

2008-10-13 Thread Scott Marlowe
On Mon, Oct 13, 2008 at 1:23 PM, Chris Preston [EMAIL PROTECTED] wrote: Hello all, I'm still new to postgres If I have 2 tables with the following data structure Agentno and agentname (along with many other fields) this table is called agent_master And I have another table with agentno and

Re: [SQL] pg_dump more than one table in one command?

2008-10-06 Thread Scott Marlowe
On Mon, Oct 6, 2008 at 3:24 PM, Harold A. Giménez Ch. [EMAIL PROTECTED] wrote: On Mon, Oct 6, 2008 at 5:02 PM, Emi Lu [EMAIL PROTECTED] wrote: Good morning, Under postgreSQL 8.0, could someone tell me how to pg_dump more than one tables at the same time please? I tried to do something

Re: [SQL] Can COPY update or skip existing records?

2008-09-30 Thread Scott Marlowe
On Tue, Sep 30, 2008 at 6:16 AM, Glenn Gillen [EMAIL PROTECTED] wrote: Hey all, I've got a table with a unique constraint across a few fields which I need to regularly import a batch of data into. Is there a way to do it with COPY without getting conflicts on the unique contraint? I have no

Re: [SQL] ORDER BY collation order

2008-09-19 Thread Scott Marlowe
On Thu, Sep 18, 2008 at 10:35 PM, Joe [EMAIL PROTECTED] wrote: Hi Scott, Scott Marlowe wrote: no, not encoding, locale, such as en_US or C determine sort order. OK, so I guess you're saying that whatever was in the LC_COLLATE environment variable at the time the template0 database

Re: [SQL] Doubts about FK

2008-09-18 Thread Scott Marlowe
On Thu, Sep 18, 2008 at 5:49 AM, Rafael Domiciano [EMAIL PROTECTED] wrote: 2008/9/12 Scott Marlowe [EMAIL PROTECTED] On Fri, Sep 12, 2008 at 12:14 PM, Rafael Domiciano [EMAIL PROTECTED] wrote: Hi there, In my DB I have a couple of FK, so the change of referenced columns is a quite

Re: [SQL] ORDER BY collation order

2008-09-18 Thread Scott Marlowe
On Thu, Sep 18, 2008 at 6:48 PM, Joe [EMAIL PROTECTED] wrote: Hi, I just found that two identical queries on two PG 8.2.7 databases with the same data and same encoding, one running on Debian and the other on FreeBSD, returned rows in a different order, even though both queries had an ORDER

Re: [SQL] surrogate vs natural primary keys

2008-09-17 Thread Scott Marlowe
On Wed, Sep 17, 2008 at 7:20 AM, Seb [EMAIL PROTECTED] wrote: On Tue, 16 Sep 2008 20:34:51 -0600, Scott Marlowe [EMAIL PROTECTED] wrote: [...] create table t2 ( d1 varchar(200), d2 int8, d3 varchar(1000), foreign key t2_fk references t1(c1,c2) ); Thanks Scott, I guess

Re: [SQL] surrogate vs natural primary keys

2008-09-16 Thread Scott Marlowe
On Tue, Sep 16, 2008 at 6:10 PM, Seb [EMAIL PROTECTED] wrote: Hi, After some more reading and considering your feedback, I'm still somewhat confused about this issue. 1. Should the choice of surrogate/natural primary keys be done across an entire database, or does it make more sense to do

Re: [SQL] Pls Hlp: SQL Problem

2008-09-15 Thread Scott Marlowe
On Mon, Sep 15, 2008 at 2:14 PM, Fernando Hevia [EMAIL PROTECTED] wrote: -Mensaje original- De: Scott Marlowe [mailto:[EMAIL PROTECTED] Consider that if you are NOT going to use the decimals you should really use integer or bigint datatypes. The numeric type compute much

Re: [SQL] surrogate vs natural primary keys

2008-09-15 Thread Scott Marlowe
On Mon, Sep 15, 2008 at 4:02 PM, Seb [EMAIL PROTECTED] wrote: Hi, I've been reading several articles on this hotly debated issue and still can't find proper criteria to select one or the other approach for the database I'm currently designing. I'd appreciate any pointers. Thanks. You'll

Re: [SQL] Pls Hlp: SQL Problem

2008-09-12 Thread Scott Marlowe
On Fri, Sep 12, 2008 at 12:50 PM, Hengky Lie [EMAIL PROTECTED] wrote: Dear Richard, Sorry for that :) and thanks for your tips, but it didn't solve my problem. Maybe because my postgresql knowledge limitation. I have tried your suggestion, my view like this : Put parens around the whole

Re: [SQL] Doubts about FK

2008-09-12 Thread Scott Marlowe
On Fri, Sep 12, 2008 at 12:14 PM, Rafael Domiciano [EMAIL PROTECTED] wrote: Hi there, In my DB I have a couple of FK, so the change of referenced columns is a quite complicated. Today, I DISABLE TRIGGER ALL on the tables envolved and then ENABLE TRIGGER ALL to back them. Is there a better

Re: [SQL] Pls Hlp: SQL Problem

2008-09-12 Thread Scott Marlowe
On Fri, Sep 12, 2008 at 4:01 PM, Fernando Hevia [EMAIL PROTECTED] wrote: -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Scott Marlowe On Fri, Sep 12, 2008 at 12:50 PM, Hengky Lie [EMAIL PROTECTED] wrote: Dear Richard, Put parens around

Re: [SQL] Function syntax ?

2008-09-09 Thread Scott Marlowe
On Tue, Sep 9, 2008 at 11:55 AM, Ruben Gouveia [EMAIL PROTECTED] wrote: Does this syntax look correct? Can anyone think of a better way to write this? This function will accept two timestamp parameters and determine the highest of the two? create or replace function fcn_max_dt(p_dt

Re: [SQL] Function syntax ?

2008-09-09 Thread Scott Marlowe
function fcn_max_dt near line 3 On Tue, Sep 9, 2008 at 11:07 AM, Scott Marlowe [EMAIL PROTECTED] wrote: On Tue, Sep 9, 2008 at 11:55 AM, Ruben Gouveia [EMAIL PROTECTED] wrote: Does this syntax look correct? Can anyone think of a better way to write this? This function

Re: [SQL] Correct Insert SQL syntax?

2008-09-05 Thread Scott Marlowe
On Fri, Sep 5, 2008 at 10:11 AM, Lennin Caro [EMAIL PROTECTED] wrote: --- On Thu, 9/4/08, Ruben Gouveia [EMAIL PROTECTED] wrote: ) (select p_date, fcn_stats1(p_date,'basic'), fcn_stats2(p_date,'basic',0) from dual

Re: [SQL] variables with SELECT statement

2008-09-05 Thread Scott Marlowe
On Fri, Sep 5, 2008 at 3:28 PM, Kevin Duffy [EMAIL PROTECTED] wrote: No looks like I have 8.2 I can attest that all of 8.3's performance improvements as well all of the really useful new functions like the one mentioned here make it well worth the effort to upgrade. I haven't been as excited

Re: [SQL] MAY I HAVE YOUR ASSISTANCE

2008-09-01 Thread Scott Marlowe
On Mon, Sep 1, 2008 at 1:03 AM, James Kitambara [EMAIL PROTECTED] wrote: Please members of the PGSQL-SQL, I have one problem with the user table. I want to hide the password for the users. The table format is: user ( user_id, user_name, password) But I want the password to be encrypted

Re: [SQL] [ADMIN] Regarding access to a user

2008-08-25 Thread Scott Marlowe
On Thu, Aug 21, 2008 at 3:05 AM, Shashwat_Nigam [EMAIL PROTECTED] wrote: Dear Vishal Thanks for the help but by doing this an error is generated at the time when the user is trying to log in with the following message: Access to database denied The server doesn't grant access to the

Re: [SQL] Question on partitioning

2008-08-21 Thread Scott Marlowe
On Thu, Aug 21, 2008 at 8:25 AM, Oliveiros Cristina [EMAIL PROTECTED] wrote: Hello , All. I am not sure if this is the right mailing list to place this question. If it doesn't, please kindly redirect me to the right list. I have a giant table with about 10,6 million records. 10.6 million

Re: [SQL] DELETE with JOIN

2008-08-07 Thread Scott Marlowe
On Thu, Aug 7, 2008 at 5:37 PM, [EMAIL PROTECTED] wrote: On Thu, Aug 07, 2008 at 06:12:32PM -0400, Alvaro Herrera wrote: I suggest you do not assume that Oracle implementation details apply to Postgres, because they do not, most of the time. They certainly don't in this case. And I

Re: [SQL] more than 1000 connections

2008-08-06 Thread Scott Marlowe
On Wed, Aug 6, 2008 at 10:42 AM, Jorge Medina [EMAIL PROTECTED] wrote: I have many trouble's with server, because my webmail(roundcube) works with the db and the machine only have 2G of RAM but collapse with 60 concurrent connections, I try with persistent connections and the same problem, I

Re: [SQL] more than 1000 connections

2008-08-06 Thread Scott Marlowe
On Wed, Aug 6, 2008 at 1:34 PM, Jorge Medina [EMAIL PROTECTED] wrote: On Wed, Aug 6, 2008 at 1:38 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Wed, Aug 6, 2008 at 11:29 AM, Jorge Medina [EMAIL PROTECTED] wrote: On Wed, Aug 6, 2008 at 12:47 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Wed

Re: [SQL] Savepoints and SELECT FOR UPDATE in 8.2

2008-08-01 Thread Scott Marlowe
On Fri, Aug 1, 2008 at 11:02 AM, EXT-Rothermel, Peter M [EMAIL PROTECTED] wrote: I was thinking of something like this: connect to DB BEGIN SELECT * FROM table_foo where foo_state = 'queued' FOR UPDATE; for each row do [ SAVEPOINT s; UPDATE foo_resource SET in_use = 1 WHERE

Re: [SQL] truncate vs. delete

2008-07-24 Thread Scott Marlowe
n Thu, Jul 24, 2008 at 7:53 AM, A. Kretschmer [EMAIL PROTECTED] wrote: am Thu, dem 24.07.2008, um 9:47:48 -0400 mailte Emi Lu folgendes: I found a link for SQL Server, it applies to PostgreSQL 8.0.x as well? http://vadivel.blogspot.com/2004/06/delete-vs-truncate-statement.html Not realy,

Re: [SQL] Select default values

2008-07-23 Thread Scott Marlowe
On Wed, Jul 23, 2008 at 3:57 AM, Maximilian Tyrtania [EMAIL PROTECTED] wrote: Hi, am Wed, dem 23.07.2008, um 10:32:58 +0200 mailte Maximilian Tyrtania folgendes: Hi there, just a quickie: Is there a way to select all default values of a given table? Something like Select Default values from

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-22 Thread Scott Marlowe
On Tue, Jul 22, 2008 at 12:43 AM, Pavel Stehule [EMAIL PROTECTED] wrote: 2008/7/20 Milan Oparnica [EMAIL PROTECTED]: Is it solved in MySQL or they've just tried ? http://www.mysqlperformanceblog.com/2006/08/02/mysql-prepared-statements/ Wow, the discussion at the bottom of that page made me

Re: [SQL] Size or efficiency differences varchar(128) vs. varchar(32)

2008-07-21 Thread Scott Marlowe
On Mon, Jul 21, 2008 at 8:06 AM, Emi Lu [EMAIL PROTECTED] wrote: Good morning, I'd like to create a varchar length column. May I know does varchar(128) and varchar(32) will cause any size or efficiency differences? If you store the same thing in each, no. If you store 128 char text in the

Re: [SQL] How to GROUP results BY month

2008-07-15 Thread Scott Marlowe
On Tue, Jul 15, 2008 at 6:12 AM, Oliveiros Cristina [EMAIL PROTECTED] wrote: Howdy, all, I have a problem. I have a table which one of the fields is of type date. I need to obtain the totals of the other fields in a by-month basis IS there any easy way to do this using the GROUP BY or any

Re: [SQL] How to GROUP results BY month

2008-07-15 Thread Scott Marlowe
On Tue, Jul 15, 2008 at 7:15 PM, Mark Roberts [EMAIL PROTECTED] wrote: On Tue, 2008-07-15 at 14:31 +0200, A. Kretschmer wrote: am Tue, dem 15.07.2008, um 13:12:39 +0100 mailte Oliveiros Cristina folgendes: Howdy, all, I have a problem. I have a table which one of the fields is of

Re: [SQL] Rollback in Postgres

2008-07-14 Thread Scott Marlowe
On Mon, Jul 14, 2008 at 9:20 AM, samantha mahindrakar [EMAIL PROTECTED] wrote: I didnt no the thread would become a postgresVSoracle thing. I just lost couple of thousand rows and could not retrieve them back, so i wanted to know if postgres had some way to get it back. Iam just a few days

Re: [SQL] Rollback in Postgres

2008-07-12 Thread Scott Marlowe
On Sat, Jul 12, 2008 at 3:20 AM, Simon Riggs [EMAIL PROTECTED] wrote: On Sat, 2008-07-12 at 09:40 +0100, Dave Page wrote: On Sat, Jul 12, 2008 at 8:56 AM, Simon Riggs [EMAIL PROTECTED] wrote: Please don't put links to copyrighted material on our lists. That's an odd thing to say, given

Re: [SQL] Rollback in Postgres

2008-07-11 Thread Scott Marlowe
On Fri, Jul 11, 2008 at 9:43 AM, samantha mahindrakar [EMAIL PROTECTED] wrote: Hi all This is a very basic question.can we roll back data after we run a query. I know that a delete within a transaction can be rolled back. But how about independent delete queries??? If i ran a delete

Re: [SQL] i can't connect after some periode

2008-07-10 Thread Scott Marlowe
On Thu, Jul 10, 2008 at 8:22 AM, Lennin Caro [EMAIL PROTECTED] wrote: --- On Thu, 7/10/08, aldy [EMAIL PROTECTED] wrote: From: aldy [EMAIL PROTECTED] Subject: Re: [SQL] i can't connect after some periode To: pgsql-sql@postgresql.org Date: Thursday, July 10, 2008, 8:16 AM From: A.

Re: [SQL] Converting Copy to insert statement in backup file

2008-07-10 Thread Scott Marlowe
On Thu, Jul 10, 2008 at 9:40 AM, Chris Preston [EMAIL PROTECTED] wrote: Hello, I have a backup cron job (shown below) but its too big and there are times that I want to just cut out from the text file certain areas to restore data in a specific table… Looking in the file, I notice there is a

Re: [SQL] how to control the execution plan ?

2008-07-07 Thread Scott Marlowe
On Mon, Jul 7, 2008 at 3:14 AM, Sabin Coanda [EMAIL PROTECTED] wrote: Hi there, I try to execute the following statement: SELECT * FROM ( SELECT MY_FUNCTION_A(bp.COL_A, NULL::boolean) AS ALIAS_A FROM TABLE_A bp JOIN TABLE_B pn ON bp.COL_B = pn.PK_ID JOIN TABLE_C vbo

Re: [SQL] TZ/tz not supported

2008-06-20 Thread Scott Marlowe
On Thu, Jun 19, 2008 at 11:51 PM, Peter Kovacs [EMAIL PROTECTED] wrote: The database version is 8.3.0. On a side note you should update to 8.3.3... -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Cross Tab Functions

2008-06-20 Thread Scott Marlowe
I wrote a real simple trunc() function fashioned after oracles but used some simple rules to let me have modulo date_trunc. I don't have the code anymore. I might sit down and refigure it out... On Fri, Jun 20, 2008 at 8:54 PM, Decibel! [EMAIL PROTECTED] wrote: Try using extract instead of

Re: [SQL] using calculated column in where-clause

2008-06-18 Thread Scott Marlowe
On Wed, Jun 18, 2008 at 1:35 PM, Fernando Hevia [EMAIL PROTECTED] wrote: -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Patrick Scharrenberg Enviado el: Martes, 17 de Junio de 2008 17:46 Para: pgsql-sql@postgresql.org Asunto: [SQL] using calculated

Re: [SQL] Nextval Currval

2008-06-10 Thread Scott Marlowe
On Tue, Jun 10, 2008 at 7:14 AM, Shavonne Marietta Wijesinghe [EMAIL PROTECTED] wrote: I managed to make the connection work. I tried inserting records from 2 computers. It works fine untill 2 computers insert a nextwall one after another. Here is a small example of what i see in my DB

Re: [SQL] help in writing query

2008-06-10 Thread Scott Marlowe
On Tue, Jun 10, 2008 at 11:51 AM, maria s [EMAIL PROTECTED] wrote: Hi Rosario, Thanks for the link. I hope this will solve my problem. It should be able to. Note that crosstab functions expect square inputs from the select they run. I.e. you can't have empty columns, you need to replace NULL

Re: [SQL] String comparison problem.

2008-05-29 Thread Scott Marlowe
On Thu, May 29, 2008 at 9:45 PM, Theerasak Maneeneim [EMAIL PROTECTED] wrote: Dear All, I have some problem with string comparison. I use postgresql 8.3.1,UTF8 encoding, on CentOS 5.5. Why dose the result of SQL statement : select '1.1' '101'; is false but select '1.1'::bytea

Re: [SQL] numbering rows on import from file

2008-05-02 Thread Scott Marlowe
On Fri, May 2, 2008 at 3:26 PM, Alexy Khrabrov [EMAIL PROTECTED] wrote: Greetings -- I have a huge table of the form (integer,integer,smallint,date). Its origin is an ASCII file which I load with \copy. Now I want to number the rows, adding an id column as an autoincrement from a sequence.

Re: [SQL] Protection from SQL injection

2008-04-26 Thread Scott Marlowe
On Sat, Apr 26, 2008 at 3:32 PM, Thomas Kellerer [EMAIL PROTECTED] wrote: Thomas Mueller wrote on 26.04.2008 18:32: Literals can still be used when using query tools, or in applications considered 'safe'. I fail to see how the backend could distinguish between a query sent by a query

Re: [SQL] Protection from SQL injection

2008-04-26 Thread Scott Marlowe
On Sat, Apr 26, 2008 at 9:42 PM, Tom Lane [EMAIL PROTECTED] wrote: Scott Marlowe [EMAIL PROTECTED] writes: Wouldn't it be much simpler to have a version of the libpq client lib that only understands prepared queries? You could do that, but there's still no way for it to know exactly how

Re: [SQL] First day of month, last day of month

2008-04-24 Thread Scott Marlowe
On Thu, Apr 24, 2008 at 8:43 AM, Nacef LABIDI [EMAIL PROTECTED] wrote: Actually I want to select all rows whith dates between first day of the month 00:00:00 and last date of the month 23:59:59 Then you can just use date_trunc on the values in the database. Plus if you're using timestamp

Re: [SQL] First day of month, last day of month

2008-04-24 Thread Scott Marlowe
On Thu, Apr 24, 2008 at 8:52 AM, Terry Lee Tucker [EMAIL PROTECTED] wrote: On Thursday 24 April 2008 10:47, Bart Degryse wrote: Well, that's what it does afaikt. And what does afaikt mean? As Far As I Kan Tell? ??? I'm used to AFAIR, As Far As I Rekall... :) -- Sent via pgsql-sql

Re: [SQL] First day of month, last day of month

2008-04-24 Thread Scott Marlowe
On Thu, Apr 24, 2008 at 9:10 AM, Fernando Hevia [EMAIL PROTECTED] wrote: De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Scott Marlowe Then you can just use date_trunc on the values in the database. Plus if you're using timestamp WITHOUT timezone, you can index

Re: [SQL] First day of month, last day of month

2008-04-24 Thread Scott Marlowe
On Thu, Apr 24, 2008 at 9:16 AM, Scott Marlowe [EMAIL PROTECTED] wrote: On Thu, Apr 24, 2008 at 9:10 AM, Fernando Hevia [EMAIL PROTECTED] wrote: De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Scott Marlowe Then you can just use date_trunc on the values

Re: [SQL] Get the last inserted id

2008-04-11 Thread Scott Marlowe
On Fri, Apr 11, 2008 at 11:23 AM, Nacef LABIDI [EMAIL PROTECTED] wrote: Hi all, I was wondering if postgres can return the last ID inserted for a table which the primary key is autoincremented. I need to retrieve this ID in my code to continue processing on that inserted row. smarlowe=#

Re: [SQL] Bouncing replies [was: SQL standards in Mysql]

2008-02-25 Thread Scott Marlowe
On Mon, Feb 25, 2008 at 3:29 PM, Dave Page [EMAIL PROTECTED] wrote: On Mon, Feb 25, 2008 at 9:08 PM, Dean Gibson (DB Administrator) [EMAIL PROTECTED] wrote: On 2008-02-22 21:34, Scott Marlowe wrote: Bouncing messages from a public list is kinda rude. No more so, than

Re: [SQL] Bouncing replies [was: SQL standards in Mysql]

2008-02-25 Thread Scott Marlowe
On Mon, Feb 25, 2008 at 9:01 PM, Dean K. Gibson [EMAIL PROTECTED] wrote: You are missing the point of why I do this. If it weren't for spammers No, I'm not. You're tilting at windmills. If you post to a public list, you will get spammed on that email address and there's not a lot you can do

Re: [SQL] Bounce test

2008-02-25 Thread Scott Marlowe
On Mon, Feb 25, 2008 at 9:24 PM, Tom Lane [EMAIL PROTECTED] wrote: Adrian Klaver [EMAIL PROTECTED] writes: On Monday 25 February 2008 7:13 pm, Dean Gibson (DB Administrator) wrote: I have changed something in my eMail client regarding receiving messages. If a couple people (who don't

Re: [SQL] Bounce test

2008-02-25 Thread Scott Marlowe
had to dig it outta the trash. Hit reply (there was no reply all) and it looks like it's going to the right place, pgsql-sql@postgresql.org (someone who hates top posting in technical discussions, but admits there's time, like these, when it makes perfect sense... :) On Mon, Feb 25, 2008 at 9:13

Re: [SQL] Bounce test

2008-02-25 Thread Scott Marlowe
On Mon, Feb 25, 2008 at 9:17 PM, Adrian Klaver [EMAIL PROTECTED] wrote: On Monday 25 February 2008 7:13 pm, Dean Gibson (DB Administrator) wrote: I have changed something in my eMail client regarding receiving messages. If a couple people (who don't mind getting bounces if this doesn't

Re: [SQL] Bounce test

2008-02-25 Thread Scott Marlowe
On Mon, Feb 25, 2008 at 9:54 PM, Adrian Klaver [EMAIL PROTECTED] wrote: So, your email client puts Dean's email address back in? Might I ask what option you chose? And if you have more than one? On gmail there's the reply link only. I hit Reply All which sends to the list and to

Re: [SQL] SQL standards in Mysql

2008-02-22 Thread Scott Marlowe
On Fri, Feb 22, 2008 at 1:57 PM, Alvaro Herrera [EMAIL PROTECTED] wrote: Ken Johanson wrote: Here's one Mysql developer's response to adding (fixing) the integer/bigint/tinyint types to their CAST function: http://bugs.mysql.com/bug.php?id=34562 So they are anal too, but in the

Re: [SQL] SQL standards in Mysql

2008-02-22 Thread Scott Marlowe
On Fri, Feb 22, 2008 at 7:39 PM, Dean Gibson (DB Administrator) [EMAIL PROTECTED] wrote: So, I went with PostgreSQL. Why? From the book, it was clear that MySQL lacked so many features of a decent SQL DB. In particular (at the time) VIEWs and sub-selects. Note that unless someone's done

Re: [SQL] SQL standards in Mysql

2008-02-22 Thread Scott Marlowe
On Fri, Feb 22, 2008 at 11:03 PM, Mail Delivery Subsystem [EMAIL PROTECTED] wrote: This is an automatically generated Delivery Status Notification Delivery to the following recipient failed permanently: [EMAIL PROTECTED] To: Dean Gibson (DB Administrator) [EMAIL PROTECTED] Look, if

Re: [SQL] Backward compatibility psql 8.1 to 8.2

2008-02-15 Thread Scott Marlowe
Up until 8.2 I never used packages because I ran RH or FC and built from source since 6.5.2 or so. I started using packages with ubuntu, and having 8.0, 8.1, and 8.2 installed at the same time, and it's wonderful for troubleshooting issues that might crop up between versions. The Debian / Ubuntu

Re: [SQL] inhibit rounding on numeric columns

2008-02-14 Thread Scott Marlowe
On Fri, Feb 15, 2008 at 1:28 AM, Horst Dehmer [EMAIL PROTECTED] wrote: Hi! Is there an easy way to enforce strict handling of numeric values with scales, i.e. raise an exception/error instead of rounding values to the specified scale? I can't think of an easy way. But you can always make

Re: [SQL] This SQL works under Mysql, not Postgresql.

2008-01-25 Thread Scott Marlowe
On Jan 25, 2008 10:11 AM, acec acec [EMAIL PROTECTED] wrote: I have the following sql, which works fine under mysql database: SELECT sa.ID, suv.TOTAL as VOICE_TOTAL, sus.TOTAL as SMS_TOTAL FROM SUB_ACCOUNT sa INNER JOIN SUBSCRIBER s ON (sa.ID = s.SUB_ACCOUNT_ID) LEFT JOIN (SERVICE suv,

Re: [SQL] age() function usage

2008-01-25 Thread Scott Marlowe
On Jan 25, 2008 1:06 PM, Marcin Krawczyk [EMAIL PROTECTED] wrote: Hi all. I am trying to determine the way to pass a variable/field value to an age() function, query looks something like: SELECT age(timestamp data_zakonczenia_fakt) FROM kip_pracownicy_umowy WHERE id_pracownika = 8

Re: [SQL] regex_replace problem -additional

2008-01-25 Thread Scott Marlowe
On Jan 25, 2008 10:19 AM, Gary Stainburn [EMAIL PROTECTED] wrote: Sorry, should have added that I tried type-casting to see if that fixed it. It didn't. Gary goole=# select distinct regex_replace(ud_rfl::text,' *= *'::text,'+'::text) \df regexp* List of

Re: [SQL] This SQL works under Mysql, not Postgresql.

2008-01-25 Thread Scott Marlowe
Please keep replies on list, others may have answers I do not. On Jan 25, 2008 10:29 AM, acec acec [EMAIL PROTECTED] wrote: --- Scott Marlowe [EMAIL PROTECTED] wrote: On Jan 25, 2008 10:11 AM, acec acec [EMAIL PROTECTED] wrote: I have the following sql, which works fine under mysql

Re: [SQL] Unclosed connections

2008-01-25 Thread Scott Marlowe
On Jan 25, 2008 10:02 AM, PostgreSQL Admin [EMAIL PROTECTED] wrote: We are using this bad piece of the software that does not close connections to the postgres server. Is there some setting for closing dead connections? And not TCP/IP keep alive does not work. If the TCP keepalive can't

Re: [SQL] ALTER TABLE mytable DROP CONSTRAINT IF EXISTS myconstraint ?

2008-01-24 Thread Scott Marlowe
On Jan 23, 2008 4:25 AM, Andreas Joseph Krogh [EMAIL PROTECTED] wrote: Does PG have any way of doing $subject without writing a plpgsql-function which does it by querying the catalog manually? No. ---(end of broadcast)--- TIP 6: explain analyze

Re: [SQL] date format

2008-01-24 Thread Scott Marlowe
On Jan 24, 2008 2:06 AM, iuri de araujo sampaio [EMAIL PROTECTED] wrote: hi, how to change the default format for type date? I have created a field on a table: ## create table tbl_inventory ( item_id integer constraint c_pk primary key, I. purchase_date date, II.

Re: [SQL] date format

2008-01-24 Thread Scott Marlowe
Please keep replies on list. Others might have input that will help. On Jan 24, 2008 11:24 AM, iuri de araujo sampaio [EMAIL PROTECTED] wrote: Yes, I am trying to insert the string ´2008 7 22´ as a date. and i can´t change the input format. Is that a edit the default format type date, in

Re: [SQL] Update PK Violation

2008-01-16 Thread Scott Marlowe
On Jan 16, 2008 8:30 AM, Achilleas Mantzios [EMAIL PROTECTED] wrote: Στις Tuesday 15 January 2008 23:03:49 ο/η Franklin Haut έγραψε: Hi all, i have a problem with one update sentence sql. A simple way i use: foodb=# update temp set num = num*1000 where num = 5; foodb=# insert into

Re: [SQL] Update PK Violation

2008-01-15 Thread Scott Marlowe
On Jan 15, 2008 3:03 PM, Franklin Haut [EMAIL PROTECTED] wrote: Hi all, i have a problem with one update sentence sql. example to produce: create table temp (num integer primary key, name varchar(20)); insert into temp values (1, 'THE'); insert into temp values (2, 'BOOK'); insert into

Re: [SQL] Re: How to keep at-most N rows per group? periodic DELETEs or constraints or..?

2008-01-09 Thread Scott Marlowe
On Jan 9, 2008 12:20 PM, Steve Midgley [EMAIL PROTECTED] wrote: This is kludgy but you would have some kind of random number test at the start of the trigger - if it evals true once per every ten calls to the trigger (say), you'd cut your delete statements execs by about 10x and still

Re: [SQL] Get the max(value1, value2, value3) from a table

2008-01-07 Thread Scott Marlowe
On Jan 7, 2008 4:03 PM, Emi Lu [EMAIL PROTECTED] wrote: Greetings, Version: PostgreSQL 8.0.13 on i686-pc-linux-gnu I have a table test(col1, col2, col3) For each row, I'd like to get the max(col1, col2, col3). For example, test(1, 5, 2) test(8, 1, 3) test(12,

Re: [SQL] Get the max(value1, value2, value3) from a table

2008-01-07 Thread Scott Marlowe
On Jan 7, 2008 4:27 PM, Richard Broersma Jr [EMAIL PROTECTED] wrote: --- On Mon, 1/7/08, Scott Marlowe [EMAIL PROTECTED] wrote: select max(col1) from table union all select max(col2) from table union all select max(col3) from table Would the following work also? SELECT MAX

Re: [SQL] PG is in different timezone than the OS

2008-01-02 Thread Scott Marlowe
On Jan 2, 2008 12:43 PM, Fernando Hevia [EMAIL PROTECTED] wrote: Hi all, I am not sure if this is the correct list to post this issue. Please let me know if there is a more suitable one. Argentina's government has recently decreted a timezone change for the summer (daylight's savings) where

Re: [SQL] PG is in different timezone than the OS

2008-01-02 Thread Scott Marlowe
Carrying on a convo with myself here. Looking in the timezone directory, and looking at the tz database located at ftp://elsie.nci.nih.gov/pub/ it appears the southamerica timezone data was updated 2007-12-13 at 9am or so. Looking through the file it looks like the change was made: # From

Re: [SQL] Argentinian timezone change at the last moment. How to change pgsql tz db?

2008-01-02 Thread Scott Marlowe
Wow! I just looked this up on the web, and all I can say is, this was a really stupid idea on the part of the govt in Argentina. It takes more than a couple days to create new timezone files and deploy them normally. I've been reading up on zic and wondering if it's a reasonable thing to try

Re: [SQL] Argentinian timezone change at the last moment. How to change pgsql tz db?

2008-01-02 Thread Scott Marlowe
On Jan 2, 2008 2:49 PM, Joe [EMAIL PROTECTED] wrote: Scott Marlowe wrote: I've been reading up on zic and wondering if it's a reasonable thing to try and update the pg tz db to include the new argentinian DST change. Where is the tz info stored in postgres? In the catalog? Typically

Re: [SQL] SELECT MAX returns wrong value

2007-12-14 Thread Scott Marlowe
On Dec 13, 2007 5:09 PM, Gavin Baumanis [EMAIL PROTECTED] wrote: Hi Everyone, Sorry if I am missing something obvious but I think I have found a bug. If I perform the following SQL SELECT MAX(column) FROM table WHERE expression and there is no match, Postgres returns a record count of 1.

Re: [SQL] Query design assistance - getting daily totals

2007-12-12 Thread Scott Marlowe
On Dec 12, 2007 12:39 AM, Paul Lambert [EMAIL PROTECTED] wrote: A. Kretschmer wrote: am Wed, dem 12.12.2007, um 10:34:35 +0900 mailte Paul Lambert folgendes: year_id integer month_id integer working_day integer Why this broken data types? We have date and timestamp[tz]. It's a

Re: [SQL] Using schema

2007-11-30 Thread Scott Marlowe
On Nov 30, 2007 9:00 AM, Daniel Caune [EMAIL PROTECTED] wrote: The cool thing with this, compared to the USE statement supported by some other RDBMS, is that the user is not restricted to one given schema without explicit schema declaration: SELECT * FROM foo; --

Re: [SQL] Obtaining the primary key of the record just inserted

2007-11-08 Thread Scott Marlowe
On Nov 8, 2007 11:56 AM, Oliveiros Cristina [EMAIL PROTECTED] wrote: Hello, All, I have the need to know the primary key assigned to a record I've just INSERTed . Is there an easy way to solve this ? Similar to SQLServer's SELECT scope_identity() ; ? In 8.2 and up: insert into table a

Re: [SQL] Computed table name in function

2007-10-10 Thread Scott Marlowe
On 10/10/07, Ray Madigan [EMAIL PROTECTED] wrote: I have a problem that I don't know where to look to understand the problem. I have a function that I first select to get a table name followed by another select into on that table name. If someone could tell me where to look to solve this

Re: [SQL] Intermittent Empty return

2007-09-22 Thread Scott Marlowe
On 9/22/07, John Mulkerin [EMAIL PROTECTED] wrote: I agree its old. I'm working on the upgrade but first need to verify and then purge some data. I tried with and without a semicolon However, with a semicolon results in Just tried semicolon again.. First time resulted in results.

Re: [SQL] Optimize querry sql

2007-09-14 Thread Scott Marlowe
On 9/14/07, A. Kretschmer [EMAIL PROTECTED] wrote: am Fri, dem 14.09.2007, um 8:36:47 -0500 mailte Scott Marlowe folgendes: On 9/14/07, A. Kretschmer [EMAIL PROTECTED] wrote: And use CURRENT_DATE instead now(). Out of curiosity, why the advice to switch from now() to CURRENT_DATE

Re: [SQL] How to influence the planner

2007-09-04 Thread Scott Marlowe
On 8/31/07, Richard Ray [EMAIL PROTECTED] wrote: Changing to enable_seqscan = on does solve this problem, thanks Is there some method of crafting a query that will assert my wishes to the planner When is enable_seqscan = off appropriate enable_xxx = off are troubleshooting tools. They

Re: [SQL] Postgres 7.4 function

2007-08-29 Thread Scott Marlowe
On 8/29/07, Radhika Sambamurti [EMAIL PROTECTED] wrote: Hi, I am using a function in postgres 7.4 that returns an integer. I modified my store procedure (same function and parameters) to point to another table, and return an int. But now I am not getting the correct answer only 0. I

Re: [SQL] Partial index and query plan

2007-08-22 Thread Scott Marlowe
On 8/22/07, Aleksandr Vinokurov [EMAIL PROTECTED] wrote: create table user_history ( rec_id SERIAL not null, date TIMESTAMPnot null, action INT2 not null, uid INT4 not null,

Re: [SQL] Make a SQL statement not run trigger

2007-08-21 Thread Scott Marlowe
On 8/21/07, Jon Collette [EMAIL PROTECTED] wrote: Is it possible to run an insert,update, or delete and have it not launch a trigger like it normally would? For example could I set a value DONOTRUN = True; insert into contacts The closest thing to a session variable for pgsql is going

Re: [SQL] Make a SQL statement not run trigger

2007-08-21 Thread Scott Marlowe
On 8/21/07, Jon Collette [EMAIL PROTECTED] wrote: I think this will work for what I need. I have been messing around with this using select into /select True as donothing into temporary table table_trigger_name; then run statement that I want to be ignored / The trigger would have a select

Re: [SQL] SELECT syntax synopsis: column_definition?

2007-08-21 Thread Scott Marlowe
On 8/21/07, Gregory Stark [EMAIL PROTECTED] wrote: Michael Glaesemann [EMAIL PROTECTED] writes: ERROR: a column definition list is only allowed for functions returning record So the *form* is right, but I don't know of an example that works. postgres=# create function testf() returns

Re: [SQL] Install two different versions of postgres which should run in parallel

2007-08-10 Thread Scott Marlowe
On 8/10/07, Loredana Curugiu [EMAIL PROTECTED] wrote: Hi all, I need to have two different vesions of postgres running in parallel on different ports. Does anyone knows how to install two different versions of postgres (7.4.5 and 8.2.4) on the same computer? I am using Linux operating

Re: [SQL] Race condition in resetting a sequence

2007-08-10 Thread Scott Marlowe
On 8/4/07, Lew [EMAIL PROTECTED] wrote: Steve Midgley writes: The code I provided to reset a primary key sequence is actually part of Ruby on Rails core library - actually they use something very similar to what I originally sent: ... SELECT setval('#{sequence}', (SELECT

Re: [SQL] foreign key pointing to diff schema?

2007-08-10 Thread Scott Marlowe
On 8/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all. Can i make a FK who points a table in a different schema? Or this is implemented via a trigger by my own? Sure. just prefix the table name with the schemaname and a . create schema abc; alter user me set search_path='abc',

<    1   2   3   4   >