Re: [GENERAL] help with locked table(s)/transactions(s)

2006-01-31 Thread Tom Lane
Mott Leroy <[EMAIL PROTECTED]> writes: > Will postgres lock on all rows as it goes through this loop? Or can you > give me a better idea of what I can expect to be locked in my example? SELECTs don't lock any rows. INSERTs don't create any lockable rows in themselves (other backends can't even s

Re: [GENERAL] help with locked table(s)/transactions(s)

2006-01-31 Thread Mott Leroy
Tom Lane wrote: No, the ShareLock is the means used when transaction A needs to wait for transaction B to complete --- it tries to take a share lock on xact B's XID, which of course is blocked as along as B is holding its ExclusiveLock. This is used when there is a row-update conflict, ie, A wan

Re: [GENERAL] help with locked table(s)/transactions(s)

2006-01-31 Thread Tom Lane
Mott Leroy <[EMAIL PROTECTED]> writes: > One thing I noticed is it seems like for every transaction lock there's > an "ExclusiveLock" (to be expected, a lock on the transaction num) as > well as a "ShareLock" on the same transaction which has not been granted > the lock -- does this mean that tw

[GENERAL] help with locked table(s)/transactions(s)

2006-01-31 Thread Mott Leroy
Recently we discovered that a stored procedure that we run locks some table(s) and prevents some SQL from running. We discovered this because doing a simple grep against postgres processes revealed several processes "WAITING": -- snip -- 00:04:31 postgres: dataman our_db 10.0.0.103 INSERT wai

Re: [GENERAL] help

2006-01-29 Thread Raymond O'Donnell
On 28 Jan 2006 at 17:38, Paolo Ditto wrote: > I would want do a php script to access my postgres database from > remote host. I would like to know how I can do. Particularly, I would Are you looking for an administration tool? If so, have a look at phpPgAdmin: http://phppgadmin.sourceforge.net/

Re: [GENERAL] help

2006-01-29 Thread Andreas Kretschmer
Paolo Ditto <[EMAIL PROTECTED]> schrieb: > Hi. > I would want do a php script to access my postgres database from > remote host. I would like to know how I can do. Particularly, I would 1. you database must listen on TCP/IP and 2. the remote host needs privileges to connect to the DB Read h

[GENERAL] help

2006-01-28 Thread Paolo Ditto
Hi. I would want do a php script to access my postgres database from remote host. I would like to know how I can do. Particularly, I would to know the default directory where my database is located so that to be able to call it with my php script. ---(end of broadcast)-

Re: [GENERAL] help with rules for system table

2006-01-10 Thread Jim Nasby
Adding -general back into this... No, I don't think there's any way to trigger on this programmatically, though there has been talk from time-to-time about adding support for triggers on DDL. In the meantime you'll just need to scan the system tables for new indexes. I'm also wondering if there

Re: [GENERAL] help with rules for system table

2006-01-10 Thread Jim C. Nasby
On Sun, Jan 08, 2006 at 06:35:06PM -0800, [EMAIL PROTECTED] wrote: > Hi, > > I have to archieve functions like this: > When users define a new index, I will do something (for instance, > increase an counter in my table or do some other statistics). However, > I defined rule for insert on pg_cl

Re: [GENERAL] help with rules for system table

2006-01-09 Thread Tom Lane
[EMAIL PROTECTED] writes: > Does this mean that I can't create rules for system tables? Not ones that will be invoked by system operations, anyway. regards, tom lane ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postma

Re: [GENERAL] help with rules for system table

2006-01-09 Thread Jaime Casanova
> Does this mean that I can't create rules for system tables? that's right... you cannot create rules for system tables... -- regards, Jaime Casanova (DBA: DataBase Aniquilator ;) ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner w

[GENERAL] help with rules for system table

2006-01-09 Thread rlhsiao
Hi, I have to archieve functions like this: When users define a new index, I will do something (for instance, increase an counter in my table or do some other statistics). However, I defined rule for insert on pg_class and when the entry is actually an index, I do my thing. Obviously my rule

Re: [GENERAL] Help on collation and accent sensitivity

2005-12-08 Thread Peter Eisentraut
jlmssilva wrote: > I'm experienced with SQL Server (now learning pg) > and there only by choosing the appropriate collation I get > case/accent sensitivity policy well defined. Is there any similar > parameter in pg that I've missed and have the same effect? You could try to define your own locale

[GENERAL] Help on collation and accent sensitivity

2005-12-07 Thread jlmssilva
Hello, This is probably a very basic question but I'm having a problem writing queries that should be accent insensitive. I have pg v8.1 for Windows installed with Portuguese support and everything works fine except a very basic thing. An example query like the following: select name

Re: [GENERAL] help with utf8

2005-12-01 Thread Richard Huxton
Hugo wrote: Richard, I have to import data from a CSV file with the pgsql COPY command, I just know that this file comes from an old program written in Clipper (or something like under linux) , my database was created with UTF8, I cant find how to create it with UTF-16 on windows, what is the r

Re: [GENERAL] help with utf8

2005-12-01 Thread Hugo
Richard,I have to import data from a CSV file with the pgsql COPY command, I just know that this file comes from an old program written in Clipper (or something like under linux) , my database was created with UTF8,  I cant find how to create it with UTF-16 on windows, what is the recomended encodi

Re: [GENERAL] help with utf8

2005-12-01 Thread Richard Huxton
Hugo wrote: don't know if this is the best solution but I dropped the database and recreated it with SQL_ASCII instead of UTF-8 and everything worked as expected It would SQL_ASCII just accepts whatever it's given. Hugo - a quick tip for future questions, just post the text of the message not

Re: [GENERAL] help with utf8

2005-12-01 Thread Hugo
don't know if this is the best solution but I dropped the database and recreated it with SQL_ASCII instead of UTF-8 and everything worked as expectedHugoOn 01/12/05, Hugo <[EMAIL PROTECTED]> wrote:Hi can anybody help with this error, I attatched an imagethanksPosgtrest 8.1.0 on WinXP Pro SP1

[GENERAL] help with utf8

2005-12-01 Thread Hugo
Hican anybody help with this error, I attatched an imagethanksPosgtrest 8.1.0 on WinXP Pro SP1 error.PNG Description: PNG image ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail co

Re: [GENERAL] Help with COPY Error: invalid UTF-8 byte ....

2005-11-28 Thread Richard Huxton
Alex wrote: Hi, I am having a problem with a copy command, saying ERROR: invalid UTF-8 byte sequence detected... The problem actually is that the entire copy job terminates instead of just ignoring the record in question. Is there a way to have faulty records ignored only without terminatin

[GENERAL] Help with COPY Error: invalid UTF-8 byte ....

2005-11-28 Thread Alex
Hi, I am having a problem with a copy command, saying ERROR: invalid UTF-8 byte sequence detected... The problem actually is that the entire copy job terminates instead of just ignoring the record in question. Is there a way to have faulty records ignored only without terminating the entire

Re: [GENERAL] help with writing stored procedure

2005-11-10 Thread Jaime Casanova
On 11/10/05, Assad Jarrahian <[EMAIL PROTECTED]> wrote: > Hi, > I am trying to write a stored procedure that takes as input an array > (one or more integers) and returns all rows matching that ID (primary > key of the table): > > I have this so far: > > CREATE OR REPLACE FUNCTION > getLMs(int[],f

[GENERAL] help with writing stored procedure

2005-11-10 Thread Assad Jarrahian
Hi, I am trying to write a stored procedure that takes as input an array (one or more integers) and returns all rows matching that ID (primary key of the table): I have this so far: CREATE OR REPLACE FUNCTION getLMs(int[],float(8), float(8)) RETURNS SETOF tp_lm_object AS $$ DECLARE myrec r

[GENERAL] Help with Array Function in C language...

2005-11-07 Thread Cristian Prieto
Hello, I'm doing a very simple C language function in PostgreSQL but I can't figure out why this is not working, the documentation about the PostgreSQL internals is not so good about arrays and I couldn't find a suitable example of the use of some kind of array functions inside the pgsql source tre

Re: [GENERAL] Help pls with UPDATE

2005-10-31 Thread Michael Glaesemann
On Nov 1, 2005, at 13:40 , Guy Rouillier wrote: go KEY802207 wrote: Hi, pgsql-general. Tell me please, how to update a set of rows using order- something like : update my_table set counter1=nextval('my_seq') order by counter2 ; The way this is usually done is to issue a SELECT with a

Re: [GENERAL] Help pls with UPDATE

2005-10-31 Thread Guy Rouillier
go KEY802207 wrote: > Hi, pgsql-general. > > Tell me please, how to update a set of rows using order- > something like : > > update my_table set counter1=nextval('my_seq') order by counter2 ; The way this is usually done is to issue a SELECT with an ORDER BY clause, then update the rows th

[GENERAL] Help pls with UPDATE

2005-10-31 Thread go KEY802207
Hi, pgsql-general. Tell me please, how to update a set of rows using order- something like : update my_table set counter1=nextval('my_seq') order by counter2 ; -- Regards, Igor mailto:[EMAIL PROTECTED] ---(end of broadcast)

[GENERAL] Help with asynchronous queries

2005-10-12 Thread Nicolao Renè
Hi, I need to execute some queries that do not return any value for example "DELETE * FROM foo". This queries take a lot of time and I can't put them together in a single query. If I use the non-blocking function PQsendQuery() I have to wait until the execution of the first query terminates befo

Re: [GENERAL] Help with inventory control - Thank You!

2005-10-03 Thread Fernando Grijalba
Thank you very much Mike.  I will do just that. FernandoOn 9/30/05, Mike Nolan <[EMAIL PROTECTED]> wrote: > User1 starts order and takes the last two units. User2 starts order 1 minut=> e> after and checks inventory. He sees 2 units left and adds them to the his> order. User1 commits his order. No

Re: [GENERAL] Help with inventory control - THANK YOU!!!

2005-09-30 Thread Fernando Grijalba
Thank you Mike for your answer.  That is what I had in mind. You guys have helped me alot.  Thank you so much for your cooperation. Fernando

Re: [GENERAL] Help with inventory control

2005-09-30 Thread Mike Nolan
> User1 starts order and takes the last two units. User2 starts order 1 minut= > e > after and checks inventory. He sees 2 units left and adds them to the his > order. User1 commits his order. Now User2 cannot finish his order because > the products are not available anymore. > > This is the probl

Re: [GENERAL] Help with inventory control

2005-09-30 Thread Fernando Grijalba
Thank you for your input Doug, but that did not work. User2 was still getting the qty unchanged. Any more ideas? I was thinking of creating a table that will hold the product code and the qty taken by an order.  check this table evey minute and if a product has been there for more that 10 minutes

Re: [GENERAL] Help with inventory control

2005-09-30 Thread Douglas McNaught
Fernando Grijalba <[EMAIL PROTECTED]> writes: > Thank you for your response. > > I want to avoid the following situation. > > User1 starts order and takes the last two units. User2 starts order 1 > minute after and checks inventory. He sees 2 units left and adds them to > the his order. User1 co

Re: [GENERAL] Help with inventory control

2005-09-30 Thread Fernando Grijalba
Thank you for your response. I want to avoid the following situation. User1 starts order and takes the last two units.  User2 starts order 1 minute after and checks inventory. He sees 2 units left and adds them to the his order.  User1 commits his order.  Now User2 cannot finish his order because

Re: [GENERAL] Help with inventory control

2005-09-30 Thread Martijn van Oosterhout
On Fri, Sep 30, 2005 at 10:21:14AM -0400, Fernando Grijalba wrote: > I need the following to work with PostgreSQL. I was thinking of reading > uncommitted transactions, but just found out they do not work on PG. I need > to have user 1 take an item form inventory for an order and before user 1 > fi

[GENERAL] Help with inventory control

2005-09-30 Thread Fernando Grijalba
I need the following to work with PostgreSQL.  I was thinking of reading uncommitted transactions, but just found out they do not work on PG.  I need to have user 1 take an item form inventory for an order and before user 1 finishes the transaction user 2 will query the inventory.  I need user 2 to

Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-20 Thread Bjørn T Johansen
I am not sure why I used subselect, I just saw an example and followed it.. But now it's working as it should... Thx for all the help! :) BTJ On 9/19/05, Bjørn T Johansen wrote: CREATE OR REPLACE FUNCTION trykkStatus (pressID INTEGER) RETURNS SetOf trykkstatus_type AS ' DECLARE

Re: [GENERAL] help me pls

2005-09-20 Thread suresh ramasamy
hi this following words from Dinesh did worked for me. Thanks guys and really appreciate your help and advice. PG_DATA=/usr/local/pgsql/data regards suresh ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] HELP - Recover function delete

2005-09-19 Thread Bruce Momjian
8.1 will have a define called MAKE_EXPIRED_TUPLES_VISIBLE so you can recompile and see deleted rows. However, it isn't in 8.0 so you would have to download a current snapshot, find that define, add it to your release, compile, and use it. -

Re: [GENERAL] help me pls

2005-09-19 Thread Neil Dugan
On Monday 19 September 2005 07:08 am, Sean Davis wrote: > On 9/19/05 12:02 AM, "suresh ramasamy" <[EMAIL PROTECTED]> wrote: > > thanks for the info Devrim, > > > > by the way i'm newbie, i have followed the steps in the documentation for > > compiling and installation. I'm using FC4. ./cofigure c

Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-19 Thread hubert depesz lubaczewski
On 9/19/05, Bjørn T Johansen <[EMAIL PROTECTED]> wrote: CREATE OR REPLACE FUNCTION trykkStatus (pressID INTEGER)RETURNS SetOf trykkstatus_type AS 'DECLAREorderID ordrenew.id%TYPE;tmprec trykkstatus_type%ROWTYPE;BEGINselect id into orderID from ordrenew where now() between trykkstart and pro

[GENERAL] HELP - Recover function delete

2005-09-19 Thread Pierre Racine
Hi, I just hit twice the delete button on a function I spent two days writing (without backing it up. I know... I know...). Is there a way to recover it? A simple garbage would do the job. I don't know many software now that do not implement a sort of simple mecanism to recover what we threw

Re: [GENERAL] help me pls

2005-09-19 Thread Sean Davis
On 9/19/05 12:02 AM, "suresh ramasamy" <[EMAIL PROTECTED]> wrote: > thanks for the info Devrim, > > by the way i'm newbie, i have followed the steps in the documentation for > compiling and installation. I'm using FC4. ./cofigure completes immediately > but the gmake running for nearly the whol

Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-19 Thread Bjørn T Johansen
Yes, I read the doc... And I have now created this function, which seems to be ok but when I try to select from it, I get an error telling me that "subquery must return only one column". But my subquery does return only one column...? My function looks like this? CREATE OR REPLACE FUNCTION try

[GENERAL] help me pls

2005-09-18 Thread suresh ramasamy
thanks for the info Devrim, by the way i'm newbie, i have followed the steps in the documentation for compiling and installation.  I'm using FC4.  ./cofigure completes immediately but the gmake running for nearly the whole day.  so decide to terminate. (my system configuration is p-III, 733 with

Re: [GENERAL] help needed for functions

2005-09-16 Thread A. Kretschmer
am 16.09.2005, um 6:51:16 -0700 mailte Nitin Ahire folgendes: > I am facing problems for stored procedures. Is their any way so that I > can transfer my existing stored procedure from mssql to postgre ? I guess: no. > > I already read about functions & tried to implement it but I could not >

Re: [GENERAL] help needed for functions

2005-09-16 Thread Dinesh Pandey
ntid     LOOP     return next r;     END LOOP;     RETURN; END ' LANGUAGE 'plpgsql';   -     Thanks Dinesh Pandey From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nitin Ahire Sent: Friday, September 16, 2005 7:21 PM To: pgsql-

[GENERAL] help needed for functions

2005-09-16 Thread Nitin Ahire
Hello All,   I am new to postgresql database. I am transferring current database from mssql database to postgresql 7.4   I am facing problems for stored procedures. Is their any way so that I can transfer my existing stored procedure from mssql to postgre ?   I already read about functions & trie

Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-16 Thread hubert depesz lubaczewski
On 9/15/05, Bjørn T Johansen <[EMAIL PROTECTED]> wrote: Yes, I did and I found an answer... :) you did what? read the docs?  But I am trying to use this function in a report designer and the result from the select is in the way of the real data from the fetch... Is there a way around this? and? as

Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-15 Thread Bjørn T Johansen
Yes, I did and I found an answer... :) But I am trying to use this function in a report designer and the result from the select is in the way of the real data from the fetch... Is there a way around this? BTJ hubert depesz lubaczewski wrote: > On 9/15/05, *Bjørn T Johansen* <[EMAIL PROTECTED]

Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-15 Thread hubert depesz lubaczewski
On 9/15/05, Bjørn T Johansen <[EMAIL PROTECTED]> wrote: But this function does not do what I need it to do... I want x rows returned, butinstead I just get a stringname...Either how do I use this name or how do I return x rows? for refcursors - just use returned name in subsequent "FETCH FROM "; f

Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-15 Thread Bjørn T Johansen
Oki, I found a way... begin; select trykkstatus(1,'refcurs'); (I have added one parameter to know the cursor name) fetch all from refcurs; commit; But this returns two rowsets, first one for the select and then one for the fetch, but how do I get rid of the row that is returned by the select?

Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-15 Thread Bjørn T Johansen
Yes, of course But this function does not do what I need it to do... I want x rows returned, but instead I just get a stringname... Either how do I use this name or how do I return x rows? BTJ Gnanavel S wrote: > 'IF' block is not ended. > > On 9/15/05, *Bjørn T Johansen* <[EMAIL PROTECTE

Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-15 Thread Gnanavel S
'IF' block is not ended.On 9/15/05, Bjørn T Johansen <[EMAIL PROTECTED]> wrote: I am trying to write a function that returns x rows, where x >= 0 and this is what Ihave come up with...:CREATE OR REPLACE FUNCTION trykkStatus (pressID SMALLINT) RETURNS REFCURSOR AS 'declareorderID ordrenew.id%TY

[GENERAL] Help trying to write my first plpgsql function...

2005-09-15 Thread Bjørn T Johansen
I am trying to write a function that returns x rows, where x >= 0 and this is what I have come up with...: CREATE OR REPLACE FUNCTION trykkStatus (pressID SMALLINT) RETURNS REFCURSOR AS ' declare orderID ordrenew.id%TYPE; cur REFCURSOR; begin select id into orderID from ordrenew where now

Re: [GENERAL] help me learn

2005-09-12 Thread Berend Tober
suresh ramasamy wrote: i'm new to postgreSQL as well as new to database concepts. please tell me how can i learn. i mean the easiest and fast way. Your help will be appreciated. Make an appropriate posting to pgsql-jobs? ---(end of broadcast)

Re: [GENERAL] help me learn

2005-09-12 Thread A. Kretschmer
am 12.09.2005, um 17:08:31 +0530 mailte suresh ramasamy folgendes: > hi, > > i'm new to postgreSQL as well as new to database concepts. please tell me > how can i learn. i mean the easiest and fast way. Your help will be Read a book. http://techdocs.postgresql.org/techdocs/bookreviews.php Re

[GENERAL] help me learn

2005-09-12 Thread suresh ramasamy
hi, i'm new to postgreSQL as well as new to database concepts.  please tell me how can i learn. i mean the easiest and fast way.  Your help will be appreciated.

Re: [GENERAL] Help with row locks on 7.4 to 8.0 migration

2005-09-06 Thread Tom Lane
Kevin Barnard <[EMAIL PROTECTED]> writes: > FATAL: terminating connection due to administrator command > CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"."client" x WHERE > "division" = $1 FOR UPDATE OF x" > That's what happens when I kill the SQL that was locking everything. The > only prob

[GENERAL] Help with row locks on 7.4 to 8.0 migration

2005-09-06 Thread Kevin Barnard
I've just upgraded a 7.4 install to 8.0.3 and we've suddenly run into lock issues that were not present in 7.4.  I'm look for help on this matter, because I'm a little confused.  Downgrading is really not an option at this point,  we really really need the 8.0 features on the DB and a dump/restore

Re: [GENERAL] Help with SPI...

2005-08-30 Thread Michael Fuhr
On Tue, Aug 30, 2005 at 01:28:11PM -0600, Cristian Prieto wrote: > Well, the new value is really the content of a memory segment, I > know I could store it again using SPI and an UPDATE statement, but > that means that I need to transform the val value into a string, > and I don't know the length o

[GENERAL] Help with SPI...

2005-08-30 Thread Cristian Prieto
Hi, I will try to explain the most possible my question:   I'm writing a Store Procedure as a C Language Function in the Database, I need to handle a bytea (binary objetc) and store it in a modified mode in the database, I've done it in the following way:   PG_FUNCTION_INFO_V1(myspi);   Datu

Re: [GENERAL] help

2005-08-26 Thread Bruno Wolff III
On Fri, Aug 26, 2005 at 01:41:12 -0700, > All I need is integer columns evaluting in a > > nullif('1','') returns int = 1 > nullif('','') returns int = null > nullif('0','') returns int = 0 > > fashion upon inserting to an INTEGER column. Forget > booleans. Forget text. Just integers. Is this >

Re: [GENERAL] help

2005-08-26 Thread Matt A.
Yes. I know that using '' defines the field as a string so I get the TEXT cast. Let me try to show you why I need it in ''. I default my parameters in my application to empty strings. They don't need to be casted so I can override them at any time with an integer value, string, boolean, float, etc.

Re: [GENERAL] help

2005-08-25 Thread Martijn van Oosterhout
On Thu, Aug 25, 2005 at 04:10:27PM -0700, Matt A. wrote: > Anyway, I am new to postgres and looking to casts. I > have wrote this question several times before and on > this version I forgot to add the exact rules of why > it's breaking and what i need it to do. I will try to > be more clear... >

Re: [GENERAL] help

2005-08-25 Thread Matt A.
Sorry to have replied directly to you. I assumed the reply address was that of the pgsql email.A thousand apologies. Anyway, I am new to postgres and looking to casts. I have wrote this question several times before and on this version I forgot to add the exact rules of why it's breaking and what

Re: [GENERAL] help

2005-08-25 Thread Martijn van Oosterhout
Please reply to the list also in the future, I'm going to sleep now. Anyway, it still works: kleptog=# create temp table x (a text); CREATE TABLE kleptog=# insert into x values (nullif('','')); INSERT 114760 1 kleptog=# insert into x values (nullif('1','')); INSERT 114761 1 kleptog=# select a,a i

Re: [GENERAL] help

2005-08-25 Thread Martijn van Oosterhout
Very odd, what are you trying? kleptog=# select nullif('','') is null; ?column? -- t (1 row) kleptog=# select nullif('1','') is null; ?column? -- f (1 row) Works for me. Have a nice day, On Thu, Aug 25, 2005 at 01:44:52PM -0700, Matt A. wrote: > We used nullif('$value',''

[GENERAL] help

2005-08-25 Thread Matt A.
We used nullif('$value','') on inserts in mssql. We moved to postgres but the nullif() function doesn't match empty strings to each other to return null. MS SQL2000 nullif('1','') would insert 1 as integer even though wrapped in '' (aka string). Also nullif('','') would evaluate NULL (both equal

Re: [GENERAL] Help with a subselect inside a view

2005-08-25 Thread Bruno Wolff III
On Thu, Aug 25, 2005 at 08:19:25 -0700, Bill Moseley <[EMAIL PROTECTED]> wrote: > > DROP VIEW cl; > CREATE VIEW cl (id, instructor) > AS > SELECT class.id, person.first_name > FROM class, instructors, person > WHERE instructors.person = person.id >AND

Re: [GENERAL] Help with a subselect inside a view

2005-08-25 Thread Tom Lane
Bill Moseley <[EMAIL PROTECTED]> writes: > On Thu, Aug 25, 2005 at 12:14:31PM -0400, Tom Lane wrote: >> It's fairly pointless though, because as the manual notes, you can't get >> any well-defined behavior without additional ORDER BY columns to >> prioritize the rows within class.id groups. As is,

Re: [GENERAL] Help with a subselect inside a view

2005-08-25 Thread Bill Moseley
On Thu, Aug 25, 2005 at 12:14:31PM -0400, Tom Lane wrote: > > CREATE VIEW cl (id, class_time, instructor) > > AS > > SELECT DISTINCT ON(class.id) > >class.id, class.class_time, person.first_name > > FROM class, instructors, person > >

Re: [GENERAL] Help with a subselect inside a view

2005-08-25 Thread Tom Lane
Bill Moseley <[EMAIL PROTECTED]> writes: >> http://www.postgresql.org/docs/current/static/sql-select.html#SQL-DISTINCT >The DISTINCT ON expression(s) must match the leftmost ORDER BY >expression(s). The ORDER BY clause will normally contain additional >expression(s) that determine the

Re: [GENERAL] Help with a subselect inside a view

2005-08-25 Thread Bill Moseley
And about being efficient: On Thu, Aug 25, 2005 at 08:01:26AM -0700, Bill Moseley wrote: > DROP VIEW cl; > CREATE VIEW cl (id, class_time, instructor) > AS > SELECT DISTINCT ON(class.id) >class.id, class.class_time, person.first_name >

Re: [GENERAL] Help with a subselect inside a view

2005-08-25 Thread Bill Moseley
On Thu, Aug 25, 2005 at 08:05:36AM -0500, Bruno Wolff III wrote: > On Wed, Aug 24, 2005 at 23:12:17 -0700, > Bill Moseley <[EMAIL PROTECTED]> wrote: > > I need a little SQL help: > > > > I'm trying to get a subselect working inside a view. > > Unfortunately you didn't show us what you tried. My

Re: [GENERAL] Help with a subselect inside a view

2005-08-25 Thread Bill Moseley
Hi David, On Thu, Aug 25, 2005 at 01:22:02AM -0700, David Fetter wrote: > This sounds like a case for PostgreSQL's nifty DISTINCT ON functionality. > > http://www.postgresql.org/docs/current/static/sql-select.html#SQL-DISTINCT The DISTINCT ON expression(s) must match the leftmost ORDER BY

Re: [GENERAL] Help with a subselect inside a view

2005-08-25 Thread Bruno Wolff III
On Wed, Aug 24, 2005 at 23:12:17 -0700, Bill Moseley <[EMAIL PROTECTED]> wrote: > I need a little SQL help: > > I'm trying to get a subselect working inside a view. Unfortunately you didn't show us what you tried. My guess would be that you didn't enclose the subselect in parenthesis. The dist

Re: [GENERAL] Help with a subselect inside a view

2005-08-25 Thread David Fetter
On Wed, Aug 24, 2005 at 11:12:17PM -0700, Bill Moseley wrote: > I need a little SQL help: > > I'm trying to get a subselect working inside a view. > > I have a table "class" that has related tables (a class has a > location, a location has an address with columns city, state, zip). > I want to us

[GENERAL] Help with a subselect inside a view

2005-08-24 Thread Bill Moseley
I need a little SQL help: I'm trying to get a subselect working inside a view. I have a table "class" that has related tables (a class has a location, a location has an address with columns city, state, zip). I want to use a VIEW to display columns related to a given class. But a class can also

Re: [GENERAL] Help with plperl

2005-08-21 Thread Martijn van Oosterhout
On Mon, Aug 22, 2005 at 03:58:25AM +1000, Alex wrote: > Hi, > could anyone help me with a problem I am having creating a plperl function. > > The return always complains with the following error: > composite-returning Perl function must return reference to hash Well, since you're returning a refe

Re: [GENERAL] Help with plperl

2005-08-21 Thread Michael Fuhr
On Mon, Aug 22, 2005 at 03:58:25AM +1000, Alex wrote: > could anyone help me with a problem I am having creating a plperl function. > > The return always complains with the following error: > composite-returning Perl function must return reference to hash The above error tells you what's wrong: PL

[GENERAL] Help with plperl

2005-08-21 Thread Alex
Hi, could anyone help me with a problem I am having creating a plperl function. The return always complains with the following error: composite-returning Perl function must return reference to hash Thanks Alex CREATE TYPE sometype AS ( jid INTEGER, start_time TEXT, descr

Re: [GENERAL] help: production db stuck in startup mode

2005-07-20 Thread Ed L.
On Wednesday July 20 2005 1:19 pm, Ed L. wrote: > On Wednesday July 20 2005 1:13 pm, Ed L. wrote: > > I have a 7.4.6 db running on itanium hpux 11.23. It appears > > a vacuum ran out of disk space: > > 2005-07-20 13:47:43 [6161] ERROR: DBI::do failed for SQL > > [VACUUM VERBOSE] to database cli

Re: [GENERAL] help: production db stuck in startup mode

2005-07-20 Thread Ed L.
On Wednesday July 20 2005 1:13 pm, Ed L. wrote: > I have a 7.4.6 db running on itanium hpux 11.23. It appears a > vacuum ran out of disk space, Oh, and of course, we created extra diskspace before restarting... Ed > > 2005-07-20 13:47:43 [6161] ERROR: DBI::do failed for SQL > [VACUUM VERBOS

[GENERAL] help: production db stuck in startup mode

2005-07-20 Thread Ed L.
I have a 7.4.6 db running on itanium hpux 11.23. It appears a vacuum ran out of disk space, 2005-07-20 13:47:43 [6161] ERROR: DBI::do failed for SQL [VACUUM VERBOSE] to database clincomm: DBI error: PANIC: could not write to file "/users/postgresql-7.4.6/data/pg_xlog/xlogtemp.6178": No

[GENERAL] Help needed with PGOleDB driver and ADO

2005-07-14 Thread Craig Bryden
Hi   We have a numeric field in our table. When setting the value of this field to 1.00, we experience the following problem when using ADO (with the PgOleDB driver) to query the table.   the field comes back correctly identified as a NUMERIC field, but the actual value of of the field is

Re: [GENERAL] Help me urgently

2005-06-23 Thread Karl O. Pinc
On 06/23/2005 10:28:49 AM, Richard Huxton wrote: Kapil Malhotra wrote: Hi.. I am running postgres 8.0.3 on red hat 9 and i have installed pgadmin III 1.2 on win 2000 professional client. i want to establish a connection between win client and postgres server.. Make sure your server is actual

Re: [GENERAL] Help me urgently

2005-06-23 Thread Richard Huxton
Kapil Malhotra wrote: Hi.. I am running postgres 8.0.3 on red hat 9 and i have installed pgadmin III 1.2 on win 2000 professional client. i want to establish a connection between win client and postgres server.. Make sure your server is actually listening for internet connections. http://www.p

[GENERAL] Help me urgently

2005-06-23 Thread Kapil Malhotra
Hi.. I am running postgres 8.0.3 on red hat 9 and i have installed pgadmin III 1.2 on win 2000 professional client. i want to establish a connection between win client and postgres server.. please help me with the steps kapil ---(end of broadcast)

Re: [GENERAL] help about the function

2005-06-23 Thread Zlatko Matić
Great! It works. Thanks. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org Sent: Thursday, June 23, 2005 10:18 AM Subject: Re: [GENERAL] help about the function Hi, Why not

Re: [GENERAL] help about the function

2005-06-23 Thread Patrick . FICHE
-- -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Zlatko MatićSent: jeudi 23 juin 2005 09:59To: [EMAIL PROTECTED]Cc: pgsql-general@postgresql.orgSubject: [GENERAL] help about the functionImportance: High Hello!   I have i

[GENERAL] help about the function

2005-06-23 Thread Zlatko Matić
Hello!   I have implemented solution for enabling regular user (from group "ADMINS") to create new users in predefined groups, by your modified function:   CREATE OR REPLACE FUNCTION "public"."alter_group" (name, boolean, name, varchar, timestamp) RETURNS boolean AS$body$DECLARE  l_group ALI

Re: [GENERAL] HELP!!! Corrupt Database!

2005-06-21 Thread Richard Huxton
Yuri Gordienko wrote: Hi, The computer with database has lost power and after restarting I can't connect to database: connection to database "db_client" failed: FATAL: invalid memory alloc request size 4294901760 version: postgresql-7.4.6 Help me with this problem. I don't have reserve copy

[GENERAL] HELP!!! Corrupt Database!

2005-06-20 Thread Yuri Gordienko
Hi, The computer with database has lost power and after restarting I can't connect to database: connection to database "db_client" failed: FATAL: invalid memory alloc request size 4294901760 version: postgresql-7.4.6 Help me with this problem. I don't have reserve copy of database :( Thank

Re: [GENERAL] Help! What has changed in the internal structure of

2005-06-20 Thread Richard Huxton
Rodrigo Katsumoto Sakai wrote: Well, the driver psqlodbc-07 works on PostgreSQL, but not very well! My problem is that I have some tables, for exemple: create table service ( cod_service int, nam_service varchar(255) not null default '', des_service varchar(255) ); [snip] > then occur

Re: [GENERAL] Help! What has changed in the internal structure of PostgreSQL?

2005-06-20 Thread Rodrigo Katsumoto Sakai
or views in the system catalogs have changed somehow!!?? Thanks!! -Original Message- From: Richard Huxton [mailto:[EMAIL PROTECTED] Sent: seg 20/06/2005 10:57 To: Rodrigo Katsumoto Sakai Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Help! What has changed

Re: [GENERAL] Help! What has changed in the internal structure of

2005-06-20 Thread Richard Huxton
Rodrigo Katsumoto Sakai wrote: Hi, I'm having some troubles using the driver ODBC! The problem is that a did some reports with Crystal Reports XI and used PostgreSQL 7.4.x with psqlodbc-07_03_0200, now I have migrate to PostgreSQL 8.0.3 and I'm using psqlodbc-08_00_0101 but the reports that I did

[GENERAL] Help! What has changed in the internal structure of PostgreSQL?

2005-06-20 Thread Rodrigo Katsumoto Sakai
Hi, I'm having some troubles using the driver ODBC! The problem is that a did some reports with Crystal Reports XI and used PostgreSQL 7.4.x with psqlodbc-07_03_0200, now I have migrate to PostgreSQL 8.0.3 and I'm using psqlodbc-08_00_0101 but the reports that I did is not working anymore beca

Re: [GENERAL] Help: chinese character set support (EUC_TW to/from

2005-06-18 Thread eric
You're right about it. After a 8.0.3 re-installation, the issue seems to have gone. See screen output: euc_tw=# \d contacts Table "public.contacts" Column | Type | Modifiers +---+--- id | integer | name | character

Re: [GENERAL] Help: chinese character set support (EUC_TW to/from

2005-06-17 Thread Tatsuo Ishii
Strange. I have successfully set the client encoding to BIG5 with PostgreSQL 8.0.3 on Linux. $ psql euc_tw Welcome to psql 8.0.3, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or t

<    4   5   6   7   8   9   10   11   12   >