Re: [SQL] concatenate question

2010-12-11 Thread Andreas Kretschmer
Tony Capobianco wrote: > Here's my table: > > plsql_dw=# \d tmpsv_parent_master >Table "staging.tmpsv_parent_master" > > Why won't this work? > plsql_dw=# select memberid || addeddate from tmpsv_parent_master limit > 10; > ERROR: operator does not exist: numeric || timestamp withou

Re: [SQL] sqlplus reporting equivalent in postgres?

2010-12-11 Thread Thomas Kellerer
Samuel Gendler wrote on 11.12.2010 04:23: psql - not as advanced, doesn't have all the features SQL*Plus has. On the other hand, it is at least capable of command history and readline support. Hmm, for me SQL*Plus does support command history, but this is getting off-topic now... Regar

Re: [SQL] Correct usage of FOR UPDATE?

2010-12-11 Thread Dmitriy Igrishin
Hey Joe, You can wrap the given query in the PL/pgSQL function, catch the exception and return NULL if it occurs. Please see http://www.postgresql.org/docs/9.0/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING 2010/12/9 Joe Carr > Hello, > I have a simple table-based queue system, a

Re: [SQL] sqlplus reporting equivalent in postgres?

2010-12-11 Thread Gary Chambers
psql - not as advanced, doesn't have all the features SQL*Plus has. On the other hand, it is at least capable of command history and readline support. Yes, but rlwrap will eliminate that limitation. -- Gary Chambers -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

[SQL] concatenate question

2010-12-11 Thread Tony Capobianco
Here's my table: plsql_dw=# \d tmpsv_parent_master Table "staging.tmpsv_parent_master" Column |Type | Modifiers +-+--- memberid | numeric | addeddate | timestamp witho

[SQL] Correct usage of FOR UPDATE?

2010-12-11 Thread Joe Carr
Hello, I have a simple table-based queue system, and I'd looking for some advice on improving my dequeue function. it boils down to: SELECT id FROM queue WHERE FOR UPDATE NOWAIT; which works well, in that no item gets dequeued more that once. The issue, however is that when a contention occurs,

Re: [SQL] concatenate question

2010-12-11 Thread Edgardo Portal
On 2010-12-08, Tony Capobianco wrote: > Thanks so much to everyone for your responses. You've been very > helpful. I'm running PostGres 8.4 and we're migrating our datawarehouse > from Oracle 10.2. I guess datatype is implicitly cast in oracle under > these circumstances: > > SQL> create table

Re: [SQL] The best option to insert data with primary id

2010-12-11 Thread Jasen Betts
On 2010-12-06, - wrote: > --0016364d26cf7fa4970496bf2224 > Content-Type: text/plain; charset=ISO-8859-1 > > Hi everyone, > I have a question about how best to insert and manipulate the table with > primary key id for better productivity. I need to insert data into the table > and get last id. > >