Re: [GENERAL] sequence aliases?

2005-11-05 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > My advice to the Rails people would be to fix whatever it is in their > code that is assuming a particular sequence name, or indeed assuming > a sequence at all... Well how else do you find the id of the last inserted record without assuming a sequence? --

Re: [GENERAL] sequence aliases?

2005-11-05 Thread Tom Lane
CSN <[EMAIL PROTECTED]> writes: > I'm checking out Ruby on Rails and there's a tutorial > about using Postgresql views and making them > updateable > (http://wiki.rubyonrails.com/rails/pages/HowtoUsePostgresViewsAsTables). > The tutorial suggests renaming the sequence for the > table to coincide wi

Re: [GENERAL] Setting max_fsm_pages

2005-11-05 Thread Tom Lane
"Carlos Oliva" <[EMAIL PROTECTED]> writes: > Should I set the max_fsm_pages to the value reported (vacuum verbose) as > pages stored or the value reported as total pages needed? Total pages needed ... if not more. regards, tom lane ---(end of broad

[GENERAL] Setting max_fsm_pages

2005-11-05 Thread Carlos Oliva
Should I set the max_fsm_pages to the value reported (vacuum verbose) as pages stored or the value reported as total pages needed?  I ran full + analyze vacuums in my database (vacuumdb –f –z –v ) a couple of times and I got the following reports: INFO:  free space map: 454 relations, 2227

[GENERAL] sequence aliases?

2005-11-05 Thread CSN
I'm checking out Ruby on Rails and there's a tutorial about using Postgresql views and making them updateable (http://wiki.rubyonrails.com/rails/pages/HowtoUsePostgresViewsAsTables). The tutorial suggests renaming the sequence for the table to coincide with the view so that Rails can automatically

Re: [GENERAL] pl/pgsql list as parameter.

2005-11-05 Thread Assad Jarrahian
I am still unclear of how this works. Please help! I really would appreciate this. This is what I have so far: CREATE TYPE tp_lm_object AS(  . ); CREATE OR REPLACE FUNCTION getLMs(int[],float(8), float(8)) RETURNS SETOF tp_lm_object AS $$ DECLARE     myrec record;     requestIds

Re: [GENERAL] Missing variable "role" in "pg_settings"?

2005-11-05 Thread Florian G. Pflug
Tom Lane wrote: "Florian G. Pflug" <[EMAIL PROTECTED]> writes: The per-session variable "role" is not shown when doing "select pg_settings". It is, however, possible to set it using "set role ...", and to query it using "show role". Is this per design, or is this a bug. It's marked NO_SHOW_AL

Re: [GENERAL] joining a query with a select count(*)

2005-11-05 Thread John Sidney-Woollett
I think that something like this should work for you SELECT child_pk, coalesce(cnt, 0) FROM childtable c left outer join ( SELECT child_fk, count(*) as cnt FROM grandchildtable GROUP BY child_fk ) t ON (c.child_pk= t.child_fk); IMHO, if Postgres had Oracle's (+) notation these would be a lot eas

Re: [GENERAL] Duplicate Row Removal

2005-11-05 Thread Berend Tober
Dean Gibson (DB Administrator) wrote: CREATE TABLE new_name AS SELECT DISTINCT * FROM old_name; DROP TABLE old_name; ALTER TABLE new_name RENAME TO old_name; The problem with this technique is that it doesn't account for indexes, foreign key references, and other dependencies. Another ap

Re: [GENERAL] Missing variable "role" in "pg_settings"?

2005-11-05 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > The per-session variable "role" is not shown when > doing "select pg_settings". It is, however, possible > to set it using "set role ...", and to query it using > "show role". Is this per design, or is this a bug. It's marked NO_SHOW_ALL in guc.c.

Re: [GENERAL] joining a query with a select count(*)

2005-11-05 Thread Martijn van Oosterhout
On Sat, Nov 05, 2005 at 01:10:13PM -0500, Matthew Terenzio wrote: > > I want a query to return all the rows from one table along with a count > of rows in another table that reference each returned row from the > first table. Quick and dirty, should give you the idea... select *, (select count

[GENERAL] joining a query with a select count(*)

2005-11-05 Thread Matthew Terenzio
I want a query to return all the rows from one table along with a count of rows in another table that reference each returned row from the first table. For instance, if you had a table of children and another table of grandchildren that had a foreign key on the children table, I'd want to r

[GENERAL] Missing variable "role" in "pg_settings"?

2005-11-05 Thread Florian G. Pflug
Hi The per-session variable "role" is not shown when doing "select pg_settings". It is, however, possible to set it using "set role ...", and to query it using "show role". Is this per design, or is this a bug. I stumbled over this issue, because pgadmin3 lets you do "alter user set set role "

Re: [GENERAL] Postgresql connection on suse 10

2005-11-05 Thread Andreas Kretschmer
Michal Hlavac <[EMAIL PROTECTED]> schrieb: > Leonel Nunez wrote: > > edit your postgresql.conf and set the listen_address variable > > to your needs > > thanks Leonel, > > it is possible to setup subnet mask for postgresql through listen_address?? Yes, of course, in CIDR-Notation. H

Re: [GENERAL] Postgresql connection on suse 10

2005-11-05 Thread Michal Hlavac
Leonel Nunez wrote: > edit your postgresql.conf and set the listen_address variable > to your needs thanks Leonel, it is possible to setup subnet mask for postgresql through listen_address?? thanks, miso ---(end of broadcast)--- TIP 3: H