date/time
Hi,
I have read the man's with Postgres.
But I can't seem to get Postgres use European time notation (dd/mm/yyyy).
Where can I adjust this? (in which file?)
Snef
snef wrote:
Hi,
I have read the man's with Postgres.
But I can't seem to get Postgres use European time notation (dd/mm/yyyy).Where can I adjust this? (in which file?)
Snef
SET DATESTYLE TO 'SQL, EUROPEAN';
SELECT NOW();
On Mon, Jan 15, 2001 at 23:09:26 +0100, snef wrote:
But I can't seem to get Postgres use European time notation (dd/mm/yyyy).
Do
SET DATESTYLE TO 'POSTGRES,EUROPEAN'
and use European time notation with hyphens, e.g.
SELECT * FROM Foo WHERE start >= '31-12-2000'
Where can I adjust this? (in which file?)
On my system, it's /etc/postgresql/postmaster.init, the "PGDATESTYLE"
setting.
HTH,
Ray
--
LWN normally tries to avoid talking much about Microsoft - it is simply
irrelevant to the free software world most of the time.
http://www.lwn.net/2000/0406/
snef wrote:
Hi,
I have read the man's with Postgres.
But I can't seem to get Postgres use European time notation (dd/mm/yyyy).Where can I adjust this? (in which file?)
Snef
Actually, I think you may want the environment variable PGDATESTYLE. It
sets the datestyle for new connections. That is all I know about it!
Ian
On Tue, Jan 16, 2001 at 07:24:15PM -0800, Ian Harding wrote:
snef wrote:
Hi,
I have read the man's with Postgres.
But I can't seem to get Postgres use European time notation (dd/mm/yyyy).Where can I adjust this? (in which file?)
Snef
Actually, I think you may want the environment variable PGDATESTYLE. It
sets the datestyle for new connections. That is all I know about it!
Either set the environment variable PGDATESTYLE to 'Postgres,European' or
send the query
set datestyle='Postgres,European'
(I think SQL instead of Postgres works too)
eg:
quartz% printenv PGDATESTYLE
Postgres,European
rfb=# show datestyle;
NOTICE: DateStyle is Postgres with European conventions
SHOW VARIABLE
Cheers,
Patrick
Umm I must have missed it in the manual, (read it 3-4 times tho) but what is
the equivalent data dictionary structure in Postgres to the following in
Oracle.
Select table_name from user_tables;
(gives a list of the table names in the database(table space) used at the
time)
etc.... various special tables defining the data dictionary....
M
On Fri, Jan 19, 2001 at 21:29:41 +1100, Matthew Taylor wrote:
Umm I must have missed it in the manual, (read it 3-4 times tho) but what
is the equivalent data dictionary structure in Postgres to the following
in Oracle.Select table_name from user_tables;
etc.... various special tables defining the data dictionary....
PostgreSQL stores its meta-data in tables named pg_something, e.g. for
7.0.3:
pg_aggregate pg_description pg_listener pg_statistic
pg_am pg_group pg_opclass pg_tables
pg_amop pg_index pg_operator pg_trigger
pg_amproc pg_indexes pg_proc pg_type
pg_attrdef pg_inheritproc pg_relcheck pg_user
pg_attribute pg_inherits pg_rewrite pg_views
pg_class pg_ipl pg_rules
pg_database pg_language pg_shadow
(obtained by doing "select * from pg_" <TAB> in "psql")
HTH,
Ray
--
Would you rather be root or reboot?
On Fri, 19 Jan 2001, Matthew Taylor wrote:
Umm I must have missed it in the manual, (read it 3-4 times tho) but what is
the equivalent data dictionary structure in Postgres to the following in
Oracle.Select table_name from user_tables;
(gives a list of the table names in the database(table space) used at the
time)etc.... various special tables defining the data dictionary....
Take a look at pg_class and pg_tables (which is a view based on pg_class),
which are available for each schema:
select * from pg_tables where tableowner=CURRENT_USER;
-- Brett
http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
A woman without a man is like a fish without a bicycle.
-- Gloria Steinem