Re: [SQL] TG_TABLE_NAME as identifier

2008-02-06 Thread Richard Huxton
Tiziano Slack wrote: Thanks for the precious tips, but unfortunately the syntax: EXECUTE 'INSERT INTO '|| TG_TABLE_NAME ||' SELECT '|| NEW.*;is parsed correctly, but when the trigger is fired the following error is returned ERROR: column "*" not found in data type mytable CONTEXT: SQL stateme

Re: [SQL] TG_TABLE_NAME as identifier

2008-02-06 Thread Tiziano Slack
Thanks for the precious tips, but unfortunately the syntax: EXECUTE 'INSERT INTO '|| TG_TABLE_NAME ||' SELECT '|| NEW.*;is parsed correctly, but when the trigger is fired the following error is returned ERROR: column "*" not found in data type mytable CONTEXT: SQL statement "SELECT 'INSERT INT

Re: [SQL] accounting schema

2008-02-06 Thread Steve Midgley
At 06:54 PM 2/6/2008, Medi Montaseri wrote: Thanks Steve... And finally you mentioned that bank accounts are tricky...can you expand on this please. After all I am under the impression that "bank accounts" are a corner stone of this whole book keeping...I mean...bank accounts have debits and

Re: [SQL] accounting schema

2008-02-06 Thread Robert Edwards
Medi Montaseri wrote: Hi, I am learning my way into Accounting and was wondering how Accounting applications are designed. perhaps you could point the way On one hand, accountants talk about a sacret equation A = L + OE (Asset = Libility + Owner Equity) and then under each categories the

Re: [SQL] accounting schema

2008-02-06 Thread Medi Montaseri
Thanks Steve... This is all well and good...I am getting it...but I need to chew on it moregnucash was a good one...didn't think of thatgot to get passed all the GUI stuff...but...excellent ref... I suppose instead of AR and AP tables, I can just have one table called Entry (thanks Joe

Re: [SQL] accounting schema

2008-02-06 Thread Steve Midgley
At 05:09 PM 2/6/2008, [EMAIL PROTECTED] wrote: Date: Wed, 6 Feb 2008 17:08:54 -0800 From: "Medi Montaseri" <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org Subject: accounting schema Message-ID: <[EMAIL PROTECTED]> Hi, I am learning my way into Accounting and was wondering how Accounting appl

Re: [SQL] Information schema permissions

2008-02-06 Thread johnf
On Wednesday 06 February 2008 03:37:22 pm Tom Lane wrote: > johnf <[EMAIL PROTECTED]> writes: > > Assume a standard install on Linux (what ever that means). Would a > > normal user have access to information schema? I have a front end > > written in python that accesses tables and permissions are

[SQL] accounting schema

2008-02-06 Thread Medi Montaseri
Hi, I am learning my way into Accounting and was wondering how Accounting applications are designed. perhaps you could point the way On one hand, accountants talk about a sacret equation A = L + OE (Asset = Libility + Owner Equity) and then under each categories there are one or many account.

Re: [SQL] Create Table xtest (like xtype)

2008-02-06 Thread TJ O'Donnell
Considering how related Created Types and Tables are (at least conceptually) it seems like a good idea to allow Created Types to be used in the Like clause. At least it would help me and make maintaining my db easier and cleaner. TJ O'Donnell http://www.gnova.com/ > "TJ O'Donnell" <[EMAIL PROTECT

Re: [SQL] Information schema permissions

2008-02-06 Thread Tom Lane
johnf <[EMAIL PROTECTED]> writes: > Assume a standard install on Linux (what ever that means). Would a normal > user have access to information schema? I have a front end written in python > that accesses tables and permissions are set based on roles. But I do > nothing with respect to the in

Re: [SQL] Create Table xtest (like xtype)

2008-02-06 Thread Tom Lane
"TJ O'Donnell" <[EMAIL PROTECTED]> writes: > Create Type xtype As (a Integer, b Text); > Create Table xtest (Like xtype); > ERROR: "xtype" is a composite type Hmmm ... as you see, that's disallowed, but offhand it seems like it wouldn't be very hard to allow it. It might be as simple as relaxing

Re: [SQL] outer join issues

2008-02-06 Thread Tom Hart
Colin Wetherbee wrote: Tom Hart wrote: Let me preface this by saying hello SQL list, and I'm an idiot. My SQL knowledge is advanced to the point of being able to use a WHERE clause basically, so I appreciate your business. Now on to my issue I have 3 tables I'm trying to use in this query: lo

Re: [SQL] outer join issues

2008-02-06 Thread Terry Fielder
Tom Hart wrote: Let me preface this by saying hello SQL list, and I'm an idiot. My SQL knowledge is advanced to the point of being able to use a WHERE clause basically, so I appreciate your business. Now on to my issue I have 3 tables I'm trying to use in this query: loan, share and draft (

Re: [SQL] outer join issues

2008-02-06 Thread Colin Wetherbee
Tom Hart wrote: Let me preface this by saying hello SQL list, and I'm an idiot. My SQL knowledge is advanced to the point of being able to use a WHERE clause basically, so I appreciate your business. Now on to my issue I have 3 tables I'm trying to use in this query: loan, share and draft (fo

[SQL] outer join issues

2008-02-06 Thread Tom Hart
Let me preface this by saying hello SQL list, and I'm an idiot. My SQL knowledge is advanced to the point of being able to use a WHERE clause basically, so I appreciate your business. Now on to my issue I have 3 tables I'm trying to use in this query: loan, share and draft (for those of you no

Re: [SQL] Double query

2008-02-06 Thread D'Arcy J.M. Cain
On Wed, 06 Feb 2008 16:01:09 -0500 PostgreSQL Admin <[EMAIL PROTECTED]> wrote: > I want to find any value: > > SELECT id FROM schedule WHERE clinic_id = '%s' AND date = '%s' > > But I want to make sure the clinic exist first then find if the date > exist 2nd. I'm not sure what you mean by "firs

[SQL] Information schema permissions

2008-02-06 Thread johnf
Assume a standard install on Linux (what ever that means). Would a normal user have access to information schema? I have a front end written in python that accesses tables and permissions are set based on roles. But I do nothing with respect to the information schema view. I would like my pr

[SQL] Double query

2008-02-06 Thread PostgreSQL Admin
Simple question - but my brain is not working: This is my table Column | Type | Modifiers ---++- id| integer

Re: [SQL] Columns view? (Finding column names for a table)

2008-02-06 Thread Thomas Kellerer
Steve Midgley wrote on 06.02.2008 21:33: Hi, I see this documentation item but can't figure out how to use it: http://www.postgresql.org/docs/8.2/interactive/infoschema-columns.html The view columns contains information about all table columns (or view columns) in the database. select colum

[SQL] Columns view? (Finding column names for a table)

2008-02-06 Thread Steve Midgley
Hi, I see this documentation item but can't figure out how to use it: http://www.postgresql.org/docs/8.2/interactive/infoschema-columns.html The view columns contains information about all table columns (or view columns) in the database. However, if I execute "select columns;" I get a not fo

[SQL] Create Table xtest (like xtype)

2008-02-06 Thread TJ O'Donnell
I know I can create a table using names and types from an existing table. Create Table xtable (a Integer, b Text); Create Table xtest (Like xtable); This works just fine. I want to create a table having the same column names and types as an existing new datatype. Create Type xtype As (a Intege

Re: [SQL] undefined relations in pg_locks

2008-02-06 Thread Guillaume Lelarge
Sabin Coanda wrote: Hi there, I have a procedure where a dead-lock occurs, and I'm trying to find the tables involved in the lock. Unfortunatelly, I don't find the related objects of the oids of "relation" field. Also all the fields "classid" and "objid" are null. May I suppose there were

[SQL] undefined relations in pg_locks

2008-02-06 Thread Sabin Coanda
Hi there, I have a procedure where a dead-lock occurs, and I'm trying to find the tables involved in the lock. Unfortunatelly, I don't find the related objects of the oids of "relation" field. Also all the fields "classid" and "objid" are null. May I suppose there were references to temporary