Try to export some data from the table using copy from ... to see
what it looks like.
On 2008-Mar-25, at 12:19, Jon Norman wrote:
I'm using PostgreSQL 8.3.1.
I've created the following composite type:
CREATE TYPE expression_event_type AS (
event_id varchar(10),
expr_indices smallint[]
);
Hi there
I have a list of events that take place in a certain city at a
certain date. Now I would like to have the first two (ordered by
date) events for each city.
Is there a way to do this with one query?
I am using PostgreSQL 7.4.
of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
--
Guy Fraser
Network Administrator
The Internet Centre
1-888-450-6787
(780)450-6787
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ
On Wed, 2007-03-21 at 14:37 -0300, Ezequias R. da Rocha wrote:
Guy Fraser escreveu:
On Wed, 2007-03-21 at 11:04 -0300, Ezequias R. da Rocha wrote:
Hi list,
I would like to know if postgresql has a Regular Expressions (Regex)
implemented already.
With it we could implement
On Sat, 2006-29-04 at 01:50 -0500, Ben K. wrote:
On Fri, 28 Apr 2006, Guy Fraser wrote:
-- HEAD
insert into linkedlist values(null,1,0);
insert into linkedlist values(1,2,10);
insert into linkedlist values(2,3,20);
insert into linkedlist values(3,4,30);
insert into linkedlist values
On Thu, 2006-06-04 at 13:53 +0530, AKHILESH GUPTA wrote:
dear all,
i want to encrypt and decrypt one of the fields in my table (i.e-
password field)
i have searched and with the help of pgcrypto package, using function
crypt, i am able to encrypt my data,
but there is nothing which i found
'kill -9' the postmaster
--
Guy Fraser
Network Administrator
The Internet Centre
1-888-450-6787
(780)450-6787
---(end of broadcast)---
TIP 8: explain analyze is your friend
Off the top of my head:
psql -c select into dump_table from old_table ; database
pg_dump -t dump_table -f dump_table.tmp database
sed -e s/dump_table/table_name/g dump_table.tmp table_name.sql
rm dump_table.tmp
You should now have a file called table_name.sql with the stuff
required
--
guy
Thomas F.O'Connell [EMAIL PROTECTED] writes:
select 2004-06-08;
?column?
--
1990
I'm not exactly sure how the bare string is converted internally, but
it's
clearly not a complete date like you're expecting.
--
Guy Fraser
Network Administrator
The Internet Centre
regarding errors like 'Object not
found' or build extensive automated regression tests but then you are going
to spent time for building those test cases which still may fail to detect
errors which are otherwise just easily detected by the compiler.
-Original Message-
From: Guy Fraser [mailto
Kenneth Gonsalves wrote:
On Tuesday 20 January 2004 19:26, Chris Bowlby wrote:
Hi Ken,
Under 7.3.x this option was removed, you need to test via:
SELECT * from table where field IS NULL;
thanx - works in both 7.1 and 7.3 - why do these guys keep fooling around
with these thangs?
select . where intnumber IS NULL
Geoffrey wrote:
How does one check for an unset value in an integer field?
I've tried such things as:
select . where intnumber = ''
select .. where intnumber = ?
select . where intnumber = NULL
Thanks.
---(end of
8652
28652
08895
18894
Ultimately I want to know the group number for EACH rd_pk with the
highest run number. Can this be done in one query? Or will I need to
code with a loop?
Thanks
Jodi
--
Guy Fraser
Network Administrator
; if there are multiple dupes, they may get
picked multiple times in the second query :-(.]
--
Guy Fraser
Network Administrator
The Internet Centre
780-450-6787 , 1-888-450-6787
There is a fine line between genius and lunacy, fear not, walk the
line with pride. Not all things will end up as you wanted, but you
definitely filing this for use in a
future,near term project.
Guy Fraser wrote:
Hi
As an additional note;
Older data is moved into a seperate table to reduce the number of
records that require regular vacuuming. Since the tables would
contain similar data it is simple to use union selections in a view
Hi
CREATE VIEW user_stuff ...select comand that displays what you want... ;
This might be what you want ?:-)
CREATE VIEW user_stuff
SELECT username AS Username,userpassword AS
Pass/Attribute,startdate::TEXT AS Date/Value
FROM user
UNION SELECT
Is this what you are looking for?
test=# select 'now'::time as test,'2003-05-30 14:51:38-06'::timestamptz
as stamp into temp cruft;
SELECT
test=# select test,stamp,test - stamp::time as diff from cruft;
test | stamp | diff
-++-
The email at the bottom gave me an idea, but it doesn't quite work:
CREATE AGGREGATE accumulate(
BASETYPE = text,
SFUNC = textcat,
STYPE = text,
INITCOND = '' );
--
SELECT ('{' || ltrim(accumulate(',' || tablename),',') || '}') as cruft
FROM pg_tables
WHERE hasindexes = 'f';
Would it not be more reasonable to have array_dims return an int or int[]?
Has anyone ever seen an array that does not start at 1?
The other problem I find with array_dims returning text is when you have a
multi-dimentional array like this IIRC;
array_dims('{{asd,fgh,jkl},{zxc,vbn,mlk}}') =
FYI
In text files on a Mac. the EOL character is a CR only.
What a messy thing this whole EOL cruft is.
To convert between these text formats on linux is easy if you have dos2unix.
The dos2unix on linux can perform many format conversions to and from unix,dos
and mac formats.
On BSD you need
Hi
You will need two text utilities {dos2unix and sed} to do this in the simplest
way. They are fairly standard text utilities and are probably already on your
machine.
This is how I would do it :
sed s/\//g file_name.txt \
| dos2unix \
| pgsql -c COPY table_name FROM STDIN USING DELIMITERS
Hi
You should use date instead of datetime since the data is only a date and
a date type uses less storage than a timestamp.
For time only data use type time or timetz if you want the timezone as
well. For data with a date and time use timestamp or timestamptz if you
want to include the
Hi
To make it easier to do this in SQL you can create a view like this :
CREATE VIEW db_list AS
SELECT d.datname as Name,
u.usename as Owner,
pg_catalog.pg_encoding_to_char(d.encoding) as Encoding
FROM pg_catalog.pg_database d
LEFT JOIN pg_catalog.pg_user u ON d.datdba =
Hi
I would agree that cron is probably the best solution.
You could have cron perform a query that has a trigger and performs all the
tasks you need done. As well you could create a trigger on other queries that
would perform the other things as well, but make sure it isn't a heavily used
NOTE: This is a feature in 7.3 it was either added or fixed, so you will not
be able to do this unless you are using version 7.3. Remember to backup with
pg_dumpall before you upgrade.
This is a sample sent to me earlier this week, that iterates an integer array:
Cut Here
Hi
I am trying to write a function to step through an array and output each value
as a set {list}, I think.
This is what I want to do:
select attribute,array_list(values,1,sizeof(values)) as value from av_list;
Turn :
attr6 | {val3,val7,val4,val5}
Into :
attr6 | val3
attr6 | val7
attr6 |
26 matches
Mail list logo