Michael Glaesemann wrote:
On Jun 25, 2006, at 14:23 , Mark Gibson wrote:
SELECT play_length - INTERVAL 'play_seconds seconds' ...
The column isn't interpolated into the string. Try
SELECT play_length - play_seconds * INTERVAL '1 second'
That worked great! Thanks!
Mark
I have unexpected results when trying to cast a string to a timestamp:
test=# select TIMESTAMP WITH TIME ZONE '2006/06/25 06:00:00 GMT-5'
test-# ;
timestamptz
2006-06-24 20:00:00-05
Seems that what I get is about 10 hours earlier than I expect...
Any ideas why
Mark Gibson wrote:
I have unexpected results when trying to cast a string to a timestamp:
test=# select TIMESTAMP WITH TIME ZONE '2006/06/25 06:00:00 GMT-5'
test-# ;
timestamptz
2006-06-24 20:00:00-05
Seems that what I get is about 10 hours earlier than I
If play_length is a timestamp, I can do this:
SELECT play_length - INTERVAL '13 seconds' ...
But what if play_seconds is a column?
SELECT play_length - INTERVAL 'play_seconds seconds' ...
This doesn't work.
ERROR: invalid input syntax for type interval: play_seconds seconds
Can anyone
Is there a disadvantage to having the primary key for a table be a text
type vs. an integer type? Performance? Any difference between having a
varchar or char as a primary key?
My instinct tells me that an integer is preferred, but I'm looking for a
more concrete answer.
Thanks,
Mark
Scott Marlowe wrote:
If you need a unique constraint on the text field anyway, and it's a
natural key, you're generally better of using that field as the pk.
However, if it's not a natually unique key, then it shouldn't be the pk,
and int is a perhaps better choice.
There are two VERY
Andrew Sullivan wrote:
On Wed, Oct 06, 2004 at 05:25:58PM +0100, Mark Gibson wrote:
I had to remove Slony's schema manually as I was having problems
with it. I was in the process of removing all Slony related stuff,
and all my slave tables when this problem occurred, and was going to
start again
the pg_catalog tables?
Is there any other information I should provide that may help?
Specs:
Redhat Enterprise Linux 3
PostgreSQL 7.4.5
Slony-I 1.0.2
Cheers
--
Mark Gibson gibsonm |AT| cromwell |DOT| co |DOT| uk
Web Developer Database Admin
Cromwell Tools Ltd.
Leicester, England
Ying Lu wrote:
Hello,
In mysql, we use show processlist to see all current process. Could
someone let me know in PostgreSQL, what commands that we can check the
current connections and processes please?
SELECT * FROM pg_catalog.pg_stat_activity;
--
Mark Gibson gibsonm |AT| cromwell |DOT| co |DOT
Tom Lane wrote:
Mark Gibson [EMAIL PROTECTED] writes:
I kept getting the following error:
ERROR: cache lookup failed for relation 4667548
This implies that something someplace still has a link to the table with
that OID. You could do \set VERBOSITY verbose so that the code
location the error
Mark Gibson wrote:
I'm guessing I'm gonna have to route through pg_catalog for this and
delete all deps manually, but it this going to be safe?
Would I be better off dumping and restoring the whole database?
Right then, I think I've got this sorted,
DROP TABLE worked after a swift:
DELETE FROM
easily delete the person in
tbl_everyone and insert it again in tbl_employees...
Have you tried deferred constraints, eg:
BEGIN;
SET CONSTRAINTS ALL DEFERRED;
DELETE ...;
INSERT ...;
END;
I've haven't had chance to test this, but I think this could
be what you're looking for.
--
Mark Gibson gibsonm
Mark Gibson wrote:
Hi,
I'm having intermittent problems connecting to my PostgreSQL database
from PHP, using Kerberos credentials forwarded from mod_auth_kerb.
[snip]
The trouble is that sometimes the connection works,
and sometimes it doesn't. It's very unpredictable. :(
Oh, I forgot
;);
print_r(pg_fetch_all($res));
pg_close($db);
?
Cheers
--
Mark Gibson gibsonm |AT| cromwell |DOT| co |DOT| uk
Web Developer Database Admin
Cromwell Tools Ltd.
Leicester, England.
---(end of broadcast)---
TIP 7: don't
way to specify array slices from a subscript to the
beginning or end of an array?
eg:
element to end: array[5:*]
beginning to element: array[*:5]
At present it is possible by using an extreme +ve or -ve subscript
value, but this isn't nice.
Cheers
--
Mark Gibson gibsonm |AT| cromwell
?
The only thing you can do is change your column name.
The manual tells you about the system columns here:
http://www.postgresql.org/docs/7.4/static/ddl-system-columns.html
--
Mark Gibson gibsonm |AT| cromwell |DOT| co |DOT| uk
Web Developer Database Admin
Cromwell Tools Ltd.
Leicester, England
pg_catalog.pg_namespace n ON (c.relnamespace = n.oid) INNER JOIN
pg_catalog.pg_attribute a ON (a.attrelid = c.oid)
WHERE
n.nspname = '{schema_name}' AND
c.relname = '{table_name}' AND
a.attisdropped = false AND
a.attnum 0
Replace {schema_name} and {table_name}.
--
Mark Gibson
?
Could dblink use type names instead of oid's?
If not, could dblink be adapted to use some kind of
remote oid - local oid mapping table for datatypes?
I would be willing to have a poke around in dblink.c,
if someone could confirm my findings and point me in the right direction.
Cheers
--
Mark Gibson
the table name if it contains upper case or strange
characters:
SELECT companyID FROM app;
--
Mark Gibson [EMAIL PROTECTED]
Web Developer Database Admin
Cromwell Tools Ltd.
Leicester, England.
---(end of broadcast)---
TIP 3: if posting/reading through
Mark Gibson wrote:
You need to quote the table name if it contains upper case or strange
characters:
SELECT companyID FROM app;
Obviously I meant column name, but it applies to any object identifier ;)
--
Mark Gibson [EMAIL PROTECTED]
Web Developer Database Admin
Cromwell Tools Ltd
20 matches
Mail list logo