Robert James wrote
> On 1/13/13, Chris Angelico <
> rosuav@
> > wrote:
>> On Mon, Jan 14, 2013 at 3:37 PM, Robert James <
> srobertjames@
> >
>> wrote:
>>> Thanks. But how do I do that where I have many literals? Something
>>> like:
>>>
>>> INSERT INTO seltest (id, a, b) SELECT (1,2,3),(4,5,6)
Hmm, nvm :-(
PostgreSQL does not yet support MERGE...
Kind regards/met vriendelijke groet,
Serge Fonville
http://www.sergefonville.nl
Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-part
Hi,
Based on my understanding of the problem, would this be possible to solve
with a MERGE statement?
HTH
Kind regards/met vriendelijke groet,
Serge Fonville
http://www.sergefonville.nl
Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServ
On 2013.01.13 6:00 PM, Robert James wrote:
I have a lot of VALUES I want to INSERT. But only a subset of them -
only those that meet a JOIN criteria involving another table.
I could INSERT them into a temp table, and then do a SELECT INTO. But
do I need to do that? Is there any way to do a IN
On Sun, Jan 13, 2013 at 10:37 PM, Robert James wrote:
> On 1/13/13, Ian Lawrence Barwick wrote:
> > 2013/1/14 Robert James :
> >> I have a lot of VALUES I want to INSERT. But only a subset of them -
> >> only those that meet a JOIN criteria involving another table.
> >>
> >> I could INSERT them
On 15/01/13 09:43, Chris Angelico wrote:
On Tue, Jan 15, 2013 at 5:26 AM, Robert James wrote:
On 1/13/13, Chris Angelico wrote:
On Mon, Jan 14, 2013 at 3:37 PM, Robert James
wrote:
Thanks. But how do I do that where I have many literals? Something like:
INSERT INTO seltest (id, a, b) SELE
On Tue, Jan 15, 2013 at 5:26 AM, Robert James wrote:
> On 1/13/13, Chris Angelico wrote:
>> On Mon, Jan 14, 2013 at 3:37 PM, Robert James
>> wrote:
>>> Thanks. But how do I do that where I have many literals? Something like:
>>>
>>> INSERT INTO seltest (id, a, b) SELECT (1,2,3),(4,5,6),(7,8,9)
On 1/13/13, Chris Angelico wrote:
> On Mon, Jan 14, 2013 at 3:37 PM, Robert James
> wrote:
>> Thanks. But how do I do that where I have many literals? Something like:
>>
>> INSERT INTO seltest (id, a, b) SELECT (1,2,3),(4,5,6),(7,8,9) WHERE b
>> IN (SELECT ...)
>
> You can use WITH clauses in cr
On Mon, Jan 14, 2013 at 3:37 PM, Robert James wrote:
> Thanks. But how do I do that where I have many literals? Something like:
>
> INSERT INTO seltest (id, a, b) SELECT (1,2,3),(4,5,6),(7,8,9) WHERE b
> IN (SELECT ...)
You can use WITH clauses in crazy ways with PostgreSQL. I haven't
actually t
On 1/13/13, Ian Lawrence Barwick wrote:
> 2013/1/14 Robert James :
>> I have a lot of VALUES I want to INSERT. But only a subset of them -
>> only those that meet a JOIN criteria involving another table.
>>
>> I could INSERT them into a temp table, and then do a SELECT INTO. But
>> do I need to
2013/1/14 Robert James :
> I have a lot of VALUES I want to INSERT. But only a subset of them -
> only those that meet a JOIN criteria involving another table.
>
> I could INSERT them into a temp table, and then do a SELECT INTO. But
> do I need to do that? Is there any way to do a INSERT... VAL
On Sun, Jan 13, 2013 at 7:00 PM, Robert James wrote:
> I have a lot of VALUES I want to INSERT. But only a subset of them -
> only those that meet a JOIN criteria involving another table.
>
> I could INSERT them into a temp table, and then do a SELECT INTO. But
> do I need to do that? Is there
Lincoln Yeoh <[EMAIL PROTECTED]> writes:
> (Related: I also suggested arbitrary user locks years back, but I wasn't
> able to implement them.)
Don't we have 'em already? See contrib/userlock/.
regards, tom lane
---(end of broadcast)--
That's why I resorted to "lock table", select, then insert/update. You have
to block all the reads of other processes that are considering an insert.
This is not great for performance, but I was certain it will work, unlike
the race-vulnerable suggestions (are people here actually using those?
> // check if entry already exists
> SELECT COUNT(*) FROM tablename WHERE [cond]
> ..
> if($count >0)
> UPDATE
> else
> INSERT
>
> but this will double the hit to the database server, because
> for every
> operation I need to do SELECT COUNT(*) first. The data itself
> is not a lot,
> and
On Wednesday 25 June 2003 21:37, Mike Mascari wrote:
> Ian Barwick wrote:
> > On Wednesday 25 June 2003 20:06, Reuben D. Budiardja wrote:
(...)
> > This kind of query should work; just leave out the "FROM dummy_table"
> > bit. (in Oracle it would be "FROM dual").
>
> I proposed that same solution
On Wednesday 25 June 2003 03:26 pm, Ian Barwick wrote:
> > I vaguely remember in Oracle, there is something like this:
> >
> > INSERT INTO mytable
> > SELECT 'value1', 'value2'
> > FROM dummy_table
> > WHERE NOT EXISTS
> > (SELECT NULL FROM mytable
> > WHERE mycon
Ian Barwick wrote:
> On Wednesday 25 June 2003 20:06, Reuben D. Budiardja wrote:
>
>>Hi,
>>I am developing application with PHP as the front end, PGSQL as the
>>backend. I am trying to figure out what's the best way to do this.
>>I want to check if an entry already exists in the table. If it does
On Wednesday 25 June 2003 03:04 pm, scott.marlowe wrote:
> Just wrap it in a transaction:
>
> begin;
> select * from table where somefield='somevalue';
> (in php code)
> if pg_num_rows>1...
> update table set field=value where somefield=somevalue;
> else
> insert into table (field) values (value);
On Wednesday 25 June 2003 20:06, Reuben D. Budiardja wrote:
> Hi,
> I am developing application with PHP as the front end, PGSQL as the
> backend. I am trying to figure out what's the best way to do this.
> I want to check if an entry already exists in the table. If it does, then I
> will do
> UPDA
Just wrap it in a transaction:
begin;
select * from table where somefield='somevalue';
(in php code)
if pg_num_rows>1...
update table set field=value where somefield=somevalue;
else
insert into table (field) values (value);
commit;
On Wed, 25 Jun 2003, Reuben D. Budiardja wrote:
>
> Hi,
> I am
Hi,
I am developing application with PHP as the front end, PGSQL as the backend. I
am trying to figure out what's the best way to do this.
I want to check if an entry already exists in the table. If it does, then I
will do
UPDATE tablename
otherwise, I will do
INSER INTO tablename...
W
I need to insert a bunch of records in a transaction. The transaction must
not abort if the a duplicate is found.
I know I have seen the syntax for the before. Can someone jog my memory?
Bryan White, ArcaMax.com, VP of Technology
The avalanche has already begun.
It is too late for the pebbles
23 matches
Mail list logo