> I have two tables
>
> create table orders (
> o_id serial primary key
> ...
> );
>
> create table orders_log (
> ol_id serial primary key,
> o_id int4 not null references orders(o_id),
> ol_timestamp timestamp,
> ol_user,
> );
>
> How can I select all from orders and the last (latest) entry from
> I store content of an .txt file in a text column in the database.
>
> server_encoding is UTF8.
What does 'psql -l' say?
--
regards
Claus
When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.
Shakespeare
--
Sent via pgsql-sql mailing list (pgsql-sql@postgre
> Why in the world are you using a for-loop for this at all? It would be
> tremendously faster as a single SQL command:
>
> update duplicates set hashcode = rtrim(hashcode, E'\n') where
> length(hashcode) = 33;
Thank you. I was "caught" in the plpgsql-lane. This is of course much
simpler and muc
Hi.
I have a table with a hashcode-field which is a md5-checksum of a
file. I updated all null-entries using a rails-script by calling
'/sbin/md5 -q' (on FreeBSD). When all null-entries were updated I
found out that '\n' was added to the md5-checksum. :-)
So I wanted to update the table using plp
> The query for "latest price for each product" goes like this (which I
> can grasp quite easily):
>
> SELECT * FROM price p1
> WHERE ctime=(SELECT MAX(ctime) FROM price p2 WHERE
> p1.product_id=p2.product_id)
>
> or:
>
> SELECT * FROM price p1
> WHERE NOT EXISTS (SELECT * FROM price p2 WHERE
>> The way i find the primary key of a table is:
>>SELECT indkey FROM pg_index WHERE indisprimary='t' AND
>> indrelid=TABLEOID;
>> i noticed that some columns have been added to pg_index : indisvalid,
>> indcheckxmin, indisready,indoption
>> Should i include any of them (e.g. indisvalid)
> we have been running our own heavily modified/enhanced version of dbmirror,
> running on 7.4 for some years,
> and now it is the time to upgrade to 8.3.
>
> The way i find the primary key of a table is:
>SELECT indkey FROM pg_index WHERE indisprimary='t' AND
> indrelid=TABLEOID;
> i not
How do I increase my performance knowing that my server is a huge server.
Here some parameters I suppose are important on this settings:
"shared_buffers";"8000kB";"Sets the number of shared memory buffers used by
the server."
"max_connections";"100";"Sets the maximum number of concurrent connecti
> select order_id from
> (select o.order_id from orders o join order_lines ol using (order_id)
> where o.time > '2006-01-01T00:00' and o.time < '2007-01-01T00:00'
> and (ol.item_id = 10 or ol.item_id = 11 or ol.item_id = 12) group by
> o.order_id) as prints
> inner join
> (select ho.order_
Forgot to mention that this is on postgresql 7.4.14 and FreeBSD 6.2.
regards
Claus
Hi.
I'm performing the following query to get all items sold in 2006 which
are in category prints or gifts, but not in extra:
select order_id from
(select o.order_id from orders o join order_lines ol using (or
Hi.
I'm performing the following query to get all items sold in 2006 which
are in category prints or gifts, but not in extra:
select order_id from
(select o.order_id from orders o join order_lines ol using (order_id)
where o.time > '2006-01-01T00:00' and o.time < '2007-01-01T00:00'
and (ol.ite
I am using postgres 8.2.3. I have recently converted my database from
sql-ascii to UTF8. I have a portal which calls a perl program to insert the
data into the database.
While inserting, I am getting an error message
DBD::Pg::st execute failed: ERROR: invalid byte sequence for encoding
12 matches
Mail list logo