Questions tagged as 'postgresql'

1
answer

Restriction Check in ProstgreSQL does not work

the next check restriction does not do its function, CREATE TABLE products ( product_no integer NOT NULL, name text NOT NULL, price numeric CONSTRAINT ck_nombre CHECK (name like '[A-Z][0-9][0-9]') ); At the time of entering...
asked by 31.07.2018 / 04:50
1
answer

Know if a table exists or not in postgres

What happens is that I am trying to see if a table exists in postgres or not, I managed to make the query, the problem is that it is consulting if it exists in the whole postgres scheme and not in the base on which I am executing the query and...
asked by 30.07.2018 / 18:27
1
answer

Problems with INSERT from PHP

I tell you my problem: I have a csv file with a certain amount of data, what I do is open this file and modify some fields that are badly loaded (Phones with spaces, hyphens, etc ...) and then I have to load them in my database. Postgress dat...
asked by 03.08.2018 / 23:03
0
answers

Save GIF in PostgreSQL database

Good afternoon I need some help, what I need is to save a GIF in a postgreSQL database. I have a table called words which counts of 4 fields ...    word of type text description of type text GIF of type text   Bytea type resource In th...
asked by 01.08.2018 / 22:25
2
answers

How exactly is an sql injection with pg_prepare avoided?

If 'mysql_real_escape_string for postgresql' is used to avoid sql injections, how can I reproduce the result with pg_prepare? What exactly is the logic behind it? <?php // Connect to a database named "mary" $dbconn = pg_connect("dbname=ma...
asked by 27.07.2018 / 21:31
0
answers

Error installing php-pgsql Centos 6.9

After having installed version 7.2.8 of php and version 10 of postgresql on a server in Centos 6.9 when trying to install the pgsql drivers for php it gives me an error of dependencies: yum install php-pgsql The error he gives me is this:...
asked by 31.07.2018 / 14:57
1
answer

Get the name of the databases stored in a DBMS

I am trying to make a connection to a database manager (postgresql, Mysql and Access) and I would like to know if there is any way to connect to the manager and extract the information from the name of the databases that are stored there. All th...
asked by 22.07.2018 / 03:59
1
answer

TRIGGER PostgresSQL, insert and delete

I have 3 tables, one "task" and two other identical tables, with their respective fields of name "imputa_pendientes" and "imputa". The 3 tables have a common field project_id. I want to ensure that when a line is inserted in tasks with id_sec...
asked by 24.07.2018 / 12:29
1
answer

Function receives data table

I tell you, I have a function CREATE OR REPLACE FUNCTION test_funcion(x numeric) RETURNS TABLE(codigo character varying) AS 'consulta' LANGUAGE sql; Which when entering an id (X) brings me a list of codes of purchases of that client ....
asked by 19.07.2018 / 22:57
0
answers

How to insert id in csv reading with DJango

I have the following question, in which way I can insert an id that I have obtained from another table, in reading a .csv file, which I am importing into my database with the django-import-export library. I have the code in the following way...
asked by 16.07.2018 / 17:57