On Tue, 25 Dec 2007, [EMAIL PROTECTED] wrote:
insert a record into a table, and when the record already
exists(according to the primary key), update it.
There is an example that does exactly that, 37-1, in the documentation at
http://www.postgresql.org/docs/current/static/plpgsql-control-stru
Michael Glaesemann wrote:
On Dec 24, 2007, at 22:03 , [EMAIL PROTECTED] wrote:
I have googled and currently the only way I can find is do query first
and then update or insert.
Or alternatively, UPDATE and see if you've affected any rows. If not,
insert.
Michael Glaesemann
grzm seespotcod
On Dec 24, 2007, at 22:03 , [EMAIL PROTECTED] wrote:
I have googled and currently the only way I can find is do query
first and then update or insert.
Or alternatively, UPDATE and see if you've affected any rows. If not,
insert.
Michael Glaesemann
grzm seespotcode net
Hi all,
I have a table like this,
CREATE TABLE mytable(
avarchar(40),
btext,
ctext,
PRIMARY KEY (a, b)
);
What I want to do is:
insert a record into a table, and when the record already
exists(according to the primary key), update it.
I know that there is a ON DUPLICATE clause
On Dec 24, 2007, at 19:28 , Shane Ambler wrote:
Also their updates can often wipe out a custom built version of php.
If you install your custom-built PHP in /usr/local or use MacPorts
(which uses /opt) or Fink (which uses /sw IIRC), you don't have to
worry about anything being overwritten
brian wrote:
Steve Atkins wrote:
On Dec 20, 2007, at 7:35 AM, Gordon wrote:
On Dec 19, 11:32 am, Gordon <[EMAIL PROTECTED]> wrote:
I'm a web developer who does a lot of work in PHP. The back end
database we use is bases on Postgres. I am trying to set my new
MacBook Pro up as a developm
Sorry guys, was my mistake... I found one file missing in global
tablespace. Copying it there fixed the problem.
Thanks everyone!
On Mon, 2007-12-24 at 14:07 -0800, Richard Broersma Jr wrote:
> --- On Mon, 12/24/07, Alex Vinogradovs <[EMAIL PROTECTED]> wrote:
>
> > P.S. datafiles are 85GB in s
--- On Mon, 12/24/07, Alex Vinogradovs <[EMAIL PROTECTED]> wrote:
> P.S. datafiles are 85GB in size, I couldn't really dump
> and restore...
Don't for get the steps of compressing and uncompressing between dump and
restore.;) If the file is still too big, you can always use tar to spit the
fil
I expect that it is not quite as easy as that.
My advice (as a non-expert) would be to install the same version of pg
onto the target machine, and use etl
(http://en.wikipedia.org/wiki/Extract,_transform,_load) to transfer the
data. Basically you just need a small script (I like PHP myself, bu
Guys,
I've created a copy of my database to run on a different server
by copying entire data directory while database instance was stopped.
Database generally works on the target machine, but I'm getting
following error when trying to create a plpgsql function :
ERROR: could not open relation 166
Steve Atkins wrote:
On Dec 20, 2007, at 7:35 AM, Gordon wrote:
On Dec 19, 11:32 am, Gordon <[EMAIL PROTECTED]> wrote:
I'm a web developer who does a lot of work in PHP. The back end
database we use is bases on Postgres. I am trying to set my new
MacBook Pro up as a development system.
I
On Mon, Dec 24, 2007 at 04:10:45PM -0200, Henrique Pantarotto wrote:
> Hi Richard,
>
> I actually want to change the enum values after I have created and
> associated it to a table colum.
>
> Is it possible?
No. An enum is defined by its members. You can't change a type after it
is created, not
--- On Mon, 12/24/07, Henrique Pantarotto <[EMAIL PROTECTED]> wrote:
> I actually want to change the enum values after I have
> created and
> associated it to a table colum.
It looks like you will have to drop the type and re-create it.
You might have to try a couple of tests:
1) BEGIN TRANSACT
Hi Richard,
I actually want to change the enum values after I have created and
associated it to a table colum.
Is it possible?
Thanks.
On Mon, 24 Dec 2007 09:50:09 -0800 (PST)
Richard Broersma Jr <[EMAIL PROTECTED]> wrote:
> --- On Mon, 12/24/07, Henrique Pantarotto <[EMAIL PROTECTED]> wrote:
On Dec 20, 2007, at 7:35 AM, Gordon wrote:
On Dec 19, 11:32 am, Gordon <[EMAIL PROTECTED]> wrote:
I'm a web developer who does a lot of work in PHP. The back end
database we use is bases on Postgres. I am trying to set my new
MacBook Pro up as a development system.
I have managed to install
Hello,
I am trying to execute a long series of statements within a transaction
in "serializable" isolation level.
I've read Tom Lane's excellent document describing concurrency issues in
Postgres and learned of the general method of doing this:
loop
BEGIN;
SELECT hits FROM webpages WHERE ur
--- On Mon, 12/24/07, Abraham, Danny <[EMAIL PROTECTED]> wrote:
> I can manually create the file "postmaster.pid",
> so the problem
> Does not look like a permission problem.
I had a similar problem once. For some reason, after I installed a windows
service pack update, my Postgresql directory
--- On Mon, 12/24/07, Henrique Pantarotto <[EMAIL PROTECTED]> wrote:
> I tried searching the documentation and mailing list, and I
> couldn't
> figure this one out.
ALTER TABLE questions
ALTER COLUMN answers TYPE possible_answers;
Actually your type is fine. you only need to alter the column
On Dec 19, 11:32 am, Gordon <[EMAIL PROTECTED]> wrote:
> I'm a web developer who does a lot of work in PHP. The back end
> database we use is bases on Postgres. I am trying to set my new
> MacBook Pro up as a development system.
>
> I have managed to install Postgres
> fromhttp://sourceforge.net
http://archives.postgresql.org/pgsql-hackers/2004-10/msg00964.php
It is still true in 8.1.
Is it still true in >8.1?
Will something like that in a function be statically compiled or
computed every time?
_Basket_seq:= pg_get_serial_sequence('shop_commerce_baskets',
lower('BasketID'));
If n
are you using the same username that you use to start postgres???
M--
- Original Message -
From: "Abraham, Danny" <[EMAIL PROTECTED]>
To:
Sent: Monday, December 24, 2007 9:37 AM
Subject: [GENERAL] pg_ctl start fails on Windows
The error message is "could not open PID file".
I can man
Could still be a permission problem. Whatever NT account you are using
as the service account (usally called postgres) for the PostgreSQL
server is the one that needs to be able to create the postmaster.pid.
Make sure that account has full rights to the data folder.
Hope that helps,
Regina
--
The error message is "could not open PID file".
I can manually create the file "postmaster.pid", so the problem
Does not look like a permission problem.
Thanks
Danny
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send
Hi,
I was wondering how can I alter an ENUM type? I have created a table
like this:
create type possible_answers as enum('yes', 'no');
create table questions ( question text, answers possible_answers);
insert into questions values ('Do you like me?', 'yes');
So my question is... How can I chang
24 matches
Mail list logo