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 earl
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
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 wor
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
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 opposit
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
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
Tom Lane wrote:
Mark Gibson <[EMAIL PROTECTED]> writes:
Right then, I think I've got this sorted,
DROP TABLE worked after a swift:
DELETE FROM pg_depend WHERE objid = 5173132;
There's something awfully flaky going on here. The system should never
have let you get into this st
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 swi
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 c
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
Web Developer &
hema
using 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
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.
---(en
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.
--
M
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. :(
ot;;
$db = pg_connect($connstr);
$res = pg_query($db,"SELECT current_user, session_user;");
print_r(pg_fetch_all($res));
pg_close($db);
?>
Cheers
--
Mark Gibson
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings
of array's:
Is there any 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.
C
ns?
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
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.
---(en
JOIN
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
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 Admi
Postgres 7.4.1.
Regards,
Iker
You need to quote 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.
actical).
Is this a limitation of PostgreSQL or dblink?
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 findi
21 matches
Mail list logo