For reasons best left unmentioned, I need to update entries in a table from a
backup; I need to do all entries.
For reasons eluding my sleep deprived eyes this fails in every variation I can
think of:
update foo set foo.foo_name2=foo_old.foo_name2 where foo.foo_id =
foo_old.foo_id;
ERROR: mis
Hi!
You're missing a table declaration for the table foo_old. You might try this:
update foo set foo.foo_name2= (SELECT foo_old.foo_name2 FROM foo_old where
foo.foo_id = foo_old.foo_id);
Kind regards
Markus
Von: [EMAIL PROTECTED] [mailto:[EMAIL
Thomas Pundt wrote:
>
> On Freitag, 20. Juni 2008, Gregory Williamson wrote:
<...snip...>
> Does
>
> update foo
>set foo.foo_name2 = foo_old.foo_name2
> from foo_old
> where foo.foo_id = foo_old.foo_id;
>
> work for you?
Thanks to all for pointing out the FROM clause.!
"UPDATE foo se
On Freitag, 20. Juni 2008, Gregory Williamson wrote:
| For reasons best left unmentioned, I need to update entries in a table from
| a backup; I need to do all entries.
|
| For reasons eluding my sleep deprived eyes this fails in every variation I
| can think of:
|
| update foo set foo.foo_name2=fo
Hi,
I want to test the behavior of an an aggregate without creating a dummy
table for it.
But the code for it is horrible.
Is there no simpler way?
select max(foo)
from (select 1 as foo union select 2 as foo)bar;
thx
David Spadea wrote:
Steve,
I'd just like to add that I agree with Scott that this is asking for
trouble if the field being renumbered is used as a foreign key
somewhere. If you have no way of changing this logic, you should at
least look into 'on delete cascade' and 'on update cascade' on you
Hello.
How could I write something like:
DECLARE r table%ROWTYPE;
...
UPDATE table SET (table.*) = (SELECT r.*) WHERE id = r.id;
*This *syntax is invalid, and I cannot find another proper way to do it
without explicit enumeration of table's columns.
I don't want to explicitly specify tabl
On Wed, Jun 18, 2008 at 4:08 PM, Scott Marlowe <[EMAIL PROTECTED]>
wrote:
> On Wed, Jun 18, 2008 at 1:48 PM, Kynn Jones <[EMAIL PROTECTED]> wrote:
> >
> >
> > What's the simplest way to copy a table from one database to another one
> > running on the same server?
>
> Easiest way to me:
>
> pg_dump
Hello everyone,
I already asked about that a couple of days ago, but didn't get an
satisfying solution for my problem which is following:
I need to create a view that does a query on a second database on the
same PostgreSQL server. dblink seems to be the only (???) solution for
doing so. The
Easy: you've got 3 Ifs without "END IF":
IF uppergt = 'BOD' THEN RETURN 0 ;
IF uppergt = 'MOD' THEN RETURN 86400/2 ;
IF uppergt = 'EOD' THEN RETURN 86399 ;
Igor
-Original Message-
From: Ralph Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 19, 2008 3:19 PM
To: pgsql-general@
Hi, Hermann.
The best solution in my opinion would be using users name and password
to connect to database. That way you can decide (grant) what tables can
be accessed by this user and there is no password you have to hide from
him (or others). So use stored procedure returning set of records
In response to Hermann Muster <[EMAIL PROTECTED]>:
> Hello everyone,
>
> I already asked about that a couple of days ago, but didn't get an
> satisfying solution for my problem which is following:
>
> I need to create a view that does a query on a second database on the
> same PostgreSQL serve
"Willy-Bas Loos" <[EMAIL PROTECTED]> writes:
> I want to test the behavior of an an aggregate without creating a dummy
> table for it.
> But the code for it is horrible.
> Is there no simpler way?
> select max(foo)
> from (select 1 as foo union select 2 as foo)bar;
Perhaps VALUES?
regression=# s
On Fri, Jun 20, 2008 at 8:06 AM, Bill Moran
<[EMAIL PROTECTED]> wrote:
> In response to Hermann Muster <[EMAIL PROTECTED]>:
>
>> Hello everyone,
>>
>> I already asked about that a couple of days ago, but didn't get an
>> satisfying solution for my problem which is following:
>>
>> I need to create
On Fri, Jun 20, 2008 at 10:11:08AM -0400, Tom Lane wrote:
> "Willy-Bas Loos" <[EMAIL PROTECTED]> writes:
> > I want to test the behavior of an an aggregate without creating a dummy
> > table for it.
> > But the code for it is horrible.
> > Is there no simpler way?
>
> > select max(foo)
> > from (s
I have a server of which the OS timezone is set to Pacific time
(currently -7). I run the following query on it
SELECT now(), now() AT TIME ZONE 'GMT+10:00', now() AT TIME ZONE
'GMT-10:00', now() AT TIME ZONE 'Australia/Melbourne'
I would expect this to return:
* column 1 - the current time in
Laurent Birtz wrote:
> > No. The closest thing we have is log_lock_waits in 8.3. I wonder if
> > you could hack up something to monitor the server logs for such messages
> > and cancel the queries.
>
> Assuming I can monitor the logs in this way, how would I cancel the
> queries (or lack thereo
On Friday 20 June 2008 1:19 pm, Collin Peters wrote:
> I have a server of which the OS timezone is set to Pacific time
> (currently -7). I run the following query on it
>
> SELECTnow(), now() AT TIME ZONE 'GMT+10:00', now() AT TIME ZONE
> 'GMT-10:00', now() AT TIME ZONE 'Australia/Melbourn
We had a run away process on our database box that used up all the
physical and all the virtual memory (swap). This caused the RedHat
Linux oom-killer to kill many processes, including some Postgres ones.
Postgres went into a funky state after that time:
2008-06-20 14:19:10 CDT [unknown] LOG: inv
On Fri, Jun 20, 2008 at 7:12 PM, John Cheng <[EMAIL PROTECTED]> wrote:
> We had a run away process on our database box that used up all the
> physical and all the virtual memory (swap). This caused the RedHat
> Linux oom-killer to kill many processes, including some Postgres ones.
> Postgres went i
I am running postgresql 8.3, I was not aware of the 3 options (smart,
fast, or immediate). So it used the default - "fast".
The state of the server when I sent this e-mail was that there were
two remaining connections/postgres subprocesses. I used kill -9 to
stop those two subprocesses. Then postg
On Fri, Jun 20, 2008 at 7:56 PM, John Cheng <[EMAIL PROTECTED]> wrote:
> I am running postgresql 8.3, I was not aware of the 3 options (smart,
> fast, or immediate). So it used the default - "fast".
>
> The state of the server when I sent this e-mail was that there were
> two remaining connections/
22 matches
Mail list logo