Re: [SQL] Adding on delete cascade to all foreign key constraints

2007-05-15 Thread Jim C. Nasby
On Tue, May 15, 2007 at 12:19:54PM -0500, Peter Hanson wrote: Hello, I was wondering if there's a fast way I can add on delete cascade to all foreign key constraints in my database? Maybe a quick update I can make against the catalog possibly? Or is there a way I can query for all foreign

Re: [SQL] [ADMIN] Is there anyway to...

2006-11-07 Thread Jim C. Nasby
Moving to -general (and please start a new thread instead of hijacking an existing one). On Thu, Nov 02, 2006 at 01:14:22PM -0500, louis gonzales wrote: Hello all, Is there an existing mechanism is postgresql that can automatically increment/decrement on a daily basis w/out user interaction?

Re: [SQL] Can we convert from Postgres to Oracle !!???

2006-10-26 Thread Jim C. Nasby
On Sun, Oct 22, 2006 at 12:03:38AM +0300, Devrim GUNDUZ wrote: On Tue, 2006-10-17 at 14:21 +0530, Sandeep Kumar Jakkaraju wrote: Can we convert from Postgres to Oracle !!??? You can also run our software and get Oracle syntax for 1/25th the cost. -- Jim Nasby

Re: [SQL] [HACKERS] Bug?

2006-10-19 Thread Jim C. Nasby
See section 9.12 of the docs. On Thu, Oct 19, 2006 at 12:28:58PM +0530, Indira Muthuswamy wrote: Then how do we clear the values of a serial column(is it done only by dropping the column?)? Regards, M.Indira On 10/19/06, Jim C. Nasby [EMAIL PROTECTED] wrote: Moving to -sql

Re: [SQL] Grouping by day, limiting amounts

2006-10-19 Thread Jim C. Nasby
On Thu, Oct 19, 2006 at 01:51:55PM +0200, Mezei Zolt??n wrote: Hi, I didn't really know what subject I should give. I have a table like this one: 2006.10.01.Bela10 2006.10.01.Aladar9 2006.10.01.Cecil8 2006.10.01.Dezso7 2006.10.01.Elemer6

Re: [SQL] [HACKERS] Bug?

2006-10-18 Thread Jim C. Nasby
Moving to -sql. On Wed, Oct 18, 2006 at 06:53:46PM +0530, Indira Muthuswamy wrote: Hai, I have encountered a problem with PostgreSQL.I have created a table 'tab1' with a column 'a' with serial type.I entered 20 records into the table.So the query select max(a) from tab1; returned 20.When

Re: [SQL] hi i want help on levels

2006-10-18 Thread Jim C. Nasby
Search the archives for hierarchical query. -- Jim Nasby[EMAIL PROTECTED] EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] Temp tables and functions

2006-10-10 Thread Jim C. Nasby
On Tue, Oct 10, 2006 at 03:21:36PM -0400, [EMAIL PROTECTED] wrote: Everyone, I've written a function (language = sql) which uses a temporary table to simplify the process; however, when I go to load the function I get: /var/lib/pgsql$cat thm.sql | psql test ERROR: relation lost_bus does

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-09 Thread Jim C. Nasby
On Mon, Oct 09, 2006 at 02:57:28PM -0500, Aaron Bono wrote: On 10/5/06, Jim Nasby [EMAIL PROTECTED] wrote: On Oct 5, 2006, at 11:50 AM, Tom Lane wrote: regression=# select ('2006-09-15 23:59:00'::timestamp - '2006-09-01 09:30:41'::timestamp); ?column? -- 14 days

Re: [SQL] files or DataBase

2006-09-28 Thread Jim C. Nasby
On Fri, Sep 29, 2006 at 12:37:56AM +0200, tomcask o_o wrote: Hi in advance, sorry for my english. in a Web server as is the best option? to accede to db to show the contents or to accede to static files modified by scripts when the content of db has been modified. That the habitual

Re: [SQL] pgxml xpath_table

2006-06-08 Thread Jim C. Nasby
System rte de la Fonderie 2 1700 Fribourg Switzerland http://www.attiksystem.ch Tel: +41 (26) 422 13 75 Fax: +41 (26) 422 13 76 -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http

Re: [SQL] (Ab)Using schemas and inheritance

2006-05-23 Thread Jim C. Nasby
that should be identical, you'll need to perform any DDL 1000 times. But as you point out, there's some interesting advantages to using schemas like this. -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http

Re: [SQL] Migrating a Database to a new tablespace

2006-04-26 Thread Jim C. Nasby
to be a useful extension, especially on windows, which AFAIK doesn't have an equivalent to ``. -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

Re: [SQL] LinkedList

2006-04-26 Thread Jim C. Nasby
of broadcast)--- TIP 6: explain analyze is your friend -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

Re: [SQL] Migrating a Database to a new tablespace

2006-04-24 Thread Jim C. Nasby
in EU! www.ffii.org www.nosoftwarepatents.org ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive

Re: [SQL] Expressing a result set as an array (and vice versa)?

2006-03-27 Thread Jim C. Nasby
array()? -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 ---(end of broadcast)--- TIP 9: In versions

Re: [SQL] SQL Query Newbie Help

2006-03-27 Thread Jim C. Nasby
by qualitycontrolrange) T2 on (T.qualitycontrolrange = T2.qualitycontrolrange and T.date=T2.date); BTW, I believe the new row operator fixes in 8.2 make it possible to use them to do this kind of thing as well... -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive

Re: [SQL] Question about One to Many relationships

2006-03-27 Thread Jim C. Nasby
. This opens another can of worms... I would use the following tables : BTW, if you're going to be writing code to manage stuff like this, you should absolutely check out the source for http://musicbrainz.org/, which uses PostgreSQL as it's backend. -- Jim C. Nasby, Sr. Engineering Consultant

Re: [SQL] Find min and max values across two columns?

2006-03-27 Thread Jim C. Nasby
, column_b) ... There may be a difference in performance between the two. -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

Re: [SQL] unique names in variables and columns in plsql functions

2006-03-27 Thread Jim C. Nasby
for general variables. -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 ---(end of broadcast

Re: [SQL] unique names in variables and columns in plsql functions

2006-03-27 Thread Jim C. Nasby
confusing. BTW, I believe SELECT investment_products.provider_id would work here, but I'm too lazy to test that theory out. -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net

Re: [SQL] Replication - state of the art?

2006-03-01 Thread Jim C. Nasby
)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard

Re: [SQL] Problem with query on history table

2006-03-01 Thread Jim C. Nasby
: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

Re: [SQL] Does VACUUM reorder tables on clustered indices

2005-12-20 Thread Jim C. Nasby
tuples from the tables. Note that while reordering, CLUSTER also gets rid of dead tuples, so if you cluster you don't need to vacuum. It also does a REINDEX... -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117

Re: [SQL] Does VACUUM reorder tables on clustered indices

2005-12-20 Thread Jim C. Nasby
cluster you don't need to vacuum. It also does a REINDEX... -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 ---(end

Re: [SQL] [GENERAL] A Not Join

2005-11-01 Thread Jim C. Nasby
, this is probably better asked on pgsql-sql. -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 ---(end of broadcast

Re: [SQL] Nested Table in PostgreSQL or some alternative Variants

2005-11-01 Thread Jim C. Nasby
' the postmaster -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 ---(end of broadcast)--- TIP 1

Re: [SQL] How to speed up the database query?

2005-10-27 Thread Jim C. Nasby
tableA. any help, prettymuch appreciated. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.com

Re: [DOCS] [SQL] Update timestamp on update

2005-10-13 Thread Jim C. Nasby
go look at the PL languages first, but obviously it's not getting the job done. Chapter 35 is plpgsql.. do you mean chapter 32.4? Anybody have a better idea? What about a See Also section ala man pages that links to trigger info for other languages? -- Jim C. Nasby, Sr. Engineering Consultant

Re: [SQL] Help with multistage query

2005-10-04 Thread Jim C. Nasby
, t2 where t1.id = t2.id and t1.id = condition Actually, I think you want AND t2.x condition, not t1.id. BTW, I recommend not using id as a bareword field name. Very easy to get confused when you start joining a bunch of stuff together. -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL

Re: [SQL] Why doesn't the SERIAL data type automatically have a

2005-10-04 Thread Jim C. Nasby
C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.comwork: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 ---(end of broadcast)--- TIP 2: Don't 'kill -9

Re: [SQL] Why doesn't the SERIAL data type automatically have a

2005-10-04 Thread Jim C. Nasby
think either assertion is true. I'd bet most of the developers actually do normally use an index on a serial, since it's normally used as a PK. And while people can be a bit terse with their replies, I wouldn't say you were blasted. :) -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED

Re: [SQL] [PHP] [ADMIN] Data insert

2005-08-22 Thread Jim C. Nasby
individual transactions. -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Softwarehttp://pervasive.com512-569-9461 ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire