Re: [GENERAL] Good candidate query for window syntax?

2010-09-10 Thread Ketema Harris
html > > > > -- > > Jorge Godoy > > > > > > > > On Fri, Sep 10, 2010 at 10:03, Ketema Harris wrote: > > > Hello, I have a table defined as: > > > > > CREATE TABLE demo AS > > > ( > > >id serial PRIMARY KEY, > > >

[GENERAL] Good candidate query for window syntax?

2010-09-10 Thread Ketema Harris
Hello, I have a table defined as: CREATE TABLE demo AS ( id serial PRIMARY KEY, start_time timestamp without timezone, duration integer ) A sample data set I am working with is: start_time | duration | end_time -+--+---

Re: [GENERAL] could you tell me this..?

2010-08-05 Thread Ketema Harris
Never kill -9. Use kill -INT, whatever signal num that is, 11? Sent from my iPhone On Aug 5, 2010, at 3:14 AM, 백승엽 wrote: > Hi. > > > I am korean database engineer. > > my english skill is very poor. > > but i desire that you teach this situation. > > > um... > > I am testing pos

Re: [GENERAL] [PHP] Some undefined function errors

2010-05-20 Thread Ketema Harris
you might want to also check your architecture flags for your compiler. i ran into this problem on a mac when I was compiling php and by default it tries to make a 32 bit and 64 bit binary, but pg was compiled as 64 bit only. I found that the php compile did not fail, but i was "missing" some f

Re: [GENERAL] Grouping Question

2009-07-31 Thread Ketema Harris
years don't get merged together Ketema Harris wrote: I have a table defined as CREATE TABLE mytable ( carrier varchar, start_time timestamp with time zone, call_date date, cost numeric, call_length numeric ) I want to create a query that will generate a the following columns: carrier,

[GENERAL] Grouping Question

2009-07-31 Thread Ketema Harris
I have a table defined as CREATE TABLE mytable ( carrier varchar, start_time timestamp with time zone, call_date date, cost numeric, call_length numeric ) I want to create a query that will generate a the following columns: carrier, week, sum(call_length) as totallength, sum(cost) as

Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Ketema Harris
Use dollar quoting around your fiction body I'd double up on the single quotes around the dash Sent from my iPhone On Feb 20, 2009, at 8:14 AM, Eus wrote: Hi Ho! Sorry, let me revise the query a bit. I copied and pasted the original one from another big query. --- On Fri, 2/20/09, Eus

Re: [GENERAL] unable to assign value to composite column in trigger

2008-12-18 Thread Ketema Harris
On Dec 18, 2008, at 4:19 PM, Ketema Harris wrote: The following is a snippet from a trigger i am using: _mycompositeType.user_id = (OLD).mycompositeType.user_id; ...do some stuff... --notice that assigning from the trigger record works but later on... (new).mycompositeType.transaction_id

[GENERAL] unable to assign value to composite column in trigger

2008-12-18 Thread Ketema Harris
The following is a snippet from a trigger i am using: _mycompositeType.user_id = (OLD).mycompositeType.user_id; ...do some stuff... --notice that assigning from the trigger record works but later on... (new).mycompositeType.transaction_id := _transaction_id; Fails with syntax error at or n

[GENERAL] Composite type evaluates to Null if any element is null

2008-12-17 Thread Ketema Harris
I have just re-read chapter 8.15 of the 8.3 manual and I am understanding why a composite type would evaluate to NUll if any of it elements are null. Can anyone explain this behavior? To me if I have a composite type column and there are some values in it, its incomplete, yes, but not nu

Re: [GENERAL] View vs Constantly Updated Table

2008-12-16 Thread Ketema Harris
> How often are you using the "bank balance" value? I have no data on this as of yet, but it obviously needs to be correct for when the user looks at it. > The opposite argument, is how long does the computation take? The computation is simple, however the amount of data that goes into it g

[GENERAL] Trigger/Rules Order of operations

2008-12-15 Thread Ketema Harris
I am interested in finding out the pros, cons, pitfalls of using the following design: Manual insert into Table A. Table A has a BEFORE INSERT trigger that causes an insert to table B. Table B has an AFTER INSERT trigger that causes an insert back to table A (With different criteria not an en

[GENERAL] View vs Constantly Updated Table

2008-12-15 Thread Ketema Harris
if i have a "column" that is a calculation, say a bank balance -> sum of all the debits and credits...is it more efficient to make a view that executes the underlying calc query doing the math, or to create a table that has a column called balance that is updated for each transaction? so

[GENERAL] Inherited FK Indexing

2007-09-14 Thread Ketema Harris
I have the following table set up: CREATE TABLE states ( state_id integer NOT NULL DEFAULT nextval ('state_province_id_seq'::regclass), state character(2), full_name character varying, timezone character varying, CONSTRAINT "PK_state_id" PRIMARY KEY (state_id) ) CREATE TABLE canadian

[GENERAL] Best Data type for Binary Data?

2006-01-05 Thread Ketema Harris
Hi, I would like to store binary data from a tcpdump (libpcap) file in a table. What is the best type to use? i have read posts saying lo, oid, and bytea. Which one would be best for this scenario?Thanks, ketema