[SQL] int to date

2005-07-25 Thread Daniel Drotos
Hi, I have a string containing hexa dump of an 4 bytes integer, like '6AF4805C'. Is it possible to convert it somehow to date type in plpgsql (v8.0.0-rc1)? Doc says that date is represented as 4 bytes internaly. How can I get internal representation of a date type field? So I would be able

[SQL] deleting rows in specific order

2006-10-09 Thread Daniel Drotos
Hi, What is the best way to do something like: delete from tablename where something order by somefield... Daniel ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] deleting rows in specific order

2006-10-11 Thread Daniel Drotos
On Wed, 11 Oct 2006, Markus Schaber wrote: What is it that you're trying to achieve with the ordered delete? Maybe there's a better way to solve your underlying problem. I've a table which has a field for some info (number) and a date field (insertion date) and others. After inserting new r

Re: [SQL] pg & Delphi

2007-08-28 Thread Daniel Drotos
On Tue, 28 Aug 2007, Kitter Georgiy wrote: which has so rectriction, that client should be written on Delphi (CBuilder). Please, prompt me how to adjust Delphi to use Postgres. We use pgExpress driver from http://vitavoom.com It is commercial, but cheep and works well. You can try ODBC as we

[SQL] array handling on 8.0.3

2007-10-09 Thread Daniel Drotos
Hi, I have to run a function on a 9.0.3 server. Following part (of a bigger function): create or replace function t(p varchar) returns void as $$ declare v varchar; f varchar; a varchar[]; i integer; begin a:= '{}'; if p like '%/%' then v:= trim_null(spl

Re: [SQL] array handling on 8.0.3

2007-10-09 Thread Daniel Drotos
On Tue, 9 Oct 2007, Daniel Drotos wrote: I have to run a function on a 9.0.3 server. Following part (of a bigger ^ I mean 8.0.3 sorry Daniel ---(end of broadcast)--- TIP 6: explain

Re: [SQL] array handling on 8.0.3

2007-10-09 Thread Daniel Drotos
Hi, I found my bug, please forget my (stupid) question! Daniel ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Computed table name in function

2007-10-10 Thread Daniel Drotos
On Wed, 10 Oct 2007, Ray Madigan wrote: I thought that the documentation said I couldn't use EXECUTE on a SELECT INTO? Try "for record_var in select ..." Look for 36.7.4 Looping Through Query Results in the docs. Daniel ---(end of broadcast)-

[SQL] Accessing field of OLD in trigger

2007-10-11 Thread Daniel Drotos
Hi, I'm working on a row level plpgsql trigger running after delete, using a 8.0.3 server. It gets a parameter which is a field name of the OLD record. How can that field be accessed? I'd like to do something like: for recvar in 'select OLD.'||quote_ident(TG_ARGV[0])... Daniel

[SQL] Accessing field of OLD in trigger

2007-10-12 Thread Daniel Drotos
Hi, I'm working on a row level plpgsql trigger running after delete, using a 8.0.3 server. It gets a parameter which is a field name of the OLD record. How can that field be accessed? I'd like to do something like: for recvar in 'select OLD.'||quote_ident(TG_ARGV[0])... Daniel Ps: sorry a