[GENERAL] How to insert into 2 tables from a view?

2014-12-23 Thread Chris Hoover
Hi, I am having a problem trying to figure out. I have two tables behind a view and am trying to figure out how to create the correct insert rule so that inserting into the view is redirected to the two tables. I thought I had is solved using a stored procedure, but doing an insert into view

Re: [GENERAL] How to insert into 2 tables from a view?

2014-12-23 Thread Chris Hoover
) values ('field1', 'field2') returning table1_id; On Tue, Dec 23, 2014 at 1:46 PM, Chris Hoover revo...@gmail.com wrote: Hi, I am having a problem trying to figure out. I have two tables behind a view and am trying to figure out how to create the correct insert rule so that inserting

[GENERAL] PGCon 2008, Are you going?

2008-04-02 Thread Chris Hoover
Hey everyone, Are you going to PGCon 2008? If so, where are you staying. My company has decided to send me, and I am just wondering where to stay. Based on price, it looks like on the University of Ottawa campus, or the Quality Inn are my two choices (the third hotel is more than I am allotted

[GENERAL] Help with date math

2007-07-21 Thread Chris Hoover
I need some help. I am trying to replicate a function from Sybase ASA, and am having difficulty. I need to be able to subtract 2 date (or timestamps) and return the results expressed in days, weeks, month, quarters, or years. How do I do this? I believe Postgres is returning the number of

Re: [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-21 Thread Chris Hoover
On 7/20/07, Tom Lane [EMAIL PROTECTED] wrote: I guess what we need to do is hack the emergency-recovery path for error-during-error-processing such that it will prevent trying to print a very long debug_query_string. Maybe we should just not try to print the command at all in this case, or

Re: [GENERAL] unexpected shutdown

2007-06-18 Thread Chris Hoover
On 6/18/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: My database has shutdown several times in the last couple days. I have no idea why. I am running centos and I have not rebooted the server or made any configuration changes. I am running postgres 8.2 and it has been stable since I

[GENERAL] how to get number of minutes?

2006-10-06 Thread Chris Hoover
If I subtract 2 timestamps, how do I get the results returned as the total number of minutes.examplenow() - (now()-'2 hours'::interval) = 2:00:00 -- I need the result returned as 120 minutes.Thanks, Chris

[GENERAL] Fwd: Help with function

2006-10-04 Thread Chris Hoover
I did not see this go through.Chris-- Forwarded message --From: Chris Hoover [EMAIL PROTECTED] Date: Oct 3, 2006 4:49 PMSubject: Help with functionTo: pgsql-general@postgresql.orgI need some help with writing a plpgsql function. I want to return multiple items from the function

[GENERAL] Help with function

2006-10-04 Thread Chris Hoover
I need some help with writing a plpgsql function. I want to return multiple items from the function. How do I do this?Here is my attempt at the function (note, this is a simple example that could obviously be done via a view, but I am trying to learn more about writing plpgsql functions): create

[GENERAL] How to trace index to table?

2006-10-02 Thread Chris Hoover
I'm trying to build some queries to gather metrics on my PG database. When looking at pg_class and pulling a row that is an index, how do I use sql to pull the table the index belongs to?Thanks,Chris

[GENERAL] Fwd: How to convert a string to bytea?

2006-08-30 Thread Chris Hoover
-- Forwarded message --From: Chris Hoover [EMAIL PROTECTED]Date: Aug 30, 2006 12:22 PM Subject: How to convert a string to bytea?To: pgsql-admin@postgresql.org pgsql-admin@postgresql.org I am in need of some help. I need to use the encode function against a text string in one of my

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-22 Thread Chris Hoover
It appears that 8.1 is stricter on checking the type of function. Look at your user_tracking function. It is probably set as volatile. You need to change it to be immutable.This should fix the issue.Chris On 8/21/06, Arturo Perez [EMAIL PROTECTED] wrote: Hi all, Using postgresql

[GENERAL] Why is default value not working on insert?

2006-08-08 Thread Chris Hoover
I have the following table:CREATE TABLE code_source( csn_src int4 NOT NULL, csn_type varchar(8) NOT NULL, cs_code varchar(15) NOT NULL, cs_desc_short varchar(30), cs_desc_long text, cs_remarks varchar(20), cs_work_flag char(1), cs_status char(1), cs_manual_key bool NOT NULL DEFAULT false,

[GENERAL] Join Question

2006-08-02 Thread Chris Hoover
Question,What is the difference between left join, and left outer join?I know the difference between inner and outer joins, but I was thinking that left join == inner join. But from what I am now seeing, it appears that PG is equating left join to left outer join. Is this correct? Thanks,Chris

[GENERAL] Can you run out of oids?

2006-08-01 Thread Chris Hoover
Somewhat silly question, but is it possible to run out of OID's?Since we upgraded to 8.1.3, I noticed that I can create tables without an oid column. I am wondering if I should consider trying to rebuild the existing tables to be built without OID. If it is possible to run out of OID's, how can

[GENERAL] Splitting Timestamps

2006-07-25 Thread Chris Hoover
I have several columns in my database that are timestamps. My developers are asking me how to split the timestamp so that they can look at either the date or at the time portion.I know I can do a select to_date(now(),'-mm-dd') and it will return the date. However, how do I get the time? Also,

[GENERAL] tsearch2

2006-06-14 Thread Chris Hoover
I have some general questions on tsearch2. How do you set it up to search for how now brown cow vs how now brown cow? The first example is looking for the exact phrase of words, while the second is just looking for all of the works. Secondly, if you want to split a text field based on multiple