postgresql

Resetting the database to postgresql

Can you tell me how to delete all the records from all the database tables without deleting the tables themselves?

Define a SERIAL (AUTO INCREMENT) column in postgresql

How to use a query in the information schema to determine the serial column by specifying the required table. Upd.Solution: SELECT * FROM information_schema.columns WHERE table_name='test' and column_default like 'nextval%'

mdf & ldf (MS SQL) - import to PostgreSQL

There are two files from the MS SQL database-mdf and ldf. The task is to get the data from there and transfer it to PostgreSQL. Is it possible? If so, with what and how?

Updating DB records in a many-to-many relationship

Learning SQL. I have a table products_to_colors it links 2 tables colors and products, a many-to-many relationship. Contains ... rmation on SQL (especially postgres) on the internet, especially examples. It is not clear how to learn to write good code =)

Create a PostgreSQL database using an SQL script for a java application

I am making an application on Java with a small local database and I need this database to be created using an sql file. That ... maintainer SUPERUSER CREATEROLE CREATEDB; Tell me, will it work and create a database and if so, how do I run this script?

Configuring ODBC for PostgreSQL 9.2

I'm trying to set up a remote connection to PostgreSQL 9.2 under Windows. On the server in pg_hba.conf added host all postgr ... for the first time, I need to measure the query execution time from my client to different types of DBMS, so I use Postgre.

Linux. PostgreSQL

Installed PostgreSQL on Linux. The problem is that I can't use the psql command, because it requires a password. When install ... I tried to remove PostgreSQL from the server, but it didn't work, because it requires a password. What could be the problem?

How does the RECORD type work in a PostgreSQL trigger function?

I need to log postgre tables whose records do not have timestamps, so that I can get statistics on them in the future. I solv ... in the same order as the columns of the table. The question is, will the order always match, or are these some special cases?

Data exchange between JavaScript and PostgreSQL (WITHOUT node.js)

Please tell me how you can "make friends" with JS and PG? As far as I understand, directly from the browser without using Nod ... tly passes them to JS for their corresponding output on the front?! I will be glad to receive answers and bright thoughts )))

Fill an SQL table with data from another table

There are 2 tables: "PS" "S" How do I fill in the "UserId" column in the "S" table based on the data from the "PS" table? I ... "userID" so that "PS"." SubscriptionId " = "S". "id". You must actually fill in the table " S " The result I want to get:

Ubuntu admin panel pgAnmin 4 on Apache 2 server issues 403 Forbidden

This question has already been, but I have not found an answer Maybe who knows? For this example I am trying to deploy the po ... ingly, how to solve the problem 403 Forbidden? Please do not throw stones, because I have very little experience in this area

How do I delete a Postgres database?

How do I delete a Postgres database?

How do I check which metdom the user was logged in to?

While setting up the bloody enterprise, I learned for myself that the sequence of authorization types affects the behavior of ... How can I track which authorization method was selected? Links https://www.postgresql.org/docs/9.6/auth-pg-hba-conf.html

Postgresql JDBC Maven. Does not connect to the database after the build

I started studying JDBC and ran into this problem: I wrote a simple program in IntelliJIdea that tries to connect to a Postgr ... equires accounting and, possibly, payment. Or is it possible to somehow run a project written in 11 and higher using jre 8?)

Finding the shortest path in a graph in SQL

Writing SQL code to find the shortest path(From ' S ' to 'Y'), I stopped at calculating the total cost of with recursive tem ... if you do not count the total weight (price), all it works. Note: The graph is oriented, the direction is from par_id to id

How do I pass the value of a variable from the go code to a stored procedure?

Go code: func main() { psqlInfo := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable", ... lpgsql AS $function$ begin return query (select * from mytable where id=i); return; end $function$ ;

Auto-increment of id in PostgreSQL

The table contains two columns: id | description How do I make it so that when a new line is added, the user ID will grow itself? That is, INSERT INTO users DEFAULT VALUES; Will give (1,), (2, ) , and so on.

Problem with PostgreSQL socket placement on Unix

By default, in Ubuntu, the db server socket should obviously be stored in the /var/run/postgresql folder, but every time I in ... GSQL.5432"? How do I move the socket to the desired folder, or reassign system variables to search for it in another folder?

When using postgres via the console, Russian characters are not displayed correctly

The other day, I accidentally deleted the environment variables when I was adding a new variable. I used to use the command ... e more. Please tell me, if anyone has encountered a similar problem, what you need add or how to deal with a similar problem.

Should I use a database or storage for images?

Hello everyone I'm starting to plan the architecture of a web application, and I have a question about storing images. In th ... ase, which one to choose? I don't have an answer to the question of how many images there will be, but I have a lot of plans.